Linkage Error

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Linkage Error

Dignesh
Any Ideas on below error

Caused by: java.lang.LinkageError: loader constraint violation: loader
(instance of org/apache/openejb/util/classloader/URLClassLoaderFirst)
previously initiated loading for a different type with name
"com/fasterxml/jackson/databind/ObjectMapper"
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at
org.apache.openejb.util.classloader.URLClassLoaderFirst.loadInternal(URLClassLoaderFirst.java:173)
        at
org.apache.openejb.util.classloader.URLClassLoaderFirst.loadClass(URLClassLoaderFirst.java:121)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)


I am using 7.0.2 Version of TomEE.

Thank you,
Dignesh




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
Reply | Threaded
Open this post in threaded view
|

Re: Linkage Error

Romain Manni-Bucau
Hi Dignesh,

can you check 7.0.5 out before digging further?
Also do you deploy an ear or war? If an ear maybe ensure there is no
jackson in the webapps.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 6 juin 2018 à 10:19, Dignesh <[hidden email]> a écrit :

> Any Ideas on below error
>
> Caused by: java.lang.LinkageError: loader constraint violation: loader
> (instance of org/apache/openejb/util/classloader/URLClassLoaderFirst)
> previously initiated loading for a different type with name
> "com/fasterxml/jackson/databind/ObjectMapper"
>         at java.lang.ClassLoader.defineClass1(Native Method)
>         at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
>         at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
>         at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
>         at
>
> org.apache.openejb.util.classloader.URLClassLoaderFirst.loadInternal(URLClassLoaderFirst.java:173)
>         at
>
> org.apache.openejb.util.classloader.URLClassLoaderFirst.loadClass(URLClassLoaderFirst.java:121)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>
>
> I am using 7.0.2 Version of TomEE.
>
> Thank you,
> Dignesh
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>
Reply | Threaded
Open this post in threaded view
|

Re: Linkage Error

Dignesh
Hello Romain,

I have deployed an ear , which in turn contains multiple wars.
I have jackson libraries in my webapp.
I have recently upgraded the jackson to jackson 2.9.5 libraries and with
that change I am seeing this issue.
When I revert back to the older version jackson 2.6.6 libraries , i dont see
the linkage error. I removed the older libraries and replaced with the newer
one again and i dont see the issue.
This behaviour is something i am not seeing it consistently.

Just curious to understand how it was working earlier when i had jackson in
webapps and now it is throwing the error.



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
Reply | Threaded
Open this post in threaded view
|

Re: Linkage Error

Romain Manni-Bucau
if jackson changed something about its lifecycle@classloader usage then it
can lead to that if part of the app overlapp between the lib part of the
ear and the webapps. In TomEE the webapp tries to load from the parent
first.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 6 juin 2018 à 10:44, Dignesh <[hidden email]> a écrit :

> Hello Romain,
>
> I have deployed an ear , which in turn contains multiple wars.
> I have jackson libraries in my webapp.
> I have recently upgraded the jackson to jackson 2.9.5 libraries and with
> that change I am seeing this issue.
> When I revert back to the older version jackson 2.6.6 libraries , i dont
> see
> the linkage error. I removed the older libraries and replaced with the
> newer
> one again and i dont see the issue.
> This behaviour is something i am not seeing it consistently.
>
> Just curious to understand how it was working earlier when i had jackson in
> webapps and now it is throwing the error.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>