Hello, A bunch of different replies were in this thread, so let me follow up on them all together in this one email.
1) My application.xml contains: <module> <web> <web-uri>wgen.war</web-uri> <context-root>/wgen</context-root> </web> </module> <module> <ejb>wgen.jar</ejb> </module> This wgen.jar is included in a) EAR and b) WAR (which is in EAR) 2) the EAR file looks like this: 0 Thu Jan 23 18:22:28 EST 2003 META-INF/ 53 Thu Jan 23 18:22:28 EST 2003 META-INF/MANIFEST.MF 1684386 Thu Jan 23 18:22:18 EST 2003 wgen.jar 9901252 Thu Jan 23 18:22:28 EST 2003 wgen.war 576 Thu Jan 23 17:19:48 EST 2003 META-INF/application.xml The wgen.war file also contains wgen.jar (the same one). Stupid, no? I assume I should eliminate the JAR from the WAR, no? 3) wgen.jar contains ALL of my classes (EJBs, Servlets, business logic classes - all .class files are in this JAR). 4) wgen.war contains this JAR (wgen.jar) + web.xml, JSPs, images, etc. 5) I do have MANIFEST.MF in META-INF in the top level of wgen-web.ear, as shown above. I also tried setting Class-Path in there. I used the full path to the wgen.jar which I placed in the <jboss>/server/<config>/lib directory. That did not work because JBoss first loaded my EJBs from that wgen.jar, and then it tried deploying my EAR which contained the same wgen.jar with the same EJBs - so JBoss complained that the EJBs were already loaded - makes sense. So what should I do? It seems to me that I should: 1) Split my JAR into 2 JARs: a) a JAR with EJBs (e.g. wgen-ejb.jar) b) a JAR with all other Java classes (e.g. wgen-lib.jar) 2) Include only the JAR with EJBs in root of EAR 3) Ensure that application.xml in EAR refers to the JAR with EJBs, e.g.: <module> <ejb>wgen-ejb.jar</ejb> </module> 4) Put the JAR with other classes in server/<config>/lib/ 5) Remove any JARs from the WAR. Am I missing something? Should I still add Class-Path info to EAR's MANIFEST.MF? May I use the full path? If my JBoss is in /usr/local/jboss and my JAR is in /usr/local/jboss/server/default/lib directory, what should Class-Path be set to? Thank you, Otis ---- On Wed, 22 Jan 2003, Rod Macpherson ([EMAIL PROTECTED]) wrote: > In general you cannot put a jar in an ear and get those classes loaded. The > application.xml file is responsible for dictating what gets loaded. If you > add a <java> element to application.xml for that jar file it might work but > that really should be used for proper applications versus libraries. Putting > the jar in deploy is not reliable because you have a chicken-egg problem. > Putting it in your [jboss]/server/[config]/lib directory will definitely > work as will the base lib directory. If that fails check your > [jboss]/server/[config]/tmp directory because it is probably still sitting > there. I could swear that if you move from deploy to lib it does not always > undeploy but then that's not something you will do very often. That will > definitely work but a SAR might be more appropriate than ...[config]/lib. > > ----- Original Message ----- > From: "otisg" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, January 22, 2003 2:51 PM > Subject: [JBoss-user] JB 3.0.4, loading classes from JAR in EAR > > > > Hello, > > > > I am trying to use JBoss 3.0.4 and have a > > small problem. > > My EAR contains a WAR and a JAR. I am > > deploying this EAR to server/default/deploy. > > > > In my application I try to load a class from > > the JAR by doing Class.forName(<class name > > here>). > > > > This works fine under JBoss 2.4.4, but > > doesn't seem to work under JBoss 3.0.4. > > > > I suspect that it's something to do with the > > new Classloader in JBoss3. > > I have checked the FAQ and this entry looked > > promising: > > http://jboss.org/faq.jsp#FAQ-BEANDEV-NORMALJARS > > However, that didn't seem to solve the problem. > > > > I tried sticking the JAR in <jboss root>/lib > > and server/default/lib/ but nether of those > > two worked, and the latter actually gave > > additional errors at boot time > > (javax.management.InstanceAlreadyExistsException: > > jboss.j2ee:jndiName=wgen/CommandShell,service=EJB > > already registered.) > > > > The error actually may be a good sign, > > signaling that JBoss did pick up the JAR, > > but that I need to repackage things....maybe? > > > > > > Any help would be very appreciated. > > Thanks, > > Otis > > > > > > > > ________________________________________________ > > Get your own "800" number > > Voicemail, fax, email, and a lot more > > http://www.ureach.com/reg/tag > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Scholarships for Techies! > > Can't afford IT training? All 2003 ictp students receive scholarships. > > Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. > > www.ictp.com/training/sourceforge.asp > > _______________________________________________ > > JBoss-user mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/jboss-user > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Scholarships for Techies! > Can't afford IT training? All 2003 ictp students receive scholarships. > Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. > www.ictp.com/training/sourceforge.asp > _______________________________________________ > JBoss-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/jboss-user > > ________________________________________________ Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user