Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » NoClassDefFoundError using Eclipse/JUnit
NoClassDefFoundError using Eclipse/JUnit [message #325007] Tue, 05 February 2008 13:23 Go to next message
Eclipse UserFriend
cross-posted to JBossWS forum:

hello, I'm accessing a WS running on JBoss 4.2.2 using JBossWS 2.0.3

I've generated the service artifacts using wsconsume and I'm getting a
NoClassDefFoundError running the client code as a JUnit or Java app.

The same test runs OK from the command line using wsrunclient, or at least
when copying the generated cmd line string into a cmd prompt, and it works
when running the test during the Maven build lifecycle.

I would like to be able to run the tests in the Eclipse WTP 2.0 workbench.
Any help would be appreciated. The test is just a basic HelloWorld, and
the stacktrace is:

java.lang.NoClassDefFoundError:
com/sun/xml/messaging/saaj/soap/AttachmentPartImpl
at
com.sun.xml.ws.message.AttachmentUnmarshallerImpl.(Attachmen tUnmarshallerImpl.java:55)
at
com.sun.xml.ws.client.sei.ResponseBuilder$DocLit.readRespons e(ResponseBuilder.java:500)
at
com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMetho dHandler.java:242)
at
com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMetho dHandler.java:210)
at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
at $Proxy25.findAll(Unknown Source)
at org.MyTest.test(MyTest.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
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.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
Caused by: java.lang.ClassNotFoundException:
com.sun.xml.messaging.saaj.soap.AttachmentPartImpl
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)
... 25 more

A bit of additional information, the classpath for the JUnit run
configuration are set the same as the command line classpath.

TIA, if anyone is able to help with this problem!
SOLUTION: NoClassDefFoundError using Eclipse/JUnit [message #325052 is a reply to message #325007] Wed, 06 February 2008 22:49 Go to previous message
Eclipse UserFriend
Problem: wsclientrun sets the classpath in the command line and runs OK.
Run/Debug/Junit threw NoClassDefFoundError with the stacktrace in the
previous post. The classpath was set on the classpath tab.

Solution: use the same command line arguments as wsclientrun in the JVM
arguments field of the arguments tab to set the classpath.

Note: it was necessary to copy the output of wsclientrun and make some
changes to the classpath argument, to include bin;output which are the
class folders for the test class and the wsconsume generated classes.

Run/Debug/Junit all run without errors!
Previous Topic:Language pack for eclipse 3.3 or higher
Next Topic:transparant toolbar images in form section
Goto Forum:
  


Current Time: Tue Jul 22 09:07:57 EDT 2025

Powered by FUDForum. Page generated in 0.24740 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top