Troubleshooting

Runtime



What should I do if I encounter "java.lang.SecurityException: class "junit.extensions.TestDecorator"'s..." error when trying to run my test?

java.lang.SecurityException: class "junit.extensions.TestDecorator"'s 
signer information does not match signer information of other classes in the same package
at java.lang.ClassLoader.checkCerts(Unknown Source)
at java.lang.ClassLoader.preDefineClass(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestLoader.loadTests(JUnit3TestLoader.java:61)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
You need to add the junit jar to the Classpath of your test launch configuration and make sure to move it up to be the first entry within the Bootstrap Entries. To open your launch configuration, select Run > Open Run Dialog. Select your JUnit test on the left navigation. In your Classpath tab, add the JUnit jar to be the first entry under Bootstrap Entries as shown in the screen shot below.

What should I do if I encounter "java.lang.NoClassDefFoundError: com/instantiations/eclipse/debug/Tracer" error when trying to run my test?

java.lang.NoClassDefFoundError: com/instantiations/eclipse/debug/Tracer
at com.windowtester.swt.monitor.UIThreadMonitor.trace(UIThreadMonitor.java:444)
at com.windowtester.swt.monitor.UIThreadMonitor.setListener(UIThreadMonitor.java:153)
at junit.extensions.UITestCase.startTestMonitor(UITestCase.java:686)
at junit.extensions.UITestCase.runBare(UITestCase.java:493)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Your recorded test class is either placed in the same project as your SWT application or within a non-plugin project.

To fix this, add debug.jar and commonCore.jar to your project's build path. These jars are located in your WindowTester or RCP Developer "Shared" installation directory. Example: (C:\Program Files\Instantiations\Shared_v4.5.0).

What should I do if I encounter "java.lang.UnsatisfiedLinkError" or "java.lang.NoClassDefFoundError" when trying to run my test?

java.lang.UnsatisfiedLinkError: no swt-win32-3232 in java.library.path

OR

java.lang.NoClassDefFoundError
at com.windowtester.swt.display.DisplayIntrospection.visit(DisplayIntrospection.java:134)
at com.windowtester.swt.display.DisplayIntrospection.findDisplay(DisplayIntrospection.java:114)
at com.windowtester.swt.display.DisplayIntrospection.doRun(DisplayIntrospection.java:73)
at com.windowtester.swt.display.DisplayIntrospection.syncIntrospect(DisplayIntrospection.java:158)
at junit.extensions.UITestCase.launchApp(UITestCase.java:232)
at junit.extensions.UITestCase.launchApp(UITestCase.java:201)
at junit.extensions.UITestCase.runBare(UITestCase.java:487)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
It's not finding the swt-xxx.dll. There are several ways to fix this but the simplest is to copy the file to your windows\system32 directory.

Alternately, you can extract (unzip) the *.dll files from your SWT plug-in jar file (e.g. ECLIPSE_HOME\plugins\org.eclipse.swt.win32.win32.x86_3.2.2.v3236.jar) into a standard eclipse location (e.g. ECLIPSE_HOME\plugins\swt-libs) and then include that location in your java.library.path (see screen shot below).


What should I do if I encounter "org.eclipse.swt.SWTException: Device is disposed" after my test ran?

org.eclipse.swt.SWTException: Device is disposed
at org.eclipse.swt.SWT.error(SWT.java:3374)
at org.eclipse.swt.SWT.error(SWT.java:3297)
at org.eclipse.swt.SWT.error(SWT.java:3268)
at org.eclipse.swt.widgets.Display.error(Display.java:978)
at org.eclipse.swt.widgets.Display.syncExec(Display.java:3762)
at com.windowtester.swt.monitor.UIThreadMonitor.removeEventListeners(UIThreadMonitor.java:221)
at com.windowtester.swt.monitor.UIThreadMonitor.setListener(UIThreadMonitor.java:162)
at junit.extensions.UITestCase.stopTestMonitor(UITestCase.java:693)
at junit.extensions.UITestCase.runBare(UITestCase.java:501)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:228)
at junit.framework.TestSuite.run(TestSuite.java:223)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
The SWT application and the Test platform are racing to close the shell. To fix this, comment out this line in your test class,

ui.close("shell");

What should I do if I encounter "java.lang.reflect.InvocationTargetException" when trying to playback my test?

java.lang.reflect.InvocationTargetException
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:585)
at junit.extensions.core.launcher.LauncherFactory$2.run(LauncherFactory.java:146)
at junit.extensions.core.launcher.LauncherFactory$1.run(LauncherFactory.java:114)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NoClassDefFoundError
at com.demo.AddressBookUI.main(AddressBookUI.java:27)
In the launch configuration for the test, go the the Arguments tab and add the following in the VM Arguments:

-Djava.library.path=dir containing the swt dlls for your eclipse installation