Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-456

SLF4J 1.8 on JVMs < 9

    XMLWordPrintable

Details

    • major

    Description

      When I use slf4j-1.8.0-beta2 in an application that is being deployed to our Websphere 9 server, I see error messages in the deployment manager console:

      (...)
      [2/18/19 15:51:31:862 CET] 000022bd WSModuleDescr E   WSWS7011E: The configuration for the myapp-war-2019.4.0-SNAPSHOT.war application module cannot load correctly.
      The following error occurred:  com.ibm.ws.metadata.annotations.AnnotationException: Annotation processing failed for class:  module-info.class
              at com.ibm.ws.metadata.annotations.AnnotationConfigReader.getAnnotationData(AnnotationConfigReader.java:883)
              at com.ibm.ws.metadata.annotations.AnnotationConfigReader.getAnnotationDataForZippedArchive(AnnotationConfigReader.java:766)
              at com.ibm.ws.metadata.annotations.AnnotationConfigReader.getAnnotationData(AnnotationConfigReader.java:696)
              at com.ibm.ws.metadata.annotations.AnnotationConfigReader.populateModuleData(AnnotationConfigReader.java:353)
              at com.ibm.ws.metadata.MetaDataOrchestrator.getModuleData(MetaDataOrchestrator.java:112)
              at com.ibm.ws.websvcs.annotations.collector.WASAnnotationCollector.getMDO(WASAnnotationCollector.java:258)
              at com.ibm.ws.websvcs.annotations.collector.WASAnnotationCollector.collect(WASAnnotationCollector.java:146)
              at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl.getClassDataObjects(WSModuleDescriptorImpl.java:1458)
              at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl.initDBCMap(WSModuleDescriptorImpl.java:2153)
              at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl.buildJAXWSServiceRefs(WSModuleDescriptorImpl.java:1137)
              at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl._containsWebServiceClients(WSModuleDescriptorImpl.java:639)
              at com.ibm.ws.websvcs.desc.WSModuleDescriptorImpl.containsWebServiceClients(WSModuleDescriptorImpl.java:611)
              at com.ibm.ws.websvcs.deploy.WSCacheWriter.writeModuleCache(WSCacheWriter.java:583)
              at com.ibm.ws.websvcs.deploy.WSCacheWriter.writeApplicationCache(WSCacheWriter.java:242)
              at com.ibm.ws.websvcs.deploy.WSCacheWriter.writeApplicationCache(WSCacheWriter.java:167)
              at com.ibm.ws.websvcs.deploy.PersistentStorageInstallSaveTask.performTask(PersistentStorageInstallSaveTask.java:196)
              at com.ibm.ws.management.application.sync.AppBinaryProcessor$ExpandApp.expand(AppBinaryProcessor.java:1770)
              at com.ibm.ws.management.application.sync.AppBinaryProcessor$AppBinThread.run(AppBinaryProcessor.java:1276)
              at java.lang.Thread.run(Thread.java:811)
      Caused by: java.lang.IllegalArgumentException
              at org.objectweb.asm.ClassReader.<init>(Unknown Source)
              at org.objectweb.asm.ClassReader.<init>(Unknown Source)
              at org.objectweb.asm.ClassReader.<init>(Unknown Source)
              at com.ibm.ws.metadata.annotations.AnnotationConfigReader.getAnnotationData(AnnotationConfigReader.java:836)
              ... 18 more
      (...)

      Switching back to the older 1.7.25 version lets this error message disappear.

      The reason is that Websphere (still) uses Java 8 which cannot parse / process the module-info.class that was compiled with Java 9.

      My WAR inside the EAR actually only uses slf4j-api-1.8.0-beta2.jar and jcl-over-slf4j-1.8.0-beta2.jar, but I assume that all Jars containing this file are affected.

      Solution:

      Move the class to META-INF/versions/9 and mark the resulting jar as being a multi-release jar. See the example in https://github.com/apache/maven-compiler-plugin/blob/master/src/it/multirelease-patterns/singleproject-runtime/pom.xml for how to do this

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            theit Thorsten Heit
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: