Q: java.lang.SecurityException: class "org.jenkinsci.remoting.CallableDecorator" error when using @LocalData

22 views
Skip to first unread message

Victor Martinez

unread,
Aug 23, 2017, 4:43:44 PM8/23/17
to Jenkins Developers
Hi there,

I've just started to use the LocalData annotation and I've found the below stacktrace:

java.lang.SecurityException: class "org.jenkinsci.remoting.CallableDecorator"'s signer information does not match signer information of other classes in the same package


What did i do?

1) Added a testcase
@LocalData
@Issue("JENKINS-46383")
@Test public void testDoubleQuotesAssignedLabel() throws Exception {
   
assertFalse(checker.executeCheck(j.getInstance().getItem("doublequote")));
}

2) Created a test resource with the job config file and global config.xml file too

I've seen https://issues.jenkins-ci.org/browse/JENKINS-25625 but no idea whether it is related, although I tried with the latest version 2.71 but same error.

Is this a genuine error? If so what kind of details I should report in Jira?

Thanks

Victor Martinez

unread,
Aug 24, 2017, 7:33:22 AM8/24/17
to Jenkins Developers
More details about how I configured it to run the LocalData:

package org.jenkins.ci.plugins.jenkinslint.check;

import hudson.model.TopLevelItem;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.recipes.LocalData;

/**
* NPE Test Case.
*
* @author Victor Martinez
*/
public class NPETestCase {
@Rule
public JenkinsRule j = new JenkinsRule();

@Issue("JENKINS-46424")
@LocalData
@Test public void testNPE() throws Exception {
TopLevelItem item = j.getInstance().getItem("test_multi_stage");
}
}


Then:

src/test
|____java
| |____org
| | |____jenkins
| | | |____ci
| | | | |____plugins
| | | | | |____jenkinslint
| | | | | | |____check
| | | | | | | |____NPETestCase.java
|____resources
| |____org
| | |____jenkins
| | | |____ci
| | | | |____plugins
| | | | | |____jenkinslint
| | | | | | |____check
| | | | | | | |____NPETestCase
| | | | | | | | |____testNPE
| | | | | | | | | |____config.xml
| | | | | | | | | |____jobs
| | | | | | | | | | |____test_multi_stage
| | | | | | | | | | | |____config.xml


Stacktrace

java.lang.SecurityException: class "org.jenkinsci.remoting.CallableDecorator"'s signer information does not match signer information of other classes in the same package

at java.lang.ClassLoader.checkCerts(ClassLoader.java:898)
at java.lang.ClassLoader.preDefineClass(ClassLoader.java:668)
at java.lang.ClassLoader.defineClass(ClassLoader.java:761)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at jenkins.FilePathFilter.current(FilePathFilter.java:108)
at hudson.FilePath.reading(FilePath.java:2796)
at hudson.FilePath.access$000(FilePath.java:191)
at hudson.FilePath$42.invoke(FilePath.java:2133)
at hudson.FilePath$42.invoke(FilePath.java:2126)
at hudson.FilePath.act(FilePath.java:989)
at hudson.FilePath.act(FilePath.java:967)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2126)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2112)
at hudson.FilePath.copyRecursiveTo(FilePath.java:2095)
at org.jvnet.hudson.test.HudsonHomeLoader$CopyExisting.allocate(HudsonHomeLoader.java:87)
at org.jvnet.hudson.test.HudsonHomeLoader$Local.allocate(HudsonHomeLoader.java:123)
at org.jvnet.hudson.test.JenkinsRule.newHudson(JenkinsRule.java:531)
at org.jvnet.hudson.test.JenkinsRule.before(JenkinsRule.java:331)
at org.jvnet.hudson.test.JenkinsRule$2.evaluate(JenkinsRule.java:480)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


Jenkins core version: 1.607
Jenkins TH version: 1.580
Jenkins Pom version: 2.21

But if I use a zip file which contains the jobs folder then it works like a charm. Did I miss anything?

Thanks

Jesse Glick

unread,
Aug 24, 2017, 9:40:52 AM8/24/17
to Jenkins Dev
On Wed, Aug 23, 2017 at 4:43 PM, Victor Martinez
<victormar...@gmail.com> wrote:
> I've seen https://issues.jenkins-ci.org/browse/JENKINS-25625 but no idea
> whether it is related

Very likely. Typically this means that you somehow have
`SECURITY-144-compat` in your test classpath. Perhaps you have a
dependency on an old version of `maven-plugin`. Check

mvn dependency:tree

> I tried with the latest version 2.71 but same error.

Jenkins baseline version is probably irrelevant; the change in 2.71
should have no effect on behavior, it was just internal cleanup.
Reply all
Reply to author
Forward
0 new messages