Anyone?

I didn’t expect to have to require a plugin-first classloader unless the 
conflicting library was in core?
Is my use pf persisting 3rd party classes via xStream broken by design (can we 
only persist internal to the plugin classes?)

Is this just a case of requiring shading of the cucumber classes (in which case 
anyideas how to do this so that old builds don’t break?)

/James

From: jenkinsci-dev@googlegroups.com [mailto:jenkinsci-dev@googlegroups.com] On 
Behalf Of Peter Hayes
Sent: 21 January 2014 16:02
To: jenkinsci-dev@googlegroups.com
Subject: Probable class loading issue / conflict between plugins

Hi,

I am writing a custom plugin to publish cucumber test results to a quality 
center database for internal reporting needs.  To do so, I am using the 
cucumber-jvm gherkin library to process the test result file as was done in the 
cucumber-testresult-plugin.  My code is working fine and processing the results 
but when I also installed the cucumber-testresult-plugin on my Jenkins instance 
and used that, I am seeing this error message when trying to display the test 
results:

Status Code: 500
Exception:
Stacktrace:

java.lang.ClassCastException: gherkin.formatter.model.Tag cannot be cast to 
gherkin.formatter.model.Tag

       at 
org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResult.tally(CucumberTestResult.java:273)

       at 
org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultAction.load(CucumberTestResultAction.java:119)

       at 
org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultAction.getResult(CucumberTestResultAction.java:147)

       at 
org.jenkinsci.plugins.cucumber.jsontestsupport.CucumberTestResultAction.getTarget(CucumberTestResultAction.java:174)

       at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:610)

       at org.kohsuke.stapler.Stapler.invoke(Stapler.java:776)

       at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:381)

       at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:683)

       at org.kohsuke.stapler.Stapler.invoke(Stapler.java:776)



I believe this can happen when there are classloader consistency issues.



I looked at the code for the cucumber-testresult-plugin and it is using the 
XStream2[1] class to load the serialized test results from the disk (in the 
load method above)[2] and then when it goes to process those results in the 
tally method[3], it blows up.  Is there a potential issue in the way the 
XStream2 class is handling the classloading?  I am running this on Jenkins 1.520



Thanks,

Peter



[1] 
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/util/XStream2.java

[2] 
https://github.com/jenkinsci/cucumber-testresult-plugin/blob/master/src/main/java/org/jenkinsci/plugins/cucumber/jsontestsupport/CucumberTestResultAction.java#L111

[3] 
https://github.com/jenkinsci/cucumber-testresult-plugin/blob/master/src/main/java/org/jenkinsci/plugins/cucumber/jsontestsupport/CucumberTestResult.java#L221
--
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
jenkinsci-dev+unsubscr...@googlegroups.com<mailto:jenkinsci-dev+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to