Christopher Eldridge created TOMEE-2244:
-------------------------------------------
Summary: Classloader issues with EAR file
Key: TOMEE-2244
URL: https://issues.apache.org/jira/browse/TOMEE-2244
Project: TomEE
Issue Type: Bug
Components: TomEE Core Server
Affects Versions: 7.0.5
Reporter: Christopher Eldridge
I'm seeing errors when I have the same dependency in an EAR lib which also
exists in $CATALINA_HOME/lib. When I have the same dependency (regardless of
version, even if it is the same), I get the following error:
Caused by: java.lang.LinkageError: loader constraint violation: when resolving
interface method
"org.apache.logging.log4j.Logger.debug(Ljava/lang/String;[Lorg/apache/logging/log4j/util/Supplier;)V"
the class loader (instance of
org/apache/tomee/catalina/TomEEWebappClassLoader) of the current class,
com/paychex/corp/crmsalesleades/CRMSalesLeadESImpl, and the class loader
(instance of sun/misc/Launcher$AppClassLoader) for the method's defining class,
org/apache/logging/log4j/Logger, have different Class objects for the type
[Lorg/apache/logging/log4j/util/Supplier; used in the signature
I also had an issue where I had a specific version of org.jvnet.staxes:stax-ex
included in my EAR (below)
logger=OpenEJB,{},FATAL ERROR: Unknown error in Assembler. Please send the
following stack trace and this message to
[[email protected]|mailto:[email protected]] :
java.lang.IllegalArgumentException
This is causing me to only have the ability to utilize those dependencies in
$CATALINA_HOME/lib, which means I can't use different versions of any of those
dependencies in my code. This is especially hard when the dependency is
transitive, I've had to make multiple edits to my gradle file to exclude
specific dependencies to prevent collision. I do not have this issue with
regular WAR files as the classes seem to load fine even if they are the same
dependency, which leads me to believe it's due to an issue between the EAR lib
classloader and the Tomee classloader.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)