You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by lakshman udayakantha <ny...@gmail.com> on 2016/07/07 10:19:57 UTC

Define common runtimes for web apps

Hi folks,

My requirement is to define common runtimes (several class paths) so that
several apps can use that by mentioning which class paths are using in web
app level. I suppose to do this  by defining a runtime name with directory
path in an XML. I found by digging TomEE code that TempClassLoader is
responsible for loading classes and holding class loader definition. Hope
to override the behaviour of this class to achieve this requirement. Am I
in the right path? or any other better way to achieve this?

Thanks
Lakshman

Re: Define common runtimes for web apps

Posted by Romain Manni-Bucau <rm...@gmail.com>.
the one I pasted for a folder, a file path, mvn coordinates
(mvn:group:artifact:version), http path or any custom registered resolver
on 7.x


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-07-07 13:26 GMT+02:00 lakshman udayakantha <ny...@gmail.com>:

> Hi Romain,
>
> Thanks for the quick reply. In what format I should mention jar in jars.txt
> file?
>
> Thanks
>
> On Thu, Jul 7, 2016 at 3:53 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Hi
> >
> > can you add a WEB-INF/jars.txt in the wars needing this behavior? If so
> in
> > this file you can put /opt/tomee/libs/*.jar and all apps will inherit
> from
> > it.
> >
> > Otherwise we have a ClassLoaderEnricher API which is intended for that
> > purpose but it is a bit lower level so can be harder to use (
> > tomee.classloader.configurer.clazz=my.company.ClassLoaderConfigurerImpl).
> >
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> > <http://www.tomitribe.com> | JavaEE Factory
> > <https://javaeefactory-rmannibucau.rhcloud.com>
> >
> > 2016-07-07 12:19 GMT+02:00 lakshman udayakantha <ny...@gmail.com>:
> >
> > > Hi folks,
> > >
> > > My requirement is to define common runtimes (several class paths) so
> that
> > > several apps can use that by mentioning which class paths are using in
> > web
> > > app level. I suppose to do this  by defining a runtime name with
> > directory
> > > path in an XML. I found by digging TomEE code that TempClassLoader is
> > > responsible for loading classes and holding class loader definition.
> Hope
> > > to override the behaviour of this class to achieve this requirement.
> Am I
> > > in the right path? or any other better way to achieve this?
> > >
> > > Thanks
> > > Lakshman
> > >
> >
>

Re: Define common runtimes for web apps

Posted by lakshman udayakantha <ny...@gmail.com>.
Hi Romain,

Thanks for the quick reply. In what format I should mention jar in jars.txt
file?

Thanks

On Thu, Jul 7, 2016 at 3:53 PM, Romain Manni-Bucau <rm...@gmail.com>
wrote:

> Hi
>
> can you add a WEB-INF/jars.txt in the wars needing this behavior? If so in
> this file you can put /opt/tomee/libs/*.jar and all apps will inherit from
> it.
>
> Otherwise we have a ClassLoaderEnricher API which is intended for that
> purpose but it is a bit lower level so can be harder to use (
> tomee.classloader.configurer.clazz=my.company.ClassLoaderConfigurerImpl).
>
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
> <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
> <http://www.tomitribe.com> | JavaEE Factory
> <https://javaeefactory-rmannibucau.rhcloud.com>
>
> 2016-07-07 12:19 GMT+02:00 lakshman udayakantha <ny...@gmail.com>:
>
> > Hi folks,
> >
> > My requirement is to define common runtimes (several class paths) so that
> > several apps can use that by mentioning which class paths are using in
> web
> > app level. I suppose to do this  by defining a runtime name with
> directory
> > path in an XML. I found by digging TomEE code that TempClassLoader is
> > responsible for loading classes and holding class loader definition. Hope
> > to override the behaviour of this class to achieve this requirement. Am I
> > in the right path? or any other better way to achieve this?
> >
> > Thanks
> > Lakshman
> >
>

Re: Define common runtimes for web apps

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

can you add a WEB-INF/jars.txt in the wars needing this behavior? If so in
this file you can put /opt/tomee/libs/*.jar and all apps will inherit from
it.

Otherwise we have a ClassLoaderEnricher API which is intended for that
purpose but it is a bit lower level so can be harder to use (
tomee.classloader.configurer.clazz=my.company.ClassLoaderConfigurerImpl).


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-07-07 12:19 GMT+02:00 lakshman udayakantha <ny...@gmail.com>:

> Hi folks,
>
> My requirement is to define common runtimes (several class paths) so that
> several apps can use that by mentioning which class paths are using in web
> app level. I suppose to do this  by defining a runtime name with directory
> path in an XML. I found by digging TomEE code that TempClassLoader is
> responsible for loading classes and holding class loader definition. Hope
> to override the behaviour of this class to achieve this requirement. Am I
> in the right path? or any other better way to achieve this?
>
> Thanks
> Lakshman
>