[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: Overriding universal classloader, JBoss 4.2.1GA

jaikiran do-not-reply at jboss.com
Tue Oct 9 10:02:42 EDT 2007


Worked for me. This is what i tried (as a sample try):

- JBoss 4.2.1 ships with Hibernate-3.2.4SP1 and Quartz-1.5.2 (these jars are present in the server/< serverName>/lib folder of JBoss).

- I created a simple web-application, with just one JSP which was meant to print out the Hibernate and Quartz versions. In the lib folder of my web-application, i placed Hibernate-3.1.2 and Quartz-1.4.5 version jars. Also, i placed a jboss-web.xml in the WEB-INF folder of my application, with the following contents:

  | <jboss-web>
  |    <context-root>/</context-root>
  |    <class-loading java2ClassLoadingCompliance="false">
  |     <loader-repository>
  |     	org.myapp:loader=hibernatetestclassloader
  |     <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
  |     </loader-repository>
  |  </class-loading>
  | </jboss-web>

- The jsp contents are simple:

<%@ page import="
  | java.util.*,
  | javax.naming.*,
  | javax.sql.*,
  | java.sql.*,
  | org.hibernate.cfg.*,
  | org.quartz.helpers.*"
  | 
  | 
  | %>
  | 
  | 
  | <html>
  | <body>
  | <%
  | 	try {
  | 			
  | 			
  | 			System.out.println("Hibernate version: " + Environment.VERSION);
  | 			String args[] = new String[] {"abc","xyz"};
  | 			System.out.println("Quartz version: ");
  | 			VersionPrinter.main(args);
  | 			} catch(Exception e) {
  | 		e.printStackTrace();
  | 	}
  | 
  | %>
  | </body>
  | </html>
  | 

- Started JBoss and accessed the jsp. Here's the output:

anonymous wrote : 2007-10-09 19:22:52,833 INFO  [STDOUT] Hibernate version: 3.1.2
  | 2007-10-09 19:22:52,833 INFO  [STDOUT] Quartz version: 
  | 2007-10-09 19:22:52,833 INFO  [STDOUT] Quartz version: 1.4.5
  | 

This shows that the libraries of my application(and not the ones shipped by JBoss) are being used.

P.S: Hibernate and Quartz libraries were considered as an example for simplicity.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093040#4093040

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093040



More information about the jboss-user mailing list