On Apr 7, 2008, at 8:36 AM, CG wrote:
Hi all,
After googling again,  I have solved the problem by changing the
jndi.properties , localhost:4201 to 127.0.0.1:4201.

You can use "localhost" as a host, you just need to add "ejbd:// localhost:4201" due to the way URIs are parsed. In the openejb 3.0 final up for a vote now, we check your provider url string a bit more before giving it to java.net.URI and make corrections.

After solving that , another problem coming up , I still need time to
do more searching.

Happy to help when you get the details.

-David



CG

On Mon, Apr 7, 2008 at 9:29 PM, CG <[EMAIL PROTECTED]> 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.<init>(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.<init>(InitialContext.java:175)
at test .com .quesofttech .FirstEJB3TutorialClient.main(FirstEJB3TutorialClient.java:39)






On Mon, Apr 7, 2008 at 9:19 PM, CG <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED] > 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.<init>(InitialContext.java: 175)
      at
test .com .quesofttech .FirstEJB3TutorialClient.main(FirstEJB3TutorialClient.java:39)
Caused by: java.lang.ClassNotFoundException:
org.openejb.client.RemoteInitialContextFactory



<more codes>
::
              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();
             }

<more codes>








Reply via email to