tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Pierazzini <make...@gmail.com>
Subject Re: weird tomcat5.0.30 behaviour with jar in WEB-INF/classes
Date Wed, 01 Dec 2004 15:08:16 GMT
On Wed, 1 Dec 2004 09:47:12 -0500, Shapira, Yoav <yoav.shapira@mpi.com> wrote:
> 
> Hi,
> 
> >I use URLClassLoader to create class loaders that manage jars in WEB-
> >INF/classes
> >In WEB-INF/classes I have many jars that are incompatible each other
> >(they have different classes with the same name inside).
> 
> I comment on the actual problem below, but if you don't mind me asking:
> why?  This is ugly ;)

yes, I know, but I've to use those jars, and I didn't developed them :(

[cut]
> The one in $CATALINA_HOME/work is an unmodified copy, so it should be
> OK.  But there's a bigger point here (actually two):

it should be but it isn't because tomcat does not make a copy, and the
returned url is unresolvable.

> - You cannot rely on a specific scheme (e.g. file:/) or format of the
> resource URL returned by the classloader, but you can rely on the
> classloader being able to find and resolve it.  Only the latter should
> matter.  If you're relying on the former, change your design.

yes of course, I do not rely on a specific schema (unless
java.net.URLClassLoader does).

> - What's you're doing is tricky at best.  Having multiple copies of te
> same class in the same repository is not a good idea.  If you do
> continue down this path, you should create a custom loader and replace
> Tomcat's default webapp classloader with your own by registering yours
> as the Loader element for your Context.

I use URLClassLoader to create a child of the context classloader, and
I don't need anything more.

bye
Simone

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message