Skip to content

[apex] java.lang.NoClassDefFoundError in the latest build #605

Closed

Description

@touzoku

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

  1. added this to the 6.0.0 milestone on Sep 14, 2017
  2. added
    a:bug
    on Sep 14, 2017
  3. self-assigned this
    on Sep 14, 2017
  4. jsotuyod commented on Sep 14, 2017

    @jsotuyod
    Member

    @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.

  5. removed their assignment
    on Oct 9, 2017
  6. mnunezdm commented on Oct 16, 2017

    @mnunezdm

    any workaround for this issue? thanks!

  7. rsoesemann commented on Oct 16, 2017

    @rsoesemann
    Member

    @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.

  8. adangel commented on Oct 16, 2017

    @adangel
    Member

    @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....

  9. added 2 commits that reference this issue on Oct 16, 2017
    ffcf5cb
    2b60eca
  10. self-assigned this
    on Oct 16, 2017
  11. adangel commented on Oct 16, 2017

    @adangel
    Member

    It's a regression of #489

  12. rsoesemann commented on Oct 17, 2017

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

Metadata

Metadata

Assignees

Labels

a:bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions