dcsimg
java.lang.NoClassDefFoundError calling entity bean from session bean
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anil_Sequeira
Posted On:   Monday, August 19, 2002 12:24 AM

Hello, I am trying to call a entity bean named product from a stateless session bean Customer using the JNDI ENC naming context.At runtime I get the error java.lang.NoClassDefFoundError as it cannot find the class ProductHome as it resides in a different package from the customer Bean. Snippet of my code of the CustomerBean where error is occuring is as follows... Context ctx = new InitialContext() ; Object obj = ctx.lookup("java:comp/env/ejb/product.ProductHome") ;//works fine ProductHome home = (ProductHome)PortableRemoteObject.narrow(obj,ProductHome.class) ;//error How do get the Customer bean locate this ProductHome class file?Do I need to explicitly specify in some build or deployment XML file   More>>

Hello,
I am trying to call a entity bean named product from a stateless session bean Customer using the JNDI ENC naming context.At runtime I get the error java.lang.NoClassDefFoundError as it cannot find the class ProductHome as it resides in a different package from the customer Bean.
Snippet of my code of the CustomerBean where error is occuring is as follows...

Context ctx = new InitialContext() ;
Object obj = ctx.lookup("java:comp/env/ejb/product.ProductHome") ;//works fine
ProductHome home = (ProductHome)PortableRemoteObject.narrow(obj,ProductHome.class) ;//error

How do get the Customer bean locate this ProductHome class file?Do I need to explicitly specify in some build or deployment XML file(s)?I am using Weblogic6.0.


Thanks
Anil Sequeira

   <<Less

Re: java.lang.NoClassDefFoundError calling entity bean from session bean

Posted By:   Lasse_Koskela  
Posted On:   Monday, August 19, 2002 02:47 AM

I think the preferred way of doing this is by a Class-Path reference in the Session Bean's Manifest file.


The Class-Path entry is something like


Class-Path: ProductEJBClient.jar, SomeOtherClient.jar

where these .jar files contain the "client" classes for the EJBs (in other words, remote/home interfaces and the classes used as method parameters/return values).


I don't know much about this subject, but I remember reading this at some web forum (JGuru, theserverside, javaranch,...)

About | Sitemap | Contact