[jira] [Comment Edited] (LOG4J2-3235) Exception: Invalid byte tag in constant pool: 19 for module-info.class Java 7

2022-01-18 Thread Gary D. Gregory (Jira)


[ 
https://issues.apache.org/jira/browse/LOG4J2-3235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17459915#comment-17459915
 ] 

Gary D. Gregory edited comment on LOG4J2-3235 at 1/18/22, 12:24 PM:


It looks to me like there are two issues here:
 * I do not think we should have put a {{module-info.class}} into a jar file 
meant for Java 7.
 * This might not be BCEL's fault: It just parses the class file you give it, 
or a zip file you give it, or an input stream; there is no way to tell without 
knowing the version of Tomcat and BCEL.

As a workaround, you can remove this class file from the jar file.

Gary


was (Author: garydgregory):
It looks to me like there are two issues here:
 * I do not think we should have put a {{module-info.class}} into a jar file 
meant for Java 7.
 * This might not BCEL's fault. It just parses the class file you give it, or a 
zip file you give it, or an input stream; there is no way to tell without 
knowing the version of Tomcat and BCEL.

As a workaround, you can remove this class file from the jar file.

Gary

> Exception: Invalid byte tag in constant pool: 19 for module-info.class Java 7
> -
>
> Key: LOG4J2-3235
> URL: https://issues.apache.org/jira/browse/LOG4J2-3235
> Project: Log4j 2
>  Issue Type: Bug
>  Components: API
>Reporter: Saptarshi De
>Priority: Critical
> Fix For: 2.12.1
>
>
> Due to the recent vulnerability CVE-2021-44228 and CVE-2021-45046, We are 
> updating to Log4j 2.12.2 on our Java 7 environment.
> Log4j 2.12.2 is supposed to be compatible with Java 7.
> We face the below exception on startup.
> Please suggest a solution for the same.
>  
> {code:java}
> 15-Dec-2021 12:55:32.722 SEVERE [localhost-startStop-1] 
> org.apache.catalina.startup.ContextConfig.processAnnotationsJar Unable to 
> process Jar entry [META-INF/versions/9/module-info.class] from Jar 
> [jar:file:/--/log4j-api-2.12.2.jar!/] for annotations
>  org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag 
> in constant pool: 19
>  at 
> org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
>  at 
> org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:55)
>  at 
> org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:177)
>  at 
> org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:85)
>  at 
> org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2011)
>  at 
> org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961)
>  at 
> org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936)
>  at 
> org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897)
>  at 
> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
>  at 
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
>  at 
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
>  at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>  at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>  at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5066)
>  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>  at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
>  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
>  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
>  at 
> org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
>  at 
> org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  at java.lang.Thread.run(Thread.java:745)
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)


[jira] [Comment Edited] (LOG4J2-3235) Exception: Invalid byte tag in constant pool: 19 for module-info.class Java 7

2021-12-16 Thread Saptarshi De (Jira)


[ 
https://issues.apache.org/jira/browse/LOG4J2-3235?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17461236#comment-17461236
 ] 

Saptarshi De edited comment on LOG4J2-3235 at 12/17/21, 7:12 AM:
-

Hi [~ggregory] 

Really appreciate your input on this, it makes sense and the work around does 
work fine.

However modifying the jar manually will not be an apt solution for us as we 
have multiple applications and environments and it might be not possible to 
maintain a custom version for log4j-api alone. It will be prone to errors.

Kindly check on this, Thank you.

FYI Tomcat VERSION:-8.0.23

Regards

Saptarshi


was (Author: JIRAUSER281947):
Hi [~ggregory] 

Really appreciate your input on this, it makes sense and the work around does 
work fine.

However modifying the jar manually will not be an apt solution for us as we 
have multiple applications and environments and it might be not possible to 
maintain a custom version for log4j-api alone. It will be prone to errors.

Kindly check on this, Thank you.

Regards

Saptarshi

> Exception: Invalid byte tag in constant pool: 19 for module-info.class Java 7
> -
>
> Key: LOG4J2-3235
> URL: https://issues.apache.org/jira/browse/LOG4J2-3235
> Project: Log4j 2
>  Issue Type: Bug
>  Components: API
>Reporter: Saptarshi De
>Priority: Critical
> Fix For: 2.12.1
>
>
> Due to the recent vulnerability CVE-2021-44228 and CVE-2021-45046, We are 
> updating to Log4j 2.12.2 on our Java 7 environment.
> Log4j 2.12.2 is supposed to be compatible with Java 7.
> We face the below exception on startup.
> Please suggest a solution for the same.
>  
> {code:java}
> 15-Dec-2021 12:55:32.722 SEVERE [localhost-startStop-1] 
> org.apache.catalina.startup.ContextConfig.processAnnotationsJar Unable to 
> process Jar entry [META-INF/versions/9/module-info.class] from Jar 
> [jar:file:/--/log4j-api-2.12.2.jar!/] for annotations
>  org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag 
> in constant pool: 19
>  at 
> org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
>  at 
> org.apache.tomcat.util.bcel.classfile.ConstantPool.(ConstantPool.java:55)
>  at 
> org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:177)
>  at 
> org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:85)
>  at 
> org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2011)
>  at 
> org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961)
>  at 
> org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936)
>  at 
> org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897)
>  at 
> org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
>  at 
> org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
>  at 
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
>  at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>  at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>  at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5066)
>  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>  at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
>  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
>  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
>  at 
> org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1101)
>  at 
> org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1786)
>  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>  at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  at java.lang.Thread.run(Thread.java:745)
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)