Discussion:
org.apache.commons.codec filtered by the classloader but not provided by TomEE WebProfile
Violeta Georgieva
2018-03-05 12:35:03 UTC
Permalink
Hi,

I have an EAR file with "lib" folder that contains "commons-codec" and a
WAR file that uses the libraries located in the "lib" folder. I do not have
issues with the other libraries in that folder but with "commons-codec" I
receive the exception below.

I'm using TomEE 7.0.4 WebProfile and in that distribution there is no
"commons-codec" provided by TomEE itself because of this I'm providing it
with the EAR file.

While debugging I saw that "org.apache.commons.codec" is intentionally
filtered by the classloader

https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java#L305

How it is supposed to provide this library so that my application can use
it?

Thanks,
Violeta

java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)
org.apache.tomee.catalina.TomEEWebappClassLoader.loadClass(TomEEWebappClassLoader.java:208)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
Jonathan Gallimore
2018-03-05 15:34:43 UTC
Permalink
Sounds like a mistake. I'm getting ready to do a release, so I'll check
that out first. Thanks for flagging that up.

Jon
Post by Violeta Georgieva
Hi,
I have an EAR file with "lib" folder that contains "commons-codec" and a
WAR file that uses the libraries located in the "lib" folder. I do not have
issues with the other libraries in that folder but with "commons-codec" I
receive the exception below.
I'm using TomEE 7.0.4 WebProfile and in that distribution there is no
"commons-codec" provided by TomEE itself because of this I'm providing it
with the EAR file.
While debugging I saw that "org.apache.commons.codec" is intentionally
filtered by the classloader
https://github.com/apache/tomee/blob/master/container/
openejb-core/src/main/java/org/apache/openejb/util/classloader/
URLClassLoaderFirst.java#L305
How it is supposed to provide this library so that my application can use
it?
Thanks,
Violeta
java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
WebappClassLoaderBase.java:1285)
org.apache.tomee.catalina.TomEEWebappClassLoader.loadClass(
TomEEWebappClassLoader.java:208)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
WebappClassLoaderBase.java:1119)
Violeta Georgieva
2018-04-16 10:07:26 UTC
Permalink
Hi,
Post by Jonathan Gallimore
Sounds like a mistake. I'm getting ready to do a release, so I'll check
that out first. Thanks for flagging that up.
I see you are discussing TomEE 7.0.5 work, should I create an issue for
this one?

Thanks,
Violeta
Post by Jonathan Gallimore
Jon
Post by Violeta Georgieva
Hi,
I have an EAR file with "lib" folder that contains "commons-codec" and a
WAR file that uses the libraries located in the "lib" folder. I do not have
issues with the other libraries in that folder but with "commons-codec" I
receive the exception below.
I'm using TomEE 7.0.4 WebProfile and in that distribution there is no
"commons-codec" provided by TomEE itself because of this I'm providing it
with the EAR file.
While debugging I saw that "org.apache.commons.codec" is intentionally
filtered by the classloader
https://github.com/apache/tomee/blob/master/container/
openejb-core/src/main/java/org/apache/openejb/util/classloader/
URLClassLoaderFirst.java#L305
How it is supposed to provide this library so that my application can use
it?
Thanks,
Violeta
java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
WebappClassLoaderBase.java:1285)
org.apache.tomee.catalina.TomEEWebappClassLoader.loadClass(
TomEEWebappClassLoader.java:208)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
WebappClassLoaderBase.java:1119)
Jonathan Gallimore
2018-04-16 10:22:48 UTC
Permalink
Yes please!

Thanks

Jon
Hi,
2018-03-05 17:34 GMT+02:00 Jonathan Gallimore <
Post by Jonathan Gallimore
Sounds like a mistake. I'm getting ready to do a release, so I'll check
that out first. Thanks for flagging that up.
I see you are discussing TomEE 7.0.5 work, should I create an issue for
this one?
Thanks,
Violeta
Post by Jonathan Gallimore
Jon
Post by Violeta Georgieva
Hi,
I have an EAR file with "lib" folder that contains "commons-codec" and
a
Post by Jonathan Gallimore
Post by Violeta Georgieva
WAR file that uses the libraries located in the "lib" folder. I do not
have
Post by Jonathan Gallimore
Post by Violeta Georgieva
issues with the other libraries in that folder but with "commons-codec"
I
Post by Jonathan Gallimore
Post by Violeta Georgieva
receive the exception below.
I'm using TomEE 7.0.4 WebProfile and in that distribution there is no
"commons-codec" provided by TomEE itself because of this I'm providing
it
Post by Jonathan Gallimore
Post by Violeta Georgieva
with the EAR file.
While debugging I saw that "org.apache.commons.codec" is intentionally
filtered by the classloader
https://github.com/apache/tomee/blob/master/container/
openejb-core/src/main/java/org/apache/openejb/util/classloader/
URLClassLoaderFirst.java#L305
How it is supposed to provide this library so that my application can
use
Post by Jonathan Gallimore
Post by Violeta Georgieva
it?
Thanks,
Violeta
java.lang.ClassNotFoundException: org.apache.commons.codec.
binary.Base64
Post by Jonathan Gallimore
Post by Violeta Georgieva
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
WebappClassLoaderBase.java:1285)
org.apache.tomee.catalina.TomEEWebappClassLoader.loadClass(
TomEEWebappClassLoader.java:208)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
WebappClassLoaderBase.java:1119)
Violeta Georgieva
2018-04-16 11:01:43 UTC
Permalink
Post by Jonathan Gallimore
Yes please!
Here it is https://issues.apache.org/jira/browse/TOMEE-2183

Regards,
Violeta
Post by Jonathan Gallimore
Thanks
Jon
Hi,
2018-03-05 17:34 GMT+02:00 Jonathan Gallimore <
Post by Jonathan Gallimore
Sounds like a mistake. I'm getting ready to do a release, so I'll check
that out first. Thanks for flagging that up.
I see you are discussing TomEE 7.0.5 work, should I create an issue for
this one?
Thanks,
Violeta
Post by Jonathan Gallimore
Jon
On Mon, Mar 5, 2018 at 12:35 PM, Violeta Georgieva <
Post by Violeta Georgieva
Hi,
I have an EAR file with "lib" folder that contains "commons-codec" and
a
Post by Jonathan Gallimore
Post by Violeta Georgieva
WAR file that uses the libraries located in the "lib" folder. I do not
have
Post by Jonathan Gallimore
Post by Violeta Georgieva
issues with the other libraries in that folder but with
"commons-codec"
Post by Jonathan Gallimore
I
Post by Jonathan Gallimore
Post by Violeta Georgieva
receive the exception below.
I'm using TomEE 7.0.4 WebProfile and in that distribution there is no
"commons-codec" provided by TomEE itself because of this I'm providing
it
Post by Jonathan Gallimore
Post by Violeta Georgieva
with the EAR file.
While debugging I saw that "org.apache.commons.codec" is
intentionally
Post by Jonathan Gallimore
Post by Jonathan Gallimore
Post by Violeta Georgieva
filtered by the classloader
https://github.com/apache/tomee/blob/master/container/
openejb-core/src/main/java/org/apache/openejb/util/classloader/
URLClassLoaderFirst.java#L305
How it is supposed to provide this library so that my application can
use
Post by Jonathan Gallimore
Post by Violeta Georgieva
it?
Thanks,
Violeta
java.lang.ClassNotFoundException: org.apache.commons.codec.
binary.Base64
Post by Jonathan Gallimore
Post by Violeta Georgieva
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
WebappClassLoaderBase.java:1285)
org.apache.tomee.catalina.TomEEWebappClassLoader.loadClass(
TomEEWebappClassLoader.java:208)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
WebappClassLoaderBase.java:1119)
Loading...