geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevan Miller <kevan.mil...@gmail.com>
Subject shared lib classloader XStream Jettison issue
Date Fri, 08 Jul 2011 00:22:37 GMT
The following was posted to the Geronimo forum on Nabble, but, AFAICT, never made it to a mailing
list or moderation. Reposting, now...

See http://apache-geronimo.328035.n3.nabble.com/shared-lib-classloader-XStream-Jettison-issue-tt3144897.html


> 
> Hi, 
>    I am using Geronimo Little G 2.2.1 and  have a  deployment plan which utilizes the
shared lib and it seems to work for the most part. But when my app (a web application) tries
to use XStream for serializing JSON (xstream uses Jettison Internally) I get ClassNotFoundException.
Please note that all the jars the application uses are from the shared library and it has
a copy of XStream and Jettison. 
> 
> I can see that the XStream is getting loaded from $GERONIMO_HOME/lib/xstream.jar and
is loaded by the system classloader.  In my application deployment plan I have given "hidden-classes"
to exclude XStream and Jettion but its not getting picked up from the shared lib.  The only
way I can get the app to work is if I put the Jettison.jar into the JVMs ext directory, it
does not work even if I put the jettion.jar into $GERONIMO_HOME/lib where it is loading xstream.jar.

> 
> I am suspecting that since my application uses shared lib , shared lib's classloader
gets to load everything first and the policy there probably is to load everything from its
parent and is why my application plan's "hidden-classes" is not working. I tried placing the
jar in all spots where one would expect the classes to be picked up (WEB-INF/libs, repository/org/.../jettison.jar,
$GERONIMO/lib/endorsed).   
> 
> Is there a way I can specify the "hidden-classes" for the shared lib module? Or am I
doing something totally wrong?

Mime
View raw message