Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 16590 invoked from network); 7 Apr 2008 15:36:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Apr 2008 15:36:57 -0000 Received: (qmail 27046 invoked by uid 500); 7 Apr 2008 15:36:55 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 27013 invoked by uid 500); 7 Apr 2008 15:36:55 -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 27002 invoked by uid 99); 7 Apr 2008 15:36:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2008 08:36:55 -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 learn.koa@gmail.com designates 209.85.146.177 as permitted sender) Received: from [209.85.146.177] (HELO wa-out-1112.google.com) (209.85.146.177) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Apr 2008 15:36:13 +0000 Received: by wa-out-1112.google.com with SMTP id j4so1386057wah.1 for ; Mon, 07 Apr 2008 08:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=d3KKHHl6bCImvcpVkREEg3xpWslmKKj8Yhk+stLKqdQ=; b=bynVaNCNDL4NkbOEtYlbEm/rBeO36L7ER9b7Y2vF0D+cKZNN6Ptua0l99CdEbBDxtMzgMsUSHGC2g0r/sANoeHdr2+lds2AVq8KzMmHDXPUhCH9J5z+ZRlBQLJ8OnGtT2fJ8vHCMl00dkOX4iS8SbYZa0qTL5iiizku/L7ZM43w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=T0180k4BCK6xKcTbKEwW6ALb3Z0hlyRWwlbbawaQ69XidL/kYBBDN2nBmI+zWSSPvAqnCfIqGxpAfOgwWF8Ibf/2Z2NCP5orPZoDmkbELlfSmugNFWD1Z3eA8dr2bQ/4ZXmlJzNun+dpf5ZJotmFIrd/7UEGOUQimImRa8GNvTI= Received: by 10.114.175.16 with SMTP id x16mr6113779wae.116.1207582585206; Mon, 07 Apr 2008 08:36:25 -0700 (PDT) Received: by 10.114.127.19 with HTTP; Mon, 7 Apr 2008 08:36:25 -0700 (PDT) Message-ID: Date: Mon, 7 Apr 2008 23:36:25 +0800 From: CG To: user@geronimo.apache.org Subject: Re: problem JNDI lookup in geronimo In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org Hi all, After googling again, I have solved the problem by changing the jndi.properties , localhost:4201 to 127.0.0.1:4201. After solving that , another problem coming up , I still need time to do more searching. CG On Mon, Apr 7, 2008 at 9:29 PM, CG wrote: > Forget to attach the error message in the previous mail, here it is. > > Error > ==== > javax.naming.AuthenticationException: Cannot connect to server > 'localhost:4201"; nested exception is: > java.io.IOException: Cannot connect to server: 'localhost:4201' due > to an unkown exception in the OpenEJB client: > java.lang.IllegalArgumentException : port out of range:-1 > at org.apache.openejb.client.JNDIContext.authenticate(JNDIContext.java:150) > at org.apache.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:131) > at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667) > > at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) > at javax.naming.InitialContext.init(InitialContext.java:223) > at javax.naming.InitialContext.(InitialContext.java:175) > at test.com.quesofttech.FirstEJB3TutorialClient.main(FirstEJB3TutorialClient.java:39) > Exception in thread "main" java.lang.RuntimeException: > javax.naming.AuthenticationException: Cannot connect to server > 'localhost:4201"; nested exception is: > java.io.IOException: Cannot connect to server: 'localhost:4201' due > to an unkown exception in the OpenEJB client: > java.lang.IllegalArgumentException : port out of range:-1 > at test.com.quesofttech.FirstEJB3TutorialClient.main(FirstEJB3TutorialClient.java:50) > Caused by: javax.naming.AuthenticationException: Cannot connect to > server 'localhost:4201"; nested exception is: > java.io.IOException: Cannot connect to server: 'localhost:4201' due > to an unkown exception in the OpenEJB client: > java.lang.IllegalArgumentException : port out of range:-1 > at org.apache.openejb.client.JNDIContext.authenticate(JNDIContext.java:150) > at org.apache.openejb.client.JNDIContext.getInitialContext(JNDIContext.java:131) > at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667) > > at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) > at javax.naming.InitialContext.init(InitialContext.java:223) > at javax.naming.InitialContext.(InitialContext.java:175) > at test.com.quesofttech.FirstEJB3TutorialClient.main(FirstEJB3TutorialClient.java:39) > > > > > > > On Mon, Apr 7, 2008 at 9:19 PM, CG wrote: > > Hi all, > > I have managed to add the appropriate library but encounter another problem. > > > > It seems like port 4201 does not have the JNDI provider service running. > > > > May I know whether geronimo built-in with JNDI provider service or not? > > I noticed that there is LDAP service (which can be a JNDI provider > > service to my understanding)running at port 1389 , and I tried to > > change the jndi.properties to connect to port 1389 instead , however, > > no luck , error still persist. > > > > any idea ? > > > > Thanks in advanced. > > > > CG > > > > > > > > > > On Mon, Apr 7, 2008 at 7:56 PM, CG wrote: > > > thanks david. > > > > > > I just wonder how do I add those libraries in the classpath in eclipse > > > ? Is it going to Build path > add external jar ? > > > > > > Isn't the GEP have added those thing automatically ? > > > > > > thanks for your patient to guide a newbie of Java & eclipse. > > > > > > > > > > > > > > > On Sun, Apr 6, 2008 at 11:21 PM, David Jencks wrote: > > > > The library you need in your client classpath is at > > > > > > > > repository/org/apache/openejb/openejb-client/*/openejb-client-*.jar > > > > > > > > thanks > > > > david jencks > > > > > > > > > > > > > > > > On Apr 6, 2008, at 7:53 AM, CG wrote: > > > > > > > > > > > > > Hi, I am facing problem in using JNDI to do lookup. I have tried to > > > > > solve several problem using google before hitting this > > > > > > > > > > I have materialType.properties and jndi.properties file deployed in > > > > geronimo > > > > > > > > > > materialType.properties > > > > > ================ > > > > > jndi.process.ejb = java:comp/env/ejb/MaterialTestBean > > > > > > > > > > jndi.properties > > > > > ============ > > > > > java.naming.factory.initial=org.openejb.client.RemoteInitialContextFactory > > > > > java.naming.provider.url=localhost:4201 > > > > > java.naming.security.principal=system > > > > > java.naming.security.credentials=manager > > > > > > > > > > > > > > > The problem I face seems like not able to find the class > > > > > org.openejb.client.RemoteInitialContextFactory . > > > > > I think the reason should be openejb library missing or invalid but I > > > > > can't figure out where the openejb library in geronimo .. > > > > > Any help is appreciated , thanks. > > > > > > > > > > > > > > > > > > > > Error msg > > > > > ========= > > > > > > > > > > javax.naming.NoInitialContextException: Cannot instantiate class: > > > > > org.openejb.client.RemoteInitialContextFactory [Root exception is > > > > > java.lang.ClassNotFoundException: > > > > > org.openejb.client.RemoteInitialContextFactory] > > > > > at > > > > javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:657) > > > > > at > > > > javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) > > > > > at javax.naming.InitialContext.init(InitialContext.java:223) > > > > > at javax.naming.InitialContext.(InitialContext.java:175) > > > > > at > > > > test.com.quesofttech.FirstEJB3TutorialClient.main(FirstEJB3TutorialClient.java:39) > > > > > Caused by: java.lang.ClassNotFoundException: > > > > > org.openejb.client.RemoteInitialContextFactory > > > > > > > > > > > > > > > > > > > > > > > > > :: > > > > > InitialContext context; > > > > > MaterialTestBeanRemote beanRemote = null; > > > > > ResourceBundle bundle = null; > > > > > > > > > > bundle = ResourceBundle.getBundle("materialType", > > > > > Locale.getDefault(), FirstEJB3TutorialClient.class.getClassLoader()); > > > > > String jndiName = bundle.getString("jndi.process.ejb"); > > > > > try > > > > > { > > > > > context = new InitialContext(); > > > > > beanRemote = (MaterialTestBeanRemote) > > > > > context.lookup(MaterialTestBean.RemoteJNDIName); > > > > > beanRemote.testMaterial(); > > > > > beanRemote.testMaterialType(); > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > >