0

I am using weblogic version 12c 12.1.3 and I have updated the log4j jar version to log4j-api:2.17.1 log4j-core:2.17.1, but at the time of deployment in weblogic I am getting this error :-

weblogic.application.ModuleException: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
               at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:140)
               at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
               at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:216)
               at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:211)
               at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
               Truncated. see log file for complete stacktrace
Caused By: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of weblogic/utils/classloaders/ChangeAwareClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
               at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:273)
               at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
               at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254)

Any solution on this ?

2 Answers 2

0

I have this in my weblogic.xml file. Not sure if this will fix your problem but worth a try...

<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.4/weblogic-web-app.xsd">
  ...
  <container-descriptor>
    <prefer-application-packages>
      <package-name>org.slf4j.*</package-name>
      <package-name>org.springframework.*</package-name>
    </prefer-application-packages>

    <prefer-application-resources>
      <resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name>
    </prefer-application-resources>
  </container-descriptor>

</weblogic-web-app>
Sign up to request clarification or add additional context in comments.

Comments

0

You need to check maven dependencies. It is highly probable to have an indirect dependency for old slf4j-api

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.