NoClassDef found for PicoContainer with LightFixtureTestCase

Hello,

I am trying to write a test case for my project with the following library setup:

picocontainer.jar <--depends on-- |core module|  <--depends on-- |my plugin module|


with the IDEA SDK picocontainer.jar disabled. We use a different version and I have to use the one from the core module for compatibility. This worked fine until I tried to write a test case:

public class CreateProjectTaskTest extends LightCodeInsightFixtureTestCase {

    @Test
    public void testRun() throws Exception {

    }
}


and I get a

java.lang.NoClassDefFoundError: org/picocontainer/alternatives/AbstractDelegatingMutablePicoContainer


when trying to execute that test. I already tried to add picocontainer separately to the plugin module dependencies, but that does not help.

I would be very glad about every pointer to my mistake :-)

Regards,
Holger

1 comment
Comment actions Permalink

Found the issue: While there is an

org/picocontainer/alternatives/AbstractDelegatingMutablePicoContainer


in my picocontainer.jar, it resides in another package (containers), because we use a newer version.

My guess for the problem: When running the plugin, IntelliJ loads both picocontainer.jars, one for IntelliJ, one for the plugin and each can have their version. When running the test, both are loaded from the same class loader and so only one can be loaded, leading to these problems.

Is there any way I can configure IntelliJ to use both in the test?



Attachment(s):
intellij_plugin_dependencies.png
intellij_core_module.png
0

Please sign in to leave a comment.