我在詹金斯建立了一个声纳目标。它曾经可以工作,但是几天前开始引发以下异常。
我看不出有什么问题。该代码在本地编译,并通过非声纳目标版本传递。
有任何想法吗??
[INFO] Instrumentation was successful.
[INFO] NOT adding cobertura ser file to attached artifacts list.
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Compiling 14 source files to /var/lib/jenkins/workspace/4Life-SONAR/4lifestyle/target/test-classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] Failure executing javac, but could not parse the error:
An exception has occurred in the compiler (1.6.0_20). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
at com.sun.tools.javac.code.Symbol$MethodSymbol.params(Symbol.java:1212)
at com.sun.tools.javac.jvm.ClassReader.attachParameterAnnotations(ClassReader.java:1125)
at com.sun.tools.javac.jvm.ClassReader.readMemberAttr(ClassReader.java:885)
at com.sun.tools.javac.jvm.ClassReader.readMemberAttrs(ClassReader.java:1041)
at com.sun.tools.javac.jvm.ClassReader.readMethod(ClassReader.java:1504)
at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:1600)
at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:1672)
at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1859)
at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1791)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:400)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:782)
at com.sun.tools.javac.jvm.ClassReader.loadClass(ClassReader.java:1965)
at com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:856)
at com.sun.tools.javac.comp.Resolve.findIdentInPackage(Resolve.java:1021)
at com.sun.tools.javac.comp.Attr.selectSym(Attr.java:1969)
at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1883)
at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1651)
at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:372)
at com.sun.tools.javac.comp.Attr.attribType(Attr.java:402)
at com.sun.tools.javac.comp.MemberEnter.attribImportType(MemberEnter.java:693)
at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:557)
at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:507)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:400)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:412)
at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:524)
at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:454)
at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:400)
at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:831)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:400)
at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:782)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:481)
at com.sun.tools.javac.comp.Enter.main(Enter.java:459)
at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:895)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:795)
at com.sun.tools.javac.main.Main.compile(Main.java:380)
at com.sun.tools.javac.main.Main.compile(Main.java:306)
at com.sun.tools.javac.main.Main.compile(Main.java:297)
at com.sun.tools.javac.Main.compile(Main.java:100)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:554)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompiler.java:161)
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:605)
at org.apache.maven.plugin.TestCompilerMojo.execute(TestCompilerMojo.java:161)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecycle(DefaultLifecycleExecutor.java:1205)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(DefaultLifecycleExecutor.java:1038)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:643)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.sonar.maven2.Maven2PluginExecutor.execute(Maven2PluginExecutor.java:65)
at org.sonar.maven2.Maven2PluginExecutor.execute(Maven2PluginExecutor.java:47)
at org.sonar.batch.SensorsExecutor.executeMavenPlugin(SensorsExecutor.java:69)
at org.sonar.batch.SensorsExecutor.execute(SensorsExecutor.java:55)
at org.sonar.batch.ProjectBatch.execute(ProjectBatch.java:53)
at org.sonar.batch.AggregatorBatch.analyzeProject(AggregatorBatch.java:109)
at org.sonar.batch.AggregatorBatch.analyzeProject(AggregatorBatch.java:106)
at org.sonar.batch.AggregatorBatch.analyzeProjects(AggregatorBatch.java:101)
at org.sonar.batch.AggregatorBatch.execute(AggregatorBatch.java:85)
at org.sonar.maven2.BatchMojo.executeBatch(BatchMojo.java:149)
at org.sonar.maven2.BatchMojo.execute(BatchMojo.java:131)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.codehaus.mojo.sonar.Bootstraper.executeMojo(Bootstraper.java:98)
at org.codehaus.mojo.sonar.Bootstraper.start(Bootstraper.java:75)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:88)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Can not execute Sonar
最佳答案
您似乎遇到了以下Java错误:
Bug 6889255 - javac MethodSymbol throws NPE if ClassReader does not read parameter names correctly
还有其他化身。例如
Netbeans问题180191
解决方法是将JDK升级到最新版本。
关于java - Sonar 构建失败,出现NullPointerException,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8801142/