(Sorry long post but I�m trying to solve this problem for more than a week now).pls help. Hi, Im running the examples of Enterprise Java Beans from Monson-Haefel book in WebLogic 6.0 and I?m havin the error: java.rmi.RemoteException: EJB Exception: ; nested exception is: java.lang.NoClassDefFoundError: com.titan.cabin.CabinHome java.lang.NoClassDefFoundError: com.titan.cabin.CabinHome I was debuggin it and I discovered tha the error occurs right after I get a remote reference to the bean with Object ref = ctx.lookup("java:comp/env/ejb/Cabin"); I got the reference but then when I try to do: CabinHome home = (CabinHome)(javax.rmi.PortableRemoteObject.narrow(ref, CabinHome.class)); the error occurs.
Here goes a fragment of code showing the reference I recovered: Object ref = ctx.lookup("java:comp/env/ejb/Cabin"); // this next line prints: com.titan.cabin.CabinEJBHomeImpl_WLStub System.out.println(ref.getClass().toString()); here goes a fragment of my ejb-jar.xml: <session> <description>stateless ejb que manuseia Cabin ejb</description> <ejb-name>TravelAgent</ejb-name> <home>com.titan.travelagent.TravelAgentHome</home> <remote>com.titan.travelagent.TravelAgent</remote> <ejb-class>com.titan.travelagent.TravelAgentEJB</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> <ejb-ref> <ejb-ref-name>ejb/Cabin</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>com.titan.cabin.CabinHome</home> <remote>com.titan.cabin.Cabin</remote> </ejb-ref> </session>
and a fragment of weblogic-ejb-jar.xml: <ejb-reference-description> <ejb-ref-name>ejb/Cabin</ejb-ref-name> <jndi-name>Cabin</jndi-name> </ejb-reference-description>
Any help will be wellcome. txs in advance. PS - If I set the classpath to C:\bea\wlserver6.0\config\mydomain\applications\Cabin.jar it works but I�m sure thats not the wright thing to do.
[This message has been edited by Marcos Maia (edited July 17, 2001).]
You're on the right track - your problem was definitely lack of CLASSPATH access to the Home Interface, so giving your client an explicit path helped. One thing about WLS 6 that I'm not sure of however, is that in certain cases it's supposed to be able to download classes from the server. You might want to ask in the BEA EJB forum about that. Still, at a minimum, you'd need the definitions to compile, and the WLS stubs to run the client, so might as well include the whole jar anyway.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.
Tanks for the reply Tim. Wath is driving me mad is that the problem occurs when I try to reference the Cabin EJB from the TravelAgent EJB and not from the client. The client accesses the TravelAgent EJB wich then accesses the Cabin entity EJB and there is where the home interface of the Cabin EJB is not found, I�m really confused about it.
A wop bop a lu bop a womp bam boom! Tiny ad:
SKIP - a book about connecting industrious people with elderly land owners