I am a newbie to J2EE.So this must be a basic question to most of you.But here is my example:
I have the following jars in the app directory
app
=>LocalInterfaceEntityEJB.jar
=>StatelessSessionEJB.jar(invokes LocalInterfaceEntityEJB.jar through local interface)
=>utils.jar
Now i package them into a single ear;and refer to utils.jar in the MANIFEST of the other 2 jars-and things work perfect.
But ideally the utility class should not be a part of the ear .As far as i understand,it can be referred to by the other jars through MANIFEST classpath mechanism,even if it is not in the EAR.
But as soon as i remove utils.jar from the ear,i start getting classloading problems related to it.
How do i keep the utils outside of the ear?
-
EJB packaging and classloading (1 messages)
- Posted by: rana nag
- Posted on: August 25 2005 01:05 EDT
Threaded Messages (1)
- Why do you want it outside the .ear file? by Nathan Smith on August 26 2005 13:15 EDT
-
Why do you want it outside the .ear file?[ Go to top ]
- Posted by: Nathan Smith
- Posted on: August 26 2005 13:15 EDT
- in response to rana nag
But ideally the utility class should not be a part of the ear.
"Ideally?" I'm not sure where you heard that, but an enterprise archive is meant to contain all of the components that make up the application that's why you can define different module types (i.e. ejb, java, web) in your application.xml file.But as soon as i remove utils.jar from the ear,i start getting classloading problems related to it.How do i keep the utils outside of the ear?
Once again, you shouldn't be worrying about this, but it depends on your application server. There is a probably a lib directory somewhere that contains server-wide class libraries that you can access from any application code.
But really, if your utils.jar contains classes needed by your EJBs, then it belongs inside the ear.