[slf4j-dev] [JIRA] (SLF4J-456) SLF4J 1.8 on JVMs < 9

QOS.CH (JIRA) noreply-jira at qos.ch
Tue Feb 19 10:41:00 CET 2019


Thorsten Heit created SLF4J-456:
-----------------------------------

             Summary: SLF4J 1.8 on JVMs < 9
                 Key: SLF4J-456
                 URL: https://jira.qos.ch/browse/SLF4J-456
             Project: SLF4J
          Issue Type: Bug
          Components: Core API, jcl-over-slf4j
    Affects Versions: 1.8.0-beta2
            Reporter: Thorsten Heit
            Assignee: SLF4J developers list


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:
{noformat}
(...)
[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
(...){noformat}
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



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the slf4j-dev mailing list