Issue while - Cucumber test suite run through ant script

362 views
Skip to first unread message

Pradip Kumar Pathy

unread,
Jul 1, 2013, 4:51:02 PM7/1/13
to cu...@googlegroups.com

Any pointer ???

Environment details:
Windows 7(64 bit), Weblogicserver(10.3.6), Jdeveloper (11.1.2.4), Ant 1.9.1, JDK1.7.0_25

JAR:- cucumber-core-1.1.3.jar, cucumber-html-0.2.2.jar, cucumber-java-1.1.3.jar cucumber-junit-1.1.3.jar, gherkin-2.11.5.jar, gherkin-jvm-deps-1.0.2.jar, hamcrest-core-1.3.jar, junit-4.11.jar

My test suite contains:
Feature file, 
The Cucumber Runner class, 
The step defiinition class - That makes look-up and call to EJB bean methods
Essentially I am writing a BDD suite just to test an EJB bean method(s).

Issue: I am able to run the feature files from JDevloper IDE generates the Report.
However, When I tried to run the same from ant script, getting a strange error.
While running the scripts through ant, I tried both ways - Run with the Junit task and run with command line task - cli.main
Either case getting the eroor

"


[java] java.lang.NoClassDefFoundError: com/jenkov/tags/tree/itf/ITree
[java] at java.lang.Class.getDeclaredMethods0(Native Method)
[java] at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
[java] at java.lang.Class.privateGetPublicMethods(Class.java:2641)
[java] at java.lang.Class.getMethods(Class.java:1457)
[java] at weblogic.rmi.utils.Utilities.getRemoteMethodsAndSignatures(Utilities.java:364)
[java] at weblogic.rmi.internal.StubGenerator.(StubGenerator.java:115)
[java] at weblogic.rmi.internal.StubGenerator.(StubGenerator.java:85)
[java] at weblogic.rmi.internal.StubGenerator.hotCodeGenClass(StubGenerator.java:782)
[java] at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:766)
[java] at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:793)
[java] at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:786)
[java] at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:74)
[java] at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:254)
[java] at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:199)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:606)
[java] at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1104)
[java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1805)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
[java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
[java] at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
[java] at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:599)
[java] at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:204)
[java] at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
[java] at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:243)
[java] at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
[java] at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
[java] at com.sophoi.ipls2.dealsRightsIn.ejb.session.DealsRightsInService_6k2jla_HomeImpl_1036_WLStub.create(Unknown Source)
[java] at com.oracle.ipm.common.servicesfactory.ServiceFactory.createDealsRightsInService(Unknown Source)
[java] at com.oracle.ipm.stepdef.dri.SaveDealFeatureStepDef.saveDealsDetails(Unknown Source)
[java] at ?.When Project details are saved(src\com\oracle\ipm\feature\dri\SaveDeal.feature:7)
[java] Caused by: java.lang.ClassNotFoundException: com.jenkov.tags.tree.itf.ITree
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] at java.lang.Class.getDeclaredMethods0(Native Method)
[java] at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
[java] at java.lang.Class.privateGetPublicMethods(Class.java:2641)
[java] at java.lang.Class.getMethods(Class.java:1457)
[java] at weblogic.rmi.utils.Utilities.getRemoteMethodsAndSignatures(Utilities.java:364)
[java] at weblogic.rmi.internal.StubGenerator.(StubGenerator.java:115)
[java] at weblogic.rmi.internal.StubGenerator.(StubGenerator.java:85)
[java] at weblogic.rmi.internal.StubGenerator.hotCodeGenClass(StubGenerator.java:782)
[java] at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:766)
[java] at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:793)
[java] at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:786)
[java] at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:74)
[java] at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:254)
[java] at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:199)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:606)
[java] at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1104)
[java] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1805)
[java] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
[java] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
[java] at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)
[java] at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:599)
[java] at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:204)
[java] at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)
[java] at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:243)
[java] at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
[java] at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
[java] at com.sophoi.ipls2.dealsRightsIn.ejb.session.DealsRightsInService_6k2jla_HomeImpl_1036_WLStub.create(Unknown Source)
[java] at com.oracle.ipm.common.servicesfactory.ServiceFactory.createDealsRightsInService(Unknown Source)
[java] at com.oracle.ipm.stepdef.dri.SaveDealFeatureStepDef.saveDealsDetails(Unknown Source)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:606)
[java] at cucumber.runtime.Utils$1.call(Utils.java:44)
[java] at cucumber.runtime.Timeout.timeout(Timeout.java:12)
[java] at cucumber.runtime.Utils.invoke(Utils.java:40)
[java] at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:35)
[java] at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:38)
[java] at cucumber.runtime.Runtime.runStep(Runtime.java:270)
[java] at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:49)
[java] at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:43)
[java] at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:36)
[java] at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:112)
[java] at cucumber.runtime.Runtime.run(Runtime.java:105)
[java] at cucumber.runtime.Runtime.run(Runtime.java:93)
[java] at cucumber.api.cli.Main.run(Main.java:20)
[java] at cucumber.api.cli.Main.main(Main.java:12)
[java]


"

George Dinwiddie

unread,
Jul 1, 2013, 5:17:32 PM7/1/13
to cu...@googlegroups.com
Pradip,

On 7/1/13 4:51 PM, Pradip Kumar Pathy wrote:
> Any pointer ???
>
> Environment details:
> Windows 7(64 bit), Weblogicserver(10.3.6), Jdeveloper (11.1.2.4), Ant
> 1.9.1, JDK1.7.0_25
>
> JAR:- cucumber-core-1.1.3.jar, cucumber-html-0.2.2.jar,
> cucumber-java-1.1.3.jar cucumber-junit-1.1.3.jar, gherkin-2.11.5.jar,
> gherkin-jvm-deps-1.0.2.jar, hamcrest-core-1.3.jar, junit-4.11.jar

What about your application jars?

>
> My test suite contains:
> Feature file,
> The Cucumber Runner class,
> The step defiinition class - That makes look-up and call to EJB bean methods
> Essentially I am writing a BDD suite just to test an EJB bean method(s).
>
> Issue: I am able to run the feature files from JDevloper IDE generates
> the Report.
> However, When I tried to run the same from ant script, getting a strange
> error.
> While running the scripts through ant, I tried both ways - Run with the
> Junit task and run with command line task - cli.main
> Either case getting the eroor
>
> "
>
> ------------------------------------------------------------------------
>
> [java] java.lang.NoClassDefFoundError: com/jenkov/tags/tree/itf/ITree

This tells you that you don't have all the necessary jars on the
classpath when running with ant.

[rest of stacktrace snipped]

- George


--
Want to speak at AgileDC October 8, 2013? http://agiledc.org/speak/
----------------------------------------------------------------------
* George Dinwiddie * http://blog.gdinwiddie.com
Software Development http://www.idiacomputing.com
Consultant and Coach http://www.agilemaryland.org
----------------------------------------------------------------------

Pradip Kumar Pathy

unread,
Jul 6, 2013, 9:03:09 AM7/6/13
to cu...@googlegroups.com
The previous jenkov issue was bcoz of a missing jar file . which got resolved after i added that to classpath.  However the json report generation fails if i used the 1.1.3 version jar files, json formater, and the feature/stepdefs use hooks. If I use the 1.1.2 version it works fine.   Any idea: if there is some issue with 1.1.3 json formatter - wrt- @before hooks  Or i am using some incompatible jar file ?

Environment details:
Windows 7(64 bit), Weblogicserver(10.3.6), Jdeveloper (11.1.2.4), Ant 1.9.1, JDK1.7.0_25

Problematic JAR:- cucumber-core-1.1.3.jar, cucumber-html-0.2.2.jar, cucumber-java-1.1.3.jar cucumber-junit-1.1.3.jar,  hamcrest-core-1.3.jar, junit-4.11.jar

Jar that works: 1.1.2 jars, and the hamcrest 1.3 and 4.11 junit

Error Detail with 1.1.3:

<error message="-1" type="java.lang.ArrayIndexOutOfBoundsException">java.lang.ArrayIndexOutOfBoundsException: -1
    at java.util.ArrayList.elementData(ArrayList.java:371)
    at java.util.ArrayList.get(ArrayList.java:384)
    at gherkin.formatter.JSONFormatter.getFeatureElement(JSONFormatter.java:199)
    at gherkin.formatter.JSONFormatter.addHook(JSONFormatter.java:156)
    at gherkin.formatter.JSONFormatter.before(JSONFormatter.java:147)
    at cucumber.runtime.Utils$1.call(Utils.java:44)
    at cucumber.runtime.Timeout.timeout(Timeout.java:12)
    at cucumber.runtime.Utils.invoke(Utils.java:40)
    at cucumber.runtime.RuntimeOptions$2.invoke(RuntimeOptions.java:138)
    at com.sun.proxy.$Proxy11.before(Unknown Source)
    at cucumber.runtime.junit.JUnitReporter.before(JUnitReporter.java:129)
    at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:208)
    at cucumber.runtime.Runtime.runHooks(Runtime.java:185)
    at cucumber.runtime.Runtime.runBeforeHooks(Runtime.java:175)
    at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:32)
    at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:83)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
    at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
    at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:77)
    at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
    at cucumber.api.junit.Cucumber.run(Cucumber.java:82)
</error>

Björn Rasmusson

unread,
Jul 6, 2013, 9:27:52 AM7/6/13
to cu...@googlegroups.com
Pradip Kumar Pathy wrote:
The previous jenkov issue was bcoz of a missing jar file . which got resolved after i added that to classpath.  However the json report generation fails if i used the 1.1.3 version jar files, json formater, and the feature/stepdefs use hooks. If I use the 1.1.2 version it works fine.   Any idea: if there is some issue with 1.1.3 json formatter - wrt- @before hooks  Or i am using some incompatible jar file ?

Yes, there is an issue that the JSON formatter throws an ArrayOutOfBoundsException when before hooks are used in Cucumber-JVM 1.1.3:
https://github.com/cucumber/gherkin/pull/239

A fix has been merged in the underlying gehrkin library, so the problem will be solved in the next version of Cucumber-JVM.

Regards
Björn
Reply all
Reply to author
Forward
0 new messages