Uploaded image for project: 'Apache Tomcat Maven Plugin'
  1. Apache Tomcat Maven Plugin
  2. MTOMCAT-298

Classloader linkage problem

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: tomcat7
    • Labels:
      None

      Description

      We run 4 war's in a tomcat7:run environment. All wars log using slf4j. In the production environment we have logback-classic and logback-core jar added to the $CATALINA_HOME/lib directory and the configuration in $CATALINA_HOME/conf/logback. This works.

      When I do not add extra jars to mvn tomcat7:run environment there is no logging at all.

      when I add the logback jars I get a linkage error:

      Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, 
      org/slf4j/LoggerFactory, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for resolved class,
       org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
      

      (linebreaks added for readability)

        Attachments

          Activity

            People

            • Assignee:
              olamy Olivier Lamy
              Reporter:
              ronsmitsnl Ron Smits
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: