From user-return-7889-apmail-geronimo-user-archive=geronimo.apache.org@geronimo.apache.org Mon Oct 08 16:53:55 2007 Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 93511 invoked from network); 8 Oct 2007 16:53:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Oct 2007 16:53:55 -0000 Received: (qmail 92048 invoked by uid 500); 8 Oct 2007 16:53:40 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 92028 invoked by uid 500); 8 Oct 2007 16:53:40 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 92017 invoked by uid 99); 8 Oct 2007 16:53:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 09:53:40 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of kevan.miller@gmail.com designates 209.85.132.250 as permitted sender) Received: from [209.85.132.250] (HELO an-out-0708.google.com) (209.85.132.250) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2007 16:53:43 +0000 Received: by an-out-0708.google.com with SMTP id c5so150311anc for ; Mon, 08 Oct 2007 09:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; bh=+A1lUbdoEQhusdWp/Ybmu9h7oK1hN6wJYLLYuzy0ZPc=; b=HzfiWk4t+WF86f/cNMvgyaWFnX6eJifWoPiafwNZ0DjAqh4GkoIVEUQZ1XBkHgZrYm1kni64IjfRshLcLz/Ync500kJpMcclxteyaUOI3pxNZ9wT9zbZ+WeUtAXSRfzaXDogZYVSlznlw24+ZBJ+2/M+XxNDPoGFGLKd0oZ6y+w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer; b=h7KOR83LYfL7XllaaBREZ/Ze8icJINdwkkuMedZjnWR1ZpSKuz4ioqLtAE6JvR1oMW3aIYK82sV/BpeQagj5+c7HdNfexg23wpM8EaW6J1a6KXA6SDM0Wt8kqMPudNrkUtSQDA0zdBuKxI2sShFp4/JNk7yZE1EX/SB+0LRMaP4= Received: by 10.142.48.14 with SMTP id v14mr3150130wfv.1191862401097; Mon, 08 Oct 2007 09:53:21 -0700 (PDT) Received: from ?10.0.1.200? ( [76.182.118.42]) by mx.google.com with ESMTPS id i18sm7158984wxd.2007.10.08.09.53.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2007 09:53:20 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <3D8E84095C6A524A985B787423094E40016372D5@mssmsx411.ccr.corp.intel.com> References: <3D8E84095C6A524A985B787423094E40016372D5@mssmsx411.ccr.corp.intel.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Kevan Miller Subject: Re: How to specify JNDI names? Date: Mon, 8 Oct 2007 12:53:21 -0400 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org On Oct 8, 2007, at 10:59 AM, Zakharov, Vasily M wrote: > Hi, all, > > I have an application (SPECjAppServer2004) containing session EJBs > that > need to be accessed from outside. When I run the client, it reports: > > javax.naming.NameNotFoundException: /OrderAuditSes does not exist > in the > system. Check that the app was successfully deployed. > at > org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:237) > at javax.naming.InitialContext.lookup(InitialContext.java:351) > at ... > > What is the expected format of specifying the JNDI names in G2.0.1? > What > may I be doing wrong? > > I've tried different variations, but never succeeded. JNDI Viewer in > Console shows the necessary EJBs in the tree, without any prefix. > > Thank you! > > The client is launched like this: > java -cp ... > - > Djava.naming.factory.initial=org.apache.openejb.client.RemoteInitialCo > n > textFactory -Djava.naming.provider.url=rmi://localhost:4201 Client > > The Client code is like this: > new InitialContext().lookup("OrderAuditSes"); > > The application deployment plan can be found here: > http://cwiki.apache.org/confluence/download/attachments/64828/sjas- > app.x > ml Vasily, The best way that I know how to get the JNDI name is from having it logged during deployment. JNDI name for an EJB will be logged if you turn on INFO logging in 2.0.1. This is configured by default in the soon to be 2.0.2. For 2.0.1 edit your server.log4j.properties file and change your log4j.rootLogger and log4j.appender.FILE.Threshold to the following: log4j.rootLogger=INFO, CONSOLE, FILE log4j.appender.FILE.Threshold=INFO You should see log entries of the following form: 11:47:42,435 INFO [startup] Assembling app: /geronimo-jetty6- jee5-2.0.1/var/temp/geronimo-deploymentUtil32038.jar 11:47:42,796 INFO [startup] Jndi(name=GeneralEJB.jar/My/ejbs.My) 11:47:42,796 INFO [startup] Created Ejb(deployment-id=GeneralEJB.jar/ My, ejb-name=My, container=Default Stateless Container) The JNDI naming scheme is changing in 2.0.2 (the change is a bit unfortunate, but the naming scheme is more straightforward...). By default: {EjbName}{AnnotationType} You can find JNDI naming documentation for 2.0.2 here -- http:// cwiki.apache.org/GMOxDev/client-jndi-names.html Supposedly this doc got moved to a better location, but I don't see it... Perhaps Hernan or David B can point us to it... For 2.0.2 the log will contain entries of the following form: 12:21:04,363 INFO [startup] Assembling app: /Users/kevan/geronimo/ server/branches/2.0.2/target/geronimo-jetty6-jee5-2.0.2-SNAPSHOT/var/ temp/geronimo-deploymentUtil64534.jar 12:21:04,762 INFO [startup] Jndi(name=MyRemoteHome) --> Ejb (deployment-id=GeneralEJB.jar/My) 12:21:04,762 INFO [startup] Created Ejb(deployment-id=GeneralEJB.jar/ My, ejb-name=My, container=Default Stateless Container) 12:21:04,763 INFO [startup] Deployed Application(path=/Users/kevan/ geronimo/server/branches/2.0.2/target/geronimo-jetty6-jee5-2.0.2- SNAPSHOT/var/temp/geronimo-deploymentUtil64534.jar) --kevan