consume WS error after update to JBossWS 2.0
m.schumpa Jul 12, 2007 7:54 AMHi dear community,
I'm pretty new to the whole JBoss WebService topic and I'm writing a diploma thesis about it. to get startet, I wrote a simple example which consist of a WebService and an Java Client connecting to that Service in order to consume it.
Everything went fine with the JBoss 4.2.0 GA release.
Because I need some of the feature of JAXB 2.0, I upgraded to JBossWS 2.0. I think everything went fine here, because I get the following message in the console while starting JBoss.
[ManagedEndpointRegistry] jbossws-native-2.0.0.GA (build=200707051029)
I added the all the jars in %JBOSS_HOME%\client and %JBOSS_HOME%\lib\endorsed to classpath, like I did it while using the JBoss 4.2.0 GA release.
My problem is:
If I try to reach the service with the following code I get an WebServiceException
URL url = new URL("http://127.0.0.1:8080/BspDog/Examples?wsdl"); QName qname = new QName("http://dogstapler.com/","ExamplesService"); Service service = Service.create(url,qname); ExamplesEndpoint ee = service.getPort(ExamplesEndpoint.class);
The wsdl is reachable at the given location. The first lines of it look like this:
<definitions name='ExamplesService' targetNamespace='http://dogstapler.com/' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://dogstapler.com/' xmlns:xsd='http://www.w3.org/2001/XMLSchema'> <types> <xs:schema targetNamespace='http://dogstapler.com/' version='1.0' xmlns:tns='http://dogstapler.com/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
The error thrown by the client while executing the 3rd line of the sample code:
Exception in thread "main" javax.xml.ws.WebServiceException: Unable to load Provider: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl at javax.xml.ws.spi.Provider.provider(Provider.java:98) at javax.xml.ws.Service.<init>(Service.java:83) at javax.xml.ws.Service.create(Service.java:721) at com.dogstapler.client.ClientBspDog3.main(ClientBspDog3.java:31) Caused by: java.lang.IllegalStateException: Failed to load javax.xml.ws.spi.Provider: com.sun.xml.ws.spi.ProviderImpl at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:96) at javax.xml.ws.spi.Provider.provider(Provider.java:90) ... 3 more Caused by: java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at javax.xml.ws.spi.ProviderLoader.loadProvider(ProviderLoader.java:91) ... 4 more Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference. at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:188) at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:65) ... 11 more Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions Two classes have the same XML type name "address". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Address com.sun.xml.ws.developer.MemberSubmissionEndpointReference.addr at com.sun.xml.ws.developer.MemberSubmissionEndpointReference this problem is related to the following location: at javax.xml.ws.wsaddressing.W3CEndpointReference$Address at private javax.xml.ws.wsaddressing.W3CEndpointReference$Address javax.xml.ws.wsaddressing.W3CEndpointReference.address at javax.xml.ws.wsaddressing.W3CEndpointReference Two classes have the same XML type name "elements". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements at public com.sun.xml.ws.developer.MemberSubmissionEndpointReference$Elements com.sun.xml.ws.developer.MemberSubmissionEndpointReference.referenceProperties at com.sun.xml.ws.developer.MemberSubmissionEndpointReference this problem is related to the following location: at javax.xml.ws.wsaddressing.W3CEndpointReference$Elements at private javax.xml.ws.wsaddressing.W3CEndpointReference$Elements javax.xml.ws.wsaddressing.W3CEndpointReference.referenceParameters at javax.xml.ws.wsaddressing.W3CEndpointReference at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:66) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:270) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:103) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:81) 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:585) at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210) at javax.xml.bind.ContextFinder.find(ContextFinder.java:366) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574) at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522) at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:186) ... 12 more
I'm looking foreward for your replies. Thanks in advance.
M.Schumpa