-
1. Re: javax.naming.NameNotFoundException
oli May 8, 2003 1:05 AM (in response to cleconte)Hi cleconte,
I think you have in the JBoss.xml this line: <ejb-name>TestSession</ejb-name>
and you have to in your client this lookup: ctx.lookup("TestSession");
You can check it with your browser: http://localhost:8080/jmx-console/
jboss --> service=JNDIView --> java.lang.String list()
this is the last option of this site: press the invoke -Button
You have to see
EjB Module: .jar
java:comp namespace of the <Namefrom JBoss.xml <ejb-name>TestSession</ejb-name> > bean:
You have to for your client lookup: ctx.lookup(" <Namefrom JBoss.xml <ejb-name>TestSession</ejb-name>");
I had the same problem Have a look to my posting.
You can copy and past the source code from the posting:
NameNotFoundException JNDI Problem Oli May 8, 2003 12:39 AM
Juha and warjort had help me to solve the problem.
Cue,
Oli -
2. Re: javax.naming.NameNotFoundException
cleconte May 9, 2003 1:53 AM (in response to cleconte)Hi Oli,
I apply the correction in my program but now I have a new exception on lookup method.
Have you an idea for helping me ?
java.lang.NoClassDefFoundError: Lorg/jboss/tm/TransactionPropagationContextFactory;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:1480)
at java.lang.Class.getField0(Class.java:1713)
at java.lang.Class.getDeclaredField(Class.java:1176)
at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1404)
at java.io.ObjectStreamClass.access$400(ObjectStreamClass.java:45)
at java.io.ObjectStreamClass$3.run(ObjectStreamClass.java:331)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.(ObjectStreamClass.java:329)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:249)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:444)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1511)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1616)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at java.util.HashMap.readObject(HashMap.java:974)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:809)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1733)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1830)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1756)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:112)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1676)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1634)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1830)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1756)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:514)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.testing.client.TestClient.getHome(TestClient.java:32)
at com.testing.client.TestClient.testBean(TestClient.java:51)
at com.testing.client.TestClient.main(TestClient.java:68) -
3. Re: javax.naming.NameNotFoundException
cleconte May 9, 2003 6:35 AM (in response to cleconte)Now it's ok.
I have found my error. I have forgotten one .jar in my classpath.
I am very happy because it's my first EJB.
Thank you very for your help.