Problem with JUnit
Hi!
I'm trying to start JUnit's test but the test fails, this is the log:
java.lang.NoClassDefFoundError: org.apache.commons.httpclient.URIException
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:69)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:131)
at com.ibm.team.repository.common.internal.util.InternalTeamPlatform.initializeDebugOptions(InternalTeamPlatform.java:228)
at com.ibm.team.repository.common.internal.util.InternalTeamPlatform.start(InternalTeamPlatform.java:95)
at com.ibm.team.repository.client.TeamPlatform.startup(TeamPlatform.java:48)
at com.example.hellojazz.client.tests.TestHelloJazz.setUp(TestHelloJazz.java:26)
at junit.framework.TestCase.runBare(TestCase.java:128)
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:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
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)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.URIException
at java.net.URLClassLoader.findClass(URLClassLoader.java:496)
at java.lang.ClassLoader.loadClass(ClassLoader.java:631)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
... 20 more
What is the problem??
Thank a lot
Luigi
I'm trying to start JUnit's test but the test fails, this is the log:
java.lang.NoClassDefFoundError: org.apache.commons.httpclient.URIException
at java.lang.J9VMInternals.verifyImpl(Native Method)
at java.lang.J9VMInternals.verify(J9VMInternals.java:69)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:131)
at com.ibm.team.repository.common.internal.util.InternalTeamPlatform.initializeDebugOptions(InternalTeamPlatform.java:228)
at com.ibm.team.repository.common.internal.util.InternalTeamPlatform.start(InternalTeamPlatform.java:95)
at com.ibm.team.repository.client.TeamPlatform.startup(TeamPlatform.java:48)
at com.example.hellojazz.client.tests.TestHelloJazz.setUp(TestHelloJazz.java:26)
at junit.framework.TestCase.runBare(TestCase.java:128)
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:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
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)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.URIException
at java.net.URLClassLoader.findClass(URLClassLoader.java:496)
at java.lang.ClassLoader.loadClass(ClassLoader.java:631)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
... 20 more
What is the problem??
Thank a lot
Luigi
7 answers
Is your program (and test suite) based on the Eclipse runtime (i.e. OSGi) or standalone Java? If the former, try running with Run As > JUnit Plugin Test, which should create a launch config with your plugin and all its prerequisites. If not, use Run As > JUnit Test but you will need to add all prerequisites manually. The missing one here is org.apache.commons.httpclient.
Is your program (and test suite) based on the Eclipse runtime (i.e. OSGi) or standalone Java? If the former, try running with Run As > JUnit Plugin Test, which should create a launch config with your plugin and all its prerequisites. If not, use Run As > JUnit Test but you will need to add all prerequisites manually. The missing one here is org.apache.commons.httpclient.
Hi,
Thanks for the answer! I have OSGi e and I'm testing JUnit with HelloJazz's plugin but i have another problem, i've added the missing org.apache.commons.httpclient to manifest's dipendences and as package to Junit'preferences but now I have a new exception:
java.lang.NoClassDefFoundError: com.ibm.team.repository.transport.auth.TransportAuthUtil
at com.ibm.team.repository.transport.client.RemoteTeamServer.setCredentials(RemoteTeamServer.java:412)
at com.ibm.team.repository.client.internal.TeamRepository.<init>(TeamRepository.java:348)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getTeamRepository(TeamRepositoryService.java:82)
at com.ibm.team.repository.client.internal.TeamRepositoryService.getUnmanagedRepository(TeamRepositoryService.java:119)
at com.example.hellojazz.client.tests.TestHelloJazz.login(TestHelloJazz.java:56)
at com.example.hellojazz.client.tests.TestHelloJazz.setUp(TestHelloJazz.java:28)
at junit.framework.TestCase.runBare(TestCase.java:128)
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:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
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)
Caused by: java.lang.ClassNotFoundException: com.ibm.team.repository.transport.auth.TransportAuthUtil
at java.net.URLClassLoader.findClass(URLClassLoader.java:496)
at java.lang.ClassLoader.loadClass(ClassLoader.java:631)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
... 19 more
I've added com.ibm.team.repository.transport to dipendences but the error remains.... I'm thinking that the problem is in the RCT's configuration but i don't understand what it is....Any ideas?
Luigi
The list of prerequisites can be quite long, and it will be tedious to go through them one by one. Are you following a particular tutorial or example? If so, at which URL? It would be simpler to fix up the doc.
Yes... I'm following this guide:
http://jazz.net/library/article/118
The error is when I must create the test plug-in