Error scanning entry org/apache/logging/log4j/util/Base64Util.class from jar file:///C:.../log4j-api/2.13.3/log4j-api-2.13.3.jar

Viewed 51

I am migrating to java 11 from java 8 in project. Before migrating, Project uses the sun.misc.BASE64Encoder for encoding the byte string to string in java 8 version. Where java 8 provides BASE64Encoder. After migrating to java 11, BASE64Encoder is not provided. So, I am using alternative approach for doing Base64 Encoding. I uses the BASE64 from java.util package. I follow the link https://stackoverflow.com/questions/62193303/java-11-patch-sun-misc-base64encoder. I have written the String pubKeyStr = Base64.getEncoder().encodeToString(publicKey.getEncoded()); code for encoding. After running the program on jetty server, I am getting below error.

`MultiException[java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/Base64Util.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/ProcessIdUtil.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/StackLocator$FqcnCallerLocator.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/StackLocator.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/internal/DefaultObjectInputFilter.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar]
at org.eclipse.jetty.annotations.AnnotationConfiguration.scanForAnnotations(AnnotationConfiguration.java:540)
at org.eclipse.jetty.annotations.AnnotationConfiguration.configure(AnnotationConfiguration.java:449)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:496)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1363)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
at org.eclipse.jetty.server.Server.start(Server.java:427)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:394)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at net.sourceforge.eclipsejetty.starter.jetty9.Jetty9Adapter.start(Jetty9Adapter.java:68)
at net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
at net.sourceforge.eclipsejetty.starter.jetty9.Jetty9LauncherMain.main(Jetty9LauncherMain.java:42)
Caused by: 
MultiException[java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/Base64Util.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/ProcessIdUtil.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/StackLocator$FqcnCallerLocator.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/StackLocator.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar, java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/internal/DefaultObjectInputFilter.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar]
at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:918)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.base/java.lang.Thread.run(Thread.java:834)
Suppressed: 
|java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/ProcessIdUtil.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar
|   at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:929)
|   at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
|   at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
|   at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
|   at java.base/java.lang.Thread.run(Thread.java:834)
|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 org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:986)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:970)
|   at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:925)
|   at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
|   at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
|   at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
|   at java.base/java.lang.Thread.run(Thread.java:834)
Suppressed: 
|java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/StackLocator$FqcnCallerLocator.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar
|   at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:929)
|   at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
|   at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
|   at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
|   at java.base/java.lang.Thread.run(Thread.java:834)
|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 org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:986)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:970)
|   at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:925)
|   at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
|   at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
|   at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
|   at java.base/java.lang.Thread.run(Thread.java:834)
Suppressed: 
|java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/StackLocator.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar
|   at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:929)
|   at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
|   at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
|   at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
|   at java.base/java.lang.Thread.run(Thread.java:834)
|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 org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:986)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:970)
|   at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:925)
|   at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
|   at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
|   at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
|   at java.base/java.lang.Thread.run(Thread.java:834)
Suppressed: 
|java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/internal/DefaultObjectInputFilter.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar
|   at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:929)
|   at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
|   at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
|   at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
|   at java.base/java.lang.Thread.run(Thread.java:834)
|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 org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:986)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:970)
|   at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:925)
|   at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
|   at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
|   at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
|   at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
|   at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
|   at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
|   at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: 
java.lang.RuntimeException: Error scanning entry org/apache/logging/log4j/util/Base64Util.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar
at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:929)
at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.base/java.lang.Thread.run(Thread.java:834)
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 org.eclipse.jetty.annotations.AnnotationParser.scanClass(AnnotationParser.java:986)
at org.eclipse.jetty.annotations.AnnotationParser.parseJarEntry(AnnotationParser.java:970)
at org.eclipse.jetty.annotations.AnnotationParser.lambda$parseJar$0(AnnotationParser.java:925)
at java.base/java.util.TreeMap$ValueSpliterator.forEachRemaining(TreeMap.java:2890)
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
at org.eclipse.jetty.annotations.AnnotationParser.parseJar(AnnotationParser.java:921)
at org.eclipse.jetty.annotations.AnnotationParser.parse(AnnotationParser.java:883)
at org.eclipse.jetty.annotations.AnnotationConfiguration$ParserTask.call(AnnotationConfiguration.java:165)
at org.eclipse.jetty.annotations.AnnotationConfiguration$1.run(AnnotationConfiguration.java:552)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
at java.base/java.lang.Thread.run(Thread.java:834)`

Mainly error is Error scanning entry org/apache/logging/log4j/util/Base64Util.class from jar file:///C:/Users/anmol/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar

I have used various approach. I used org.apache.commons.codec.binary.Base64 for encoding. I used the providing dependency for sun.misc.BASE64Encoder. I used the jars library for sun.misc.BASE64Encoder. For all approach I am getting same error. Please let me know the alternative approach for doing Base64Ecoding in java 11. Please help me out form this issue. Your help is appreciated.

0 Answers
Related