You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Anton Arhipov <an...@gmail.com> on 2012/07/11 17:55:48 UTC

TomEE classloader configuration

Hello!

I'd like to know if it is possible to configure TomEE classloader to load
application classes first.
I.e. if in my application there's lib-1.jar and TomEE bundles lib-2.jar
with the same classes, I'd like to load lib-1.jar which is in WEB-INF/lib
of my application.


Thanks,
-- 
Anton Arhipov
http://arhipov.blogspot.com

Re: TomEE classloader configuration

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Note: if you start with the webapp already unpacked you can "hack" the
container pointing to WEB-INF/lib jars in conf/catalina.properties
common.loader property...a bit dirty but should work

- Romain


2012/7/11 Jean-Louis MONTEIRO <je...@gmail.com>

> IMO, that's the default tomcat behavior and what the spec requires.
> Isn't it?
>
> ie. in webapp, you have parent last whereas in a common classloader in
> Java, you have parent first
>
> Jean-Louis
>
> 2012/7/11 Anton Arhipov <an...@gmail.com>
>
> > Hello!
> >
> > I'd like to know if it is possible to configure TomEE classloader to load
> > application classes first.
> > I.e. if in my application there's lib-1.jar and TomEE bundles lib-2.jar
> > with the same classes, I'd like to load lib-1.jar which is in WEB-INF/lib
> > of my application.
> >
> >
> > Thanks,
> > --
> > Anton Arhipov
> > http://arhipov.blogspot.com
> >
>

Re: TomEE classloader configuration

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
IMO, that's the default tomcat behavior and what the spec requires.
Isn't it?

ie. in webapp, you have parent last whereas in a common classloader in
Java, you have parent first

Jean-Louis

2012/7/11 Anton Arhipov <an...@gmail.com>

> Hello!
>
> I'd like to know if it is possible to configure TomEE classloader to load
> application classes first.
> I.e. if in my application there's lib-1.jar and TomEE bundles lib-2.jar
> with the same classes, I'd like to load lib-1.jar which is in WEB-INF/lib
> of my application.
>
>
> Thanks,
> --
> Anton Arhipov
> http://arhipov.blogspot.com
>

Re: TomEE classloader configuration

Posted by Romain Manni-Bucau <rm...@gmail.com>.
webapp classes are loaded first by default...BUT if lib2 is used before
lib1 is available (typically at container startup) it is not possible

what do you want to override?

- Romain


2012/7/11 Anton Arhipov <an...@gmail.com>

> Hello!
>
> I'd like to know if it is possible to configure TomEE classloader to load
> application classes first.
> I.e. if in my application there's lib-1.jar and TomEE bundles lib-2.jar
> with the same classes, I'd like to load lib-1.jar which is in WEB-INF/lib
> of my application.
>
>
> Thanks,
> --
> Anton Arhipov
> http://arhipov.blogspot.com
>