Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes



7 answers

Permanent link
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.

0 votes


Permanent link
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

0 votes


Permanent link
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.

0 votes


Permanent link
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

0 votes


Permanent link
Did you create a JUnit launch configuration or a JUnit Plug-in Test one? It sounds like you're using the former, otherwise it would complain about missing prerequisites before it actually launched, rather than failing with NoClassDefFoundError.

0 votes


Permanent link
Hey,we kind of got a same problem,did you finish it yet??
could you give me your solution?
the exception always open: Platform hasn't been started yet

0 votes


Permanent link
Where do you see that exception? Are you using the Ant tasks or calling the client API programmatically? Do you have the full stack trace?

The error indicates that TeamPlatform.startup() is not being called, but our Ant tasks should do that very early on in their lifecycle.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Jun 11 '10, 1:20 p.m.

Question was seen: 9,852 times

Last updated: Jun 11 '10, 1:20 p.m.

Confirmation Cancel Confirm