You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by skrajath <sk...@gmail.com> on 2015/09/14 07:37:26 UTC

Custom Shared jars in TomEE

Trying to have unique jars for each application, so using

"org.apache.catalina.loader.VirtualWebappLoader
configuration in context.xml. The application is an EAR, deployed in 'apps'
folder under TomEE install directory. context.xml is in

/apps/myApp/META-INF/

but the jars are not visible to app. Question is,

1) is this the right location? or should it be in META-INF of the webApp
inside ear - /apps/myApp/webApp/META-INF

2) VirtualWebappLoader is only for webApps and for EAR under apps?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Custom-Shared-jars-in-TomEE-tp4676193.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Custom Shared jars in TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Are you using a symbolic link? If not please provide us a github project we
can work on to reproduce.
Le 16 sept. 2015 03:13, "skrajath" <sk...@gmail.com> a écrit :

> Thats good to know.
>
> I tried adding jars.txt (conent is just one line <lib-absolutepath>/*.jar )
> in WEB-INF dir. But no jars are read and class not found error thrown
>
> SEVERE: Unable to load tag library tag class:
> java.lang.NoClassDefFoundError: org.apache.log4j.Logger
>
>
> But for sure log4j.jar available in the path given in jars.txt and the lib
> dir has proper permissions.
>
> m I missing something here?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Custom-Shared-jars-in-TomEE-tp4676193p4676238.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Custom Shared jars in TomEE

Posted by skrajath <sk...@gmail.com>.
Thats good to know.

I tried adding jars.txt (conent is just one line <lib-absolutepath>/*.jar )
in WEB-INF dir. But no jars are read and class not found error thrown

SEVERE: Unable to load tag library tag class:
java.lang.NoClassDefFoundError: org.apache.log4j.Logger


But for sure log4j.jar available in the path given in jars.txt and the lib
dir has proper permissions.

m I missing something here?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Custom-Shared-jars-in-TomEE-tp4676193p4676238.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Custom Shared jars in TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
jars.txt supports glob syntax like /foo/bar/*.jar ;)


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-09-14 22:36 GMT-07:00 skrajath <sk...@gmail.com>:

> Thanks Romain.
>
> But using jars.txt will again take us a step back. The whole idea of using
> virtual loader is to remove dependency on the library(jars). This shared
> library is provided by 3rd party and our app depend on that. So maintaining
> a list (probable 100 jars) would not be possible as our app support many
> version of 3rd party library.
> So is there any other way for EAR deployment with shared jars?
>
> We are using TomEE 1.7.1 and can we use new features(alternative to virtual
> loader) of Tomcat 8 in here for loading jars from given location?
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Custom-Shared-jars-in-TomEE-tp4676193p4676205.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: Custom Shared jars in TomEE

Posted by skrajath <sk...@gmail.com>.
Thanks Romain.

But using jars.txt will again take us a step back. The whole idea of using
virtual loader is to remove dependency on the library(jars). This shared
library is provided by 3rd party and our app depend on that. So maintaining
a list (probable 100 jars) would not be possible as our app support many
version of 3rd party library. 
So is there any other way for EAR deployment with shared jars?

We are using TomEE 1.7.1 and can we use new features(alternative to virtual
loader) of Tomcat 8 in here for loading jars from given location?



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Custom-Shared-jars-in-TomEE-tp4676193p4676205.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: Custom Shared jars in TomEE

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

This loader is for webapps only and context.xml as well. This means you can
use it only in xxx/webapp/META-INF/context.xml.

Note that jars.txt is now supported is ears. This is a nice alternative to
the virtual loader and nice thing is it will still be supported in tomee 7
- virtual loader has been dropped by tomcat in version 8.
Le 14 sept. 2015 05:27, "Uday Gire" <ud...@managecat.com> a écrit :

> Hi
>
> I am not surely understand your requirements but why not put specific jars
> to your different web applications WEB-INF/lib directory? Therefore, each
> apps use its own jar version.
>
> Best
>
> Uday Gire
> ManageCat, http://www.managecat.com <http://www.managecat.com/>
> uday.gire@managecat.com
>
> > On 14 Sep 2015, at 08:37, skrajath <sk...@gmail.com> wrote:
> >
> > Trying to have unique jars for each application, so using
> >
> > "org.apache.catalina.loader.VirtualWebappLoader
> > configuration in context.xml. The application is an EAR, deployed in
> 'apps'
> > folder under TomEE install directory. context.xml is in
> >
> > /apps/myApp/META-INF/
> >
> > but the jars are not visible to app. Question is,
> >
> > 1) is this the right location? or should it be in META-INF of the webApp
> > inside ear - /apps/myApp/webApp/META-INF
> >
> > 2) VirtualWebappLoader is only for webApps and for EAR under apps?
> >
> >
> >
> > --
> > View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/Custom-Shared-jars-in-TomEE-tp4676193.html
> > Sent from the TomEE Users mailing list archive at Nabble.com.
>
>
>
>
>
>

Re: Custom Shared jars in TomEE

Posted by Uday Gire <ud...@managecat.com>.
Hi 

I am not surely understand your requirements but why not put specific jars to your different web applications WEB-INF/lib directory? Therefore, each apps use its own jar version.

Best

Uday Gire
ManageCat, http://www.managecat.com <http://www.managecat.com/> 
uday.gire@managecat.com

> On 14 Sep 2015, at 08:37, skrajath <sk...@gmail.com> wrote:
> 
> Trying to have unique jars for each application, so using
> 
> "org.apache.catalina.loader.VirtualWebappLoader
> configuration in context.xml. The application is an EAR, deployed in 'apps'
> folder under TomEE install directory. context.xml is in
> 
> /apps/myApp/META-INF/
> 
> but the jars are not visible to app. Question is,
> 
> 1) is this the right location? or should it be in META-INF of the webApp
> inside ear - /apps/myApp/webApp/META-INF
> 
> 2) VirtualWebappLoader is only for webApps and for EAR under apps?
> 
> 
> 
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/Custom-Shared-jars-in-TomEE-tp4676193.html
> Sent from the TomEE Users mailing list archive at Nabble.com.