• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB and third-party libraries

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I created a programming framework (fwk.jar). Now I created an application using this framework which contains some EJBs. These EJBs use some classes from my framework. And I have also a web application that uses Struts.
So I created the ear file with the following structure:
- AppEJB.jar with my EJBs
- App.jar with my application classes
- META-INF/application.xml
- META-INF/META-INF.MF
- WebApp.war (with the struts.jar, fwk.jar and app.jar in the lib directory and the other configuration files)
If I try to deploy it, the app server complains about the AppEJB.jar saying that it cannot compile the EJBs because they use classes (from fwk.jar) that are not found.
How can I tell the app server that the AppEJB.jar should use the fwk.jar that is in the WEB-INF dir?
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The joy of J2EE packaging and deployment! See this post for more discussion on these types of problems.
 
rafa rech
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Excellent articles. Unfortunately, they didn�t solve my problem. Maybe, I was not able to process the information correctly. Anyway, the problem is still there.
See:
App.ear
|- AppEJB.jar
| |- EJBs
| |- /manifest/manifest.mf with Class-Path
| pointing to fwk.jar in WEB-INF dir
|- AppWeb.war
| |- index.jsp
| |- /WEB-INF
| |- /classes/ApplicationResources.properties
| |- /lib/fwk.jar
| |- /lib/struts.jar
If I don�t put the Class-Path information in the
manifest file, I�m not able to deploy the AppEJB.jar (ClassNotFound exception).
Now that I got everything deployed I�m having another issue.
If in my JSP I try to use ClassA from fwk.jar that inherits from ClassStrs from struts.jar, I get a "java.lang.NoClassDefFoundError: org/apache/.../ClassStrs"
I think it has something to do with different contexts.
If I put both fwk.jar and struts.jar in the root of the EAR file. I can compile and deploy the EJBs, I don�t get the NoClassDefFoundError, but I can�t use the struts� resource bundle. Even if I put just the fwk.jar in the root of the
EAR file (pointing to struts.jar inside the WEB-INF/lib) I have this same problem.
Could somebody help me.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic