aspose file tools*
The moose likes JBoss/WildFly and the fly likes classpath / external jars Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "classpath / external jars" Watch "classpath / external jars" New topic
Author

classpath / external jars

Christophe Grosjean
Ranch Hand

Joined: Jan 22, 2002
Posts: 51
Hi,
I am using JBoss 3.0.4. I have the following questions about jars and classpath.
* the "server/default/lib" directory should contains Mbeans JAR that are automatically deployed at start time. Is it correct?
* Where can I put the external JAR files that I use (castor, JDBC driver and so on) ? I read that I can put those in the lib/ext directory but it does'nt seem to work?
* Where can I specify the classpath order between the JAR file ? Is is in the bin/run.bat ? Or in an XML file like the jboss-service.xml or user-service.xml ?
* Can I add a build directory in the classpath directly without building my classes in a JAR file ?
Thank you for any help (I'm a bit lost :-)
Christophe
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
Originally posted by Christophe Grosjean:

* the "server/default/lib" directory should contains Mbeans JAR that are automatically deployed at start time. Is it correct?
* Where can I put the external JAR files that I use (castor, JDBC driver and so on) ? I read that I can put those in the lib/ext directory but it does'nt seem to work?
* Where can I specify the classpath order between the JAR file ? Is is in the bin/run.bat ? Or in an XML file like the jboss-service.xml or user-service.xml ?
* Can I add a build directory in the classpath directly without building my classes in a JAR file

No, your MBeans go in server/default/deploy.
I prefer to put the the jdbc drivers in the lib directory, but you could put them in deploy.
You don't need to specify the classpath order of jars. If you do, you are doing something wrong. (IMHO)
I don't know what you mean by "build directory". You can deploy an ear/war/sar a s a directory containing the same structure as the equivalent file and jboss will read it fine. You can also tell jboss to deploy from places other than the deploy directory....
Christophe Grosjean
Ranch Hand

Joined: Jan 22, 2002
Posts: 51
Hi,
Thanks for your answers
Well in some particular cases, it is useful to specify order :
Let's assume that an external jar is provided with an implementation of xerces embedded ( version 1.3 for instance ) but I want to use the version 2.5. Without specifying classpath order, I have no way to force JBoss to use the second one : it will depend on JBoss way of ordering jar deployment!
(yes, I could also remove the embedded version from the external jar...).
Concerning the build directory, let's assume that my IDE build my classes into c:\myproject\classes. Actually, I have a Ant script that copy my changed classes from c:\myproject\classes to the jboss\deploy. I'd like JBoss to automatically use them from c:\myproject\classes. How is it possible ?
Thx
Christophe
Miki Muzsi
Ranch Hand

Joined: Jun 23, 2003
Posts: 120
norman,
I prefer to put the the jdbc drivers in the lib directory, but you could put them in deploy

which "lib" directory?
Where should all third party jars be placed, in order to be visible just for a specific application (so something ecquivalent to what in tomcat is: C:\Tomcat41\webapps\<my web application>\WEB-INF\lib) and to try to avoid jar clashes?
Miki


Miki<br /> <br />SCJP 1.4, SCBCD 1.3
norman richards
Author
Ranch Hand

Joined: Jul 21, 2003
Posts: 367
Originally posted by Miki Muzsi:
which "lib" directory?

server/default/lib
On the other problem, for a web app you should be able to put your jar files inside the war file and expect them to be separate from other apps. For the rest of your jars, this is a HUGE problem with JBoss. I've ranted about it many times:
http://members.capmac.org/~orb/blog.cgi/tech/java/jboss_ucl.html
http://members.capmac.org/~orb/blog.cgi/tech/java/jboss_ucl2.html
http://members.capmac.org/~orb/blog.cgi/tech/java/jboss_ucl3.html
The end result is that for everything else you need to isolate your applications using the loader-repository settings in jboss-app.xml. Yes, it's a pain, but that's the only choice until the JBoss guys realize how much pain the dumb UCL inflicts on us poor developers...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: classpath / external jars
 
Similar Threads
Weblogic doesnot support WEB-INF/lib ?
Adding jars in Web/Enterprice application
while deploying Spring-Hibernate-Sip Enterprise Application getting NoClassDefFoundError
Ant NoClassDefFoundError
JDBC Drive Issue