Repository navigation
Closed
Description
Rule Set:
apex-security, vf-security
Description:
Apex parser broken in the latest build. Stack trace is below:
$ ./run.sh pmd -d ~/myApexPackage -f text -rulesets apex-security
Exception in thread "main" java.lang.NoClassDefFoundError: shaded/org/objectweb/asm/Handle
at apex.jorje.semantic.ast.context.Emitter.<clinit>(Emitter.java:42)
at apex.jorje.semantic.compiler.CompilerContext.<init>(CompilerContext.java:50)
at apex.jorje.semantic.compiler.ApexCompiler.<init>(ApexCompiler.java:57)
at apex.jorje.semantic.compiler.ApexCompiler.<init>(ApexCompiler.java:37)
at apex.jorje.semantic.compiler.ApexCompiler$Builder.build(ApexCompiler.java:224)
at net.sourceforge.pmd.lang.apex.ast.CompilerService.compile(CompilerService.java:92)
at net.sourceforge.pmd.lang.apex.ast.CompilerService.visitAstsFromStrings(CompilerService.java:87)
at net.sourceforge.pmd.lang.apex.ast.CompilerService.visitAstFromString(CompilerService.java:75)
at net.sourceforge.pmd.lang.apex.ast.ApexParser.parseApex(ApexParser.java:44)
at net.sourceforge.pmd.lang.apex.ast.ApexParser.parse(ApexParser.java:53)
at net.sourceforge.pmd.lang.apex.ApexParser.parse(ApexParser.java:37)
at net.sourceforge.pmd.SourceCodeProcessor.parse(SourceCodeProcessor.java:113)
at net.sourceforge.pmd.SourceCodeProcessor.processSource(SourceCodeProcessor.java:175)
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:97)
at net.sourceforge.pmd.SourceCodeProcessor.processSourceCode(SourceCodeProcessor.java:52)
at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:93)
at net.sourceforge.pmd.processor.PmdRunnable.call(PmdRunnable.java:27)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: shaded.org.objectweb.asm.Handle
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 23 more
Running PMD through: CLI
Activity
jsotuyod commentedon Sep 14, 2017
@adangel this seems to have been introduced by the apex jorje update. They are not shipping an embedded jackson / ASM anymore. We should either add the dependencies ourselves, or check if the ones we use are now supported and we can simply stop shading them.
mnunezdm commentedon Oct 16, 2017
any workaround for this issue? thanks!
rsoesemann commentedon Oct 16, 2017
@jsotuyod should I created an issue in the Salesforce repo and what should I ask for exately? I'm not sure that I get what is going wrong here.
adangel commentedon Oct 16, 2017
@jsotuyod You're right - the new apex jorje is not an uber-jar anymore.
@up2go-rsoesemann What we would need, is the dependency list of the apex-jorje modules - since we took only the jar files, there is no dependency information... The only reference we have, is this: https://github.com/forcedotcom/idecore/tree/master/com.salesforce.ide.apex.core/lib
However, it seems to be working just fine without the shading....
[apex] Remove shading for the apex modules - not needed anymore
Update release notes, refs pmd#605
adangel commentedon Oct 16, 2017
It's a regression of #489
rsoesemann commentedon Oct 17, 2017
I asked Salesforce for a dependency list here https://github.com/forcedotcom/idecore/issues/233
Remove maven-shade-plugin from <pluginManagement>