SecurityException is triggered by the following test, which previously succeeded.

 

With the following code:

 

package test;
import org.junit.Test;
import org.knime.core.node.Node;
import org.knime.core.node.NodeFactory;

public class Tests {
 @Test
 public void test() {
  NodeFactory nf = new TESTNodeFactory();
  Node n = new Node(nf);
 }
}

 

A SecurityException is raised. As of KNIME 2.3.4, this code worked. Can a KNIME developer please explain what the cause of this is?

 

Thanks. Full trace below.

 

class "org.knime.core.node.InvalidSettingsException"'s signer information does not match signer information of other classes in the same package

java.lang.SecurityException: class "org.knime.core.node.InvalidSettingsException"'s signer information does not match signer information of other classes in the same package

at java.lang.ClassLoader.checkCerts(ClassLoader.java:806)

at java.lang.ClassLoader.preDefineClass(ClassLoader.java:487)

at java.lang.ClassLoader.defineClassCond(ClassLoader.java:625)

at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

at test.Tests.test(Tests.java:13)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

How do you start your test? Within the Eclipse framework or with pure Java?

Within the Eclipse framework. I've been using the "KNIME Developer Edition". I'm using 2.4.1 as of this writing.

Yes, but are you sure your JUnit tests are also run inside an Eclipse instance (e.g. by executing a "JUnit plugin test" or by using the antRunner-application)? This error occurs if you try to run testcases outside the Eclipse framework. This is not supported (and obviously does not work) since KNIME relies on Eclipse and the plugin concept. The error occurs because org.knime.core.util is a jar file and is signed as a whole whereas org.knime.core is a directory with several jars files and here the directory is signed but not the individual jars. If you run outside Eclipse the standard Java ClassLoader sees a signed and an unsigned jar with the same packages ands throws the above error.