cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@verizon.net>
Subject Re: AbstractCXFTest - NoClassDefFoundError javax.xml.stream.XMLStreamWriter
Date Sat, 25 Aug 2007 09:14:32 GMT
It looks like your code is not detecting the StAX library.  

I tend to run Java classes using Ant, because it is easier to declare my
classpath that way.  You may wish to take a look at [1] below, in
particular the "cxf.classpath" path and "run" target under point (5) and
do something similar to that.  (If you do this make sure you use
"fork=yes" for the <java/> command under "run", to get the JDK's XML
libraries in.)

HTH,
Glen

[1] http://www.jroller.com/gmazza/entry/using_amazon_web_services_with


Am Freitag, den 24.08.2007, 14:37 +0200 schrieb Henning Jensen:
> Hi!
> 
> I'm trying to use CXF for testing my web services. I have created a
> simple class that uses org.apache.cxf.test.AbstractCXFTest and invokes
> one of my web services with a predefined xml file. However when
> running the test i get a NoClassDefFoundError thrown in my face.
> Anyone had the same issue?
> 
> java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamWriter
> 	at org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialExtensions(WSDLManagerImpl.java:223)
> 	at org.apache.cxf.wsdl11.WSDLManagerImpl.<init>(WSDLManagerImpl.java:97)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
> 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
> 	at java.lang.Class.newInstance0(Unknown Source)
> 	at java.lang.Class.newInstance(Unknown Source)
> 	at org.apache.cxf.bus.extension.Extension.load(Extension.java:86)
> 	at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:136)
> 	at org.apache.cxf.bus.extension.ExtensionManagerImpl.processExtension(ExtensionManagerImpl.java:111)
> 	at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadFragment(ExtensionManagerImpl.java:104)
> 	at org.apache.cxf.bus.extension.ExtensionManagerImpl.load(ExtensionManagerImpl.java:96)
> 	at org.apache.cxf.bus.extension.ExtensionManagerImpl.<init>(ExtensionManagerImpl.java:72)
> 	at org.apache.cxf.bus.extension.ExtensionManagerBus.<init>(ExtensionManagerBus.java:88)
> 	at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:40)
> 	at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:36)
> 	at org.apache.cxf.bus.CXFBusFactory.createBus(CXFBusFactory.java:32)
> 	at org.apache.cxf.test.AbstractCXFTest.createBus(AbstractCXFTest.java:107)
> 	at org.apache.cxf.test.AbstractCXFTest.setUpBus(AbstractCXFTest.java:80)
> 	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 org.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:122)
> 	at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:86)
> 	at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)
> 	at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)
> 	at org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)
> 	at org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
> 	at org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
> 	at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
> 	at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
> 	at org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
> 	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)
> 
> 
> My test class:
> 
> package mypackage;
> 
> import org.apache.cxf.binding.http.HttpBindingFactory;
> import org.apache.cxf.test.AbstractCXFTest;
> import org.junit.Test;
> 
> public class WSTest extends AbstractCXFTest {
> 
> 	@Test
> 	public void testMyService() throws Exception {
> 		String transport = "http://schemas.xmlsoap.org/soap/http";
> 		String address = "http://localhost:8080/axis/services/MyService";
> 		invoke(address,	HttpBindingFactory.HTTP_BINDING_ID, "myrequest.xml");
> 	}
> }
> 


Mime
View raw message