CucumberJVM and IDEA IU SDK

Hi all,

Recently I have been trying to get CucumberJVM working for testing my plugin. I was pointed in the direction of git4idea, which also uses CucumberJVM - perfect!

However I have noticed that when I attempt to run a simple set of tests wtihin IntelliJ using the project SDK "IDEA IU-129.713 (java version '1.7.0_25')" this error occurrs

Exception in thread "main" java.lang.NoSuchMethodError: org.picocontainer.ComponentMonitor.newBehavior(Lorg/picocontainer/Behavior;)Lorg/picocontainer/Behavior;
        at org
.picocontainer.behaviors.Caching.addComponentAdapter(Caching.java:64)
        at org
.picocontainer.DefaultPicoContainer.addAdapter(DefaultPicoContainer.java:459)
        at org
.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:556)
        at org
.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:518)
        at org
.picocontainer.PicoBuilder.build(PicoBuilder.java:168)
        at cucumber
.runtime.java.picocontainer.PicoFactory.start(PicoFactory.java:16)
        at cucumber
.runtime.java.JavaBackend.buildWorld(JavaBackend.java:76)
        at cucumber
.runtime.Runtime.buildBackendWorlds(Runtime.java:115)
        at cucumber
.runtime.model.CucumberScenario.run(CucumberScenario.java:31)
        at cucumber
.runtime.model.CucumberFeature.run(CucumberFeature.java:112)
        at cucumber
.runtime.Runtime.run(Runtime.java:105)
        at cucumber
.runtime.Runtime.run(Runtime.java:93)
        at cucumber
.api.cli.Main.run(Main.java:20)
        at cucumber
.api.cli.Main.main(Main.java:12)
        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:606)
        at com
.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Process finished with exit code 1


However if I change to use the project SDK to "1.7 (java version '1.7.0_25')" then this problem does not occurr.

Does anyone happen to know why choosing the Idea SDK causes this issue to happen :)

I have also raised a youtrack for this http://youtrack.jetbrains.com/issue/IDEA-109344 - Would love to hear if there's any workarounds, or if i'm doing something wrong

Cheers
Alan

3 comments

I have also tried to align the version numbers in my pom file with IntelliJ's cucumberJVM and picocontainer version, which at the time of writing is 1.0.14 and 1.2 respectively.
Unfortunately this issue still occurred.

Alan

0

Thankfully Yann has been able to shed some light on this exception; It is caused by a classloader issue. The IntelliJ SDK provides an older version of Picocontainer to a plugin's classpath, which causes issues down the line with CucumberJVM which relies on a newer version.

I have gotten around this problem by not relying on Picocontainer's Dependency Injection, but instead accessing the required dependencies statically - which isn't ideal.

Unfortunately after getting past this issue I am running into the error described here http://devnet.jetbrains.com/message/5490507#5490507
I have attached an example project which reproduces this issue :)

Cheers



Attachment(s):
untitled.zip
0

Hey all,

I''m still having no luck with getting this to work;
Would greatly appreciate any directions in getting this up and running :)

Cheers

0

Please sign in to leave a comment.