New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[java] PMD crashes with java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/xml/ws/Service #1330

Closed
lasselindqvist opened this Issue Sep 4, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@lasselindqvist

lasselindqvist commented Sep 4, 2018

Affects PMD Version:
At least 6.4.0 and 6.7.0
Rule:
All
Description:
PMD crashes with java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/xml/ws/Service

Code Sample demonstrating the issue:
I cannot provide an example code base right now.

Running PMD through: Maven

    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:184)
    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:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    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)
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/xml/ws/Service
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass (URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100 (URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged (Native Method)
    at java.net.URLClassLoader.findClass (URLClassLoader.java:361)
    at net.sourceforge.pmd.util.ClasspathClassLoader.loadClass (ClasspathClassLoader.java:114)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:357)
    at java.lang.ClassLoader.defineClass1 (Native Method)
    at java.lang.ClassLoader.defineClass (ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass (SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass (URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100 (URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run (URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged (Native Method)
    at java.net.URLClassLoader.findClass (URLClassLoader.java:361)
    at net.sourceforge.pmd.util.ClasspathClassLoader.loadClass (ClasspathClassLoader.java:114)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:411)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:357)
    at net.sourceforge.pmd.lang.java.typeresolution.PMDASMClassLoader.loadClass (PMDASMClassLoader.java:75)
    at net.sourceforge.pmd.lang.java.qname.JavaTypeQualifiedName.loadType (JavaTypeQualifiedName.java:195)
    at net.sourceforge.pmd.lang.java.qname.JavaTypeQualifiedName.getType (JavaTypeQualifiedName.java:175)
    at net.sourceforge.pmd.lang.java.ast.AbstractAnyTypeDeclaration.setQualifiedName (AbstractAnyTypeDeclaration.java:85)
    at net.sourceforge.pmd.lang.java.qname.QualifiedNameResolver.visit (QualifiedNameResolver.java:212)
    at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorReducedAdapter.visit (JavaParserVisitorReducedAdapter.java:16)
    at net.sourceforge.pmd.lang.java.ast.ASTClassOrInterfaceDeclaration.jjtAccept (ASTClassOrInterfaceDeclaration.java:55)
    at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept (AbstractJavaNode.java:60)
    at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit (JavaParserVisitorAdapter.java:11)
    at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit (JavaParserVisitorAdapter.java:206)
    at net.sourceforge.pmd.lang.java.ast.ASTTypeDeclaration.jjtAccept (ASTTypeDeclaration.java:37)
    at net.sourceforge.pmd.lang.java.ast.AbstractJavaNode.childrenAccept (AbstractJavaNode.java:60)
    at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit (JavaParserVisitorAdapter.java:11)
    at net.sourceforge.pmd.lang.java.ast.JavaParserVisitorAdapter.visit (JavaParserVisitorAdapter.java:181)
    at net.sourceforge.pmd.lang.java.qname.QualifiedNameResolver.visit (QualifiedNameResolver.java:134)
    at net.sourceforge.pmd.lang.java.ast.ASTCompilationUnit.jjtAccept (ASTCompilationUnit.java:41)
    at net.sourceforge.pmd.lang.java.qname.QualifiedNameResolver.initializeWith (QualifiedNameResolver.java:118)
    at net.sourceforge.pmd.lang.java.AbstractJavaHandler$8.start (AbstractJavaHandler.java:140)
    at net.sourceforge.pmd.SourceCodeProcessor.resolveQualifiedNames (SourceCodeProcessor.java:125)
    at net.sourceforge.pmd.SourceCodeProcessor.processSource (SourceCodeProcessor.java:176)
    at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode (SourceCodeProcessor.java:96)
    at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode (SourceCodeProcessor.java:51)
    at net.sourceforge.pmd.processor.PmdRunnable.call (PmdRunnable.java:78)
    at net.sourceforge.pmd.processor.PmdRunnable.call (PmdRunnable.java:24)
    at java.util.concurrent.FutureTask.run (FutureTask.java:266)
    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:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:624)
    at java.lang.Thread.run (Thread.java:748)
@jsotuyod

This comment has been minimized.

Member

jsotuyod commented Sep 4, 2018

@lasselindqvist thanks! definitely a different bug

adangel added a commit to adangel/scratchpad that referenced this issue Sep 18, 2018

@adangel

This comment has been minimized.

Member

adangel commented Sep 18, 2018

@adangel adangel removed this from the 6.8.0 milestone Sep 29, 2018

@ruckc

This comment has been minimized.

ruckc commented Oct 2, 2018

I'm able to reproduce it with PMD 6.8.0 and
"Execution default of goal org.apache.maven.plugins:maven-pmd-plugin:3.10.0:pmd failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-pmd-plugin:3.10.0:pmd: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/xml/bind/annotation/adapters/XmlAdapter"

the actual artifact this comes from is "javax:javaee-api:jar:6.0"

@adangel adangel self-assigned this Oct 6, 2018

adangel added a commit to adangel/pmd that referenced this issue Oct 6, 2018

[java] PMD crashes with java.lang.ClassFormatError: Absent Code
attribute in method that is not native or abstract in class file
javax/xml/ws/Service

Fixes pmd#1330

@adangel adangel added the has:pr label Oct 6, 2018

@adangel adangel added this to the 6.9.0 milestone Oct 6, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment