How can I dynamically find classes within an EJB?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Kelly_Dolan
Posted On:   Tuesday, April 17, 2001 02:29 PM

I have an EJB that has a method that accepts a Serialized object. Within the method, the object needs to be de-Serialized. Since this object can be of any number of classes, the class definitions are not a part of the EJB deployment (i.e. they are not in the EJB ear file). Obviously, when the EJB tries to de-Serialize the object, a ClassDefinitionNotFound exception is thrown. I know that one option is to install all of the classes in some location (outside the J2EE container/environment) and set CLASSPATH to look there. However, I was wondering if there were other options (also outside of including the classes in the EJB ear file). For instance, is there a setting specifically for a J2EE environment that locates classes (like CLASSPATH   More>>

I have an EJB that has a method that accepts a Serialized object. Within the method, the object needs to be de-Serialized. Since this object can be of any number of classes, the class definitions are not a part of the EJB deployment (i.e. they are not in the EJB ear file). Obviously, when the EJB tries to de-Serialize the object, a ClassDefinitionNotFound exception is thrown.

I know that one option is to install all of the classes in some location (outside the J2EE container/environment) and set CLASSPATH to look there. However, I was wondering if there were other options (also outside of including the classes in the EJB ear file).

For instance, is there a setting specifically for a J2EE environment that locates classes (like CLASSPATH but only in scope within the J2EE server) not in an ear file? Or, is there a way for an EJB file to use RMI to dynamically load the classes? I'm basically looking for a way to load a class at runtime. I do not want to have to stop the J2EE server if I can avoid it.

Thanks!

- Kelly Dolan

   <<Less

Re: How can I dynamically find classes within an EJB?

Posted By:   sashi_reddy  
Posted On:   Monday, April 23, 2001 10:13 PM

Kelly, were you able to deploy this bean in the first place? Did it not
complain while you were deploying that the class you are
constructing from the deserialization s not found?

Thanks,
Sashi
About | Sitemap | Contact