You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Dignesh <dg...@opentext.com> on 2017/01/03 07:26:54 UTC

Re: Classloading issues integrating Jersey 2.16 and apache-tomee-plus-7.0.0

Hi Romain,

I am still seeing the issue on TomEE 7.0.2 version. Can you please guide me
where I am going wrong.

I have written a customclassloader which is placed in lib directory

Below is my context.xml data

<Context>
    <Loader className="com.opentext.tomee.OTMMTomeeLoader"
	loaderClass="org.apache.tomee.catalina.WebAppFirstEarClassLoader"/>
</Context>

I have attached the two java files (customClassLoader) CustomTomEELoader.txt
<http://tomee-openejb.979440.n4.nabble.com/file/n4680844/CustomTomEELoader.txt>  
CustomTomEEClassLoader.txt
<http://tomee-openejb.979440.n4.nabble.com/file/n4680844/CustomTomEEClassLoader.txt>  

Thank you very much 




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Classloading-issues-integrating-Jersey-2-16-and-apache-tomee-plus-7-0-0-tp4678794p4680844.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: Classloading issues integrating Jersey 2.16 and apache-tomee-plus-7.0.0

Posted by Dignesh <dg...@opentext.com>.
Thank you very much Romain.!!!
It is working fine :) 




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Classloading-issues-integrating-Jersey-2-16-and-apache-tomee-plus-7-0-0-tp4678794p4680852.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: Classloading issues integrating Jersey 2.16 and apache-tomee-plus-7.0.0

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2017-01-03 10:20 GMT+01:00 Dignesh <dg...@opentext.com>:

> Okay. I will remove the custom loader.
>
> A last question.
> As per the description in https://issues.apache.org/jira/browse/TOMEE-1851
> ,
> I should not see the issue of I add the below content in context.xml file
>
>
Not really. This only control the parent-first/last behavior for not
filtered classes. With jersey you likely need to force the loading of a set
of filtered classes. This is controllable with forceSkip property but I
think you can't set it from the configuration.

What I'd do:

1. test it in a plain webapp (no ear) and make it work with previously
mentionned configurations
1. bis. if you have issues with 1. please share a maven project as
mentionned with a tomee setup
2. move this configuration to ear, normally if you used global
configuration it should work too, if not try adding back the
WebAppFirstEarClassLoader

Note that 1. will let you identify which classes need a particular loading
(org.glassfish is likely just a part of the iceberg but actual classes are
- as mentionned - probably com.sun.x.

Until you do this work I fear you will just be in a try and fail process.
Once these classes are identified you can configure tomee to make it
working.


> <Context>
>   <Loader className="org.apache.tomee.catalina.TomEEWebappLoader"
> loaderClass="org.apache.tomee.catalina.WebAppFirstEarClassLoader"
> forceSkip="com.company.fromparent.,org.apache.deltaspike" />
> </Context>
>
> But looks like it is not working. Is it something which is expected  ?
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Classloading-issues-integrating-Jersey-2-
> 16-and-apache-tomee-plus-7-0-0-tp4678794p4680850.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>

Re: Classloading issues integrating Jersey 2.16 and apache-tomee-plus-7.0.0

Posted by Dignesh <dg...@opentext.com>.
Okay. I will remove the custom loader.

A last question.
As per the description in https://issues.apache.org/jira/browse/TOMEE-1851,
I should not see the issue of I add the below content in context.xml file

<Context>
  <Loader className="org.apache.tomee.catalina.TomEEWebappLoader"
loaderClass="org.apache.tomee.catalina.WebAppFirstEarClassLoader"
forceSkip="com.company.fromparent.,org.apache.deltaspike" />
</Context>

But looks like it is not working. Is it something which is expected  ?




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Classloading-issues-integrating-Jersey-2-16-and-apache-tomee-plus-7-0-0-tp4678794p4680850.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: Classloading issues integrating Jersey 2.16 and apache-tomee-plus-7.0.0

Posted by Romain Manni-Bucau <rm...@gmail.com>.
No remove this Loader which likely not do what you want (this loader class
is more an internal at the moment than something exposed)


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

2017-01-03 10:05 GMT+01:00 Dignesh <dg...@opentext.com>:

> Hi Romain,
>
> Thank you very much for quick response.
>
> openejb.classloader.forced-load - classes to load from the webapp first.
>
> So if I add the above property in the system.properties file, Is there a
> need to add the below content in context.xml of each webapp?
>
> <Context>
>   <Loader className="org.apache.tomee.catalina.TomEEWebappLoader"
> loaderClass="org.apache.tomee.catalina.WebAppFirstEarClassLoader"/>
> </Context>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Classloading-issues-integrating-Jersey-2-
> 16-and-apache-tomee-plus-7-0-0-tp4678794p4680848.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>

Re: Classloading issues integrating Jersey 2.16 and apache-tomee-plus-7.0.0

Posted by Dignesh <dg...@opentext.com>.
Hi Romain,

Thank you very much for quick response.

openejb.classloader.forced-load - classes to load from the webapp first.

So if I add the above property in the system.properties file, Is there a
need to add the below content in context.xml of each webapp?

<Context>
  <Loader className="org.apache.tomee.catalina.TomEEWebappLoader"
loaderClass="org.apache.tomee.catalina.WebAppFirstEarClassLoader"/>
</Context>




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/Classloading-issues-integrating-Jersey-2-16-and-apache-tomee-plus-7-0-0-tp4678794p4680848.html
Sent from the TomEE Dev mailing list archive at Nabble.com.

Re: Classloading issues integrating Jersey 2.16 and apache-tomee-plus-7.0.0

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

you don't need to write a custom loader, using
openejb.classloader.forced-[load|skip]=package1,package2 should be enough
(in conf/system.properties)

I'd use the packages org.glassfish,com.sun to start


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

2017-01-03 8:26 GMT+01:00 Dignesh <dg...@opentext.com>:

> Hi Romain,
>
> I am still seeing the issue on TomEE 7.0.2 version. Can you please guide me
> where I am going wrong.
>
> I have written a customclassloader which is placed in lib directory
>
> Below is my context.xml data
>
> <Context>
>     <Loader className="com.opentext.tomee.OTMMTomeeLoader"
>         loaderClass="org.apache.tomee.catalina.
> WebAppFirstEarClassLoader"/>
> </Context>
>
> I have attached the two java files (customClassLoader)
> CustomTomEELoader.txt
> <http://tomee-openejb.979440.n4.nabble.com/file/n4680844/
> CustomTomEELoader.txt>
> CustomTomEEClassLoader.txt
> <http://tomee-openejb.979440.n4.nabble.com/file/n4680844/
> CustomTomEEClassLoader.txt>
>
> Thank you very much
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.
> n4.nabble.com/Classloading-issues-integrating-Jersey-2-
> 16-and-apache-tomee-plus-7-0-0-tp4678794p4680844.html
> Sent from the TomEE Dev mailing list archive at Nabble.com.
>