I have been trying to get a REST service up and running. I believe the
server is up. However, creating the client is problematic. Using the
following code borrowed from the bundled rest sample:
JaxWsProxyFactoryBean sf = new JaxWsProxyFactoryBean();
sf.setServiceClass(MyServiceInterface.class);
// Turn off wrapped mode to make our xml prettier
sf.getServiceFactory().setWrapped(false);
// Use the HTTP Binding which understands the Java Rest Annotations
sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
sf.setAddress("http://localhost:8080/rest/");
this.service = (MyServiceInterface) sf.create();
I receive the following exception:
java.lang.AbstractMethodError:
org.apache.xerces.dom.DocumentImpl.getInputEncoding()Ljava/lang/String;
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:597)
at
org.apache.ws.commons.schema.utils.DOMUtil.getInputEncoding(DOMUtil.java:594)
at
org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:348)
at
org.apache.cxf.databinding.source.AbstractDataBinding.addSchemaDocument(AbstractDataBinding.java:73)
at
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:224)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:293)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:333)
at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:151)
at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:93)
at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:74)
at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89)
at com.foo.bar.RestTest.injectDependencies(RestTest.java:30)
at
org.springframework.test.AbstractDependencyInjectionSpringContextTests.prepareTestInstance(AbstractDependencyInjectionSpringContextTests.java:158)
at
org.springframework.test.AbstractSingleSpringContextTests.setUp(AbstractSingleSpringContextTests.java:88)
at junit.framework.TestCase.runBare(TestCase.java:125)
at
org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69)
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: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)
I read a post regarding a similar error due to the XmlSchema version.
However, after checking, I do have the 1.3.2 version specified in that
post (http://www.nabble.com/wsdl2java-problem-tf4651922.html#a13290874).
Anyone have any other ideas?
Thanks.