geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgunz <slo...@twcny.rr.com>
Subject Re: Library conflict
Date Wed, 18 Apr 2007 16:39:41 GMT

It's been a little while but I figured I should probably post the solution I
ended up going with. I decided to make use of the Javaassist Loader
classloader (http://www.csg.is.titech.ac.jp/~chiba/javassist/). I manually
constructed a new Loader and added all of my desired Jars to it, and added
the Geronimo classloader as the parent.

The Loader classloader inverts the classloader hierarchy and checks the
Loader instance first before chaining to the parent. It also lets you
specify specific packages or classes that should always be delegated to the
parent. So I delegated the libraries I actually wanted to share with
Geronimo (ActiveMQ, Logging).

This solution seemed to work pretty well. The only other thing I wanted to
solve and haven't yet was to be able to use a Jar with embedded Jars in the
same way I can a War file. Due to the shortcomings of URLCLassLoader and
it's inability to load classes from embedded/nested Jars -- this ended up
getting hairier than I wanted. So... I left my app as a War even though it
is not a web-app. Unfortunately this changes the way the Geronimo JMX
console treats it though so I cannot access extra GBean operations.

-- 
View this message in context: http://www.nabble.com/Library-conflict-tf3512229s134.html#a10062105
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message