org.apache.bcel.classfile.ClassFormatException:常量池中的无效字节标记:19

时间:2018-03-20 11:35:28

标签: java eclipse maven

当我使用mvn site时,会生成报告,但我在终端中有这个例外:

[WARNING] Unable to process class module-info.class in JarAnalyzer File C:\WINDOWS\system32\config\systemprofile\.m2\repository\org\apache\logging\log4j\log4j-api\2.10.0\log4j-api-2.10.0.jar
org.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
    at org.apache.bcel.classfile.Constant.readConstant (Constant.java:161)
    at org.apache.bcel.classfile.ConstantPool.<init> (ConstantPool.java:69)
    at org.apache.bcel.classfile.ClassParser.readConstantPool (ClassParser.java:235)
    at org.apache.bcel.classfile.ClassParser.parse (ClassParser.java:143)
    at org.apache.maven.shared.jar.classes.JarClassesAnalysis.analyze (JarClassesAnalysis.java:96)
    at org.apache.maven.report.projectinfo.dependencies.Dependencies.getJarDependencyDetails (Dependencies.java:259)
    at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.hasSealed (DependenciesRenderer.java:1542)
    at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderSectionDependencyFileDetails (DependenciesRenderer.java:545)
    at org.apache.maven.report.projectinfo.dependencies.renderer.DependenciesRenderer.renderBody (DependenciesRenderer.java:240)
    at org.apache.maven.reporting.AbstractMavenReportRenderer.render (AbstractMavenReportRenderer.java:83)
    at org.apache.maven.report.projectinfo.DependenciesReport.executeReport (DependenciesReport.java:201)
    at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:255)
    at org.apache.maven.plugins.site.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:219)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule (DefaultSiteRenderer.java:319)
    at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:135)
    at org.apache.maven.plugins.site.SiteMojo.renderLocale (SiteMojo.java:175)
    at org.apache.maven.plugins.site.SiteMojo.execute (SiteMojo.java:138)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

我使用eclipse。这是一个没有选择原型的简单maven项目。

可能是什么问题?

有关maven和JDK的更多信息:

Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02- 
24T22:49:05+03:00)
Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.5.3\bin\..
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jre1.8.0_161
Default locale: en_US, platform encoding: Cp1251
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

2 个答案:

答案 0 :(得分:3)

我怀疑这是由工具链中的一个工具(错误地)尝试从log4j-api jar中的META-INF/versions/java9目录加载类引起的。

您是否可以使用“多变量jar感知”的BCEL版本并且不尝试这样做?

答案 1 :(得分:1)

在所有这段时间里,我找到的解决方案只是将2.10.0的{​​logis]版本减少到2.9.1