• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Class Path for EJB.jar of an ear file

 
Ranch Hand
Posts: 42
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I've got an ear file with several ejb.jar files and one war file ... I would like to specify in the class path of the ejbs jar files some jar files contained in the war file is it possible ?
I know how to specify the class-path in manifest file but how can I specify a jar file inside a war in that class path ?
FREd
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ejb jars cannot reference classes that are loaded in a war because of how the classloader works in WebLogic. The common classes between the ejbs and the war must be extracted and placed in somewhere accessable by both.
The quick solution is to put them on WebLogic's CLASSPATH, of course the drawback is the lack of dynamic deployment of these common classes.
The flexible solution is to package the common jar in the ear and refer to it in your ejb jar's manifest. Since the war classloader is a child of the ejb classloader, these will also be available to the war. BTW, this behavior is guaranteed by the specification so it should be fairly vendor neutral as well.
 
Fred Close
Ranch Hand
Posts: 42
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for your answer Chris,
the only problem I have with your solution is that some of the common jars have to be in the war file, because the client of our application is an applet and needs to download some jar file and so those jar files have to be in the war.
So what I did is, as you said, have the common jars directly in the ear and for the common which also have to be downloaded by the client they are also present in the war file. It's working ok but I wanted to know if it's possible to do the packaging without duplicating jar files between the ear and the war.
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
As Chris stated earlier the solution to your problem is to put the common files in the Weblogic Server classpath. This would solve your problem.
Howeever you will not be able to make changes to these files unless the server is shut down and restarted.
 
Fred Close
Ranch Hand
Posts: 42
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I've placed the common jar files directly in the ear but some jar files needs also to be in the ware file because an applet needs to download them ... so I'm forced to duplicate those jar files in my ear.
 
a wee bit from the empire
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic