Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB and third-party libraries  RSS feed

 
rafa rech
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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?
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!