[JBossWS] - Unable to load Provider
by burakbayramli
I have problems running the sample Web Service shown in Quick Start document.
I am able to deploy the Web Service, no problem, I see it running at http://localhost:8080/jbossws/services. Then, I generate stubs using wsconsume. I place the generated code to a different package called org.bilgidata.kitapdemo.service.ws.
I am on JBoss 4.2.1.GA and jbossws-2.0.
I used the following code:
import javax.xml.bind.annotation.XmlAccessType;
| import javax.xml.bind.annotation.XmlAccessorType;
| import javax.xml.bind.annotation.XmlType;
|
| import org.bilgidata.kitapdemo.pojo.Car;
|
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(
| name = "discountRequest",
| namespace="http://org.bilgidata.kitapdemo.service",
| propOrder = { "car" }
| )
| public class DiscountRequest {
|
| public DiscountRequest() { }
|
| public DiscountRequest(Car car) {
| this.car = car;
| }
|
| protected Car car;
|
| public Car getCar() {
| return car;
| }
|
| public void setCar(Car value) {
| this.car = value;
| }
|
| }
|
@Stateless
| @WebService(
| name="ProfileMgmt",
| targetNamespace = "http://org.bilgidata.kitapdemo.service",
| serviceName = "ProfileMgmtService"
| )
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
| public class ProfileMgmtBean {
|
| @WebMethod
| public String getCustomerDiscount(DiscountRequest request) {
| return "--";
| }
| }
|
import org.bilgidata.kitapdemo.service.ws.*;
|
| public class Mainline {
|
| public static void main(String[] args) throws Exception {
|
| ProfileMgmtService profileMgmt = new ProfileMgmtService();
|
| String s = profileMgmt.getCustomerDiscount(new DiscountRequest());
|
| }
|
| }
|
The error I get is:
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 org.bilgidata.kitapdemo.service.Mainline.main(Mainline.java:28)
| 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:102)
| at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
| at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
| at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
| 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:211)
| at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
| 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
|
<definitions name='ProfileMgmtService' targetNamespace='http://org.bilgidata.kitapdemo.service' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.bilgidata.kitapdemo.service' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
| <types>
| <xs:schema targetNamespace='http://org.bilgidata.kitapdemo.service' version='1.0' xmlns:tns='http://org.bilgidata.kitapdemo.service' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
| <xs:element name='getCustomerDiscount' nillable='true' type='tns:discountRequest'/>
| <xs:element name='getCustomerDiscountResponse' nillable='true' type='xs:string'/>
| <xs:complexType name='discountRequest'>
| <xs:sequence>
| <xs:element minOccurs='0' name='car' type='tns:car'/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name='car'>
| <xs:sequence>
| <xs:element minOccurs='0' name='description' type='xs:string'/>
| <xs:element minOccurs='0' name='garage' type='tns:garage'/>
| <xs:element minOccurs='0' name='licensePlate' type='xs:string'/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name='garage'>
| <xs:sequence>
| <xs:element maxOccurs='unbounded' minOccurs='0' name='cars' nillable='true' type='tns:car'/>
| <xs:element minOccurs='0' name='description' type='xs:string'/>
| <xs:element minOccurs='0' name='garageId' type='xs:int'/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name='ProfileMgmt_getCustomerDiscountResponse'>
| <part element='tns:getCustomerDiscountResponse' name='getCustomerDiscountResponse'></part>
| </message>
| <message name='ProfileMgmt_getCustomerDiscount'>
| <part element='tns:getCustomerDiscount' name='getCustomerDiscount'></part>
| </message>
| <portType name='ProfileMgmt'>
| <operation name='getCustomerDiscount' parameterOrder='getCustomerDiscount'>
| <input message='tns:ProfileMgmt_getCustomerDiscount'></input>
| <output message='tns:ProfileMgmt_getCustomerDiscountResponse'></output>
| </operation>
| </portType>
| <binding name='ProfileMgmtBinding' type='tns:ProfileMgmt'>
| <soap:binding style='document' transport='http://schemas.xmlsoap.org/soap/http'/>
| <operation name='getCustomerDiscount'>
| <soap:operation soapAction=''/>
| <input>
| <soap:body use='literal'/>
| </input>
| <output>
| <soap:body use='literal'/>
| </output>
| </operation>
| </binding>
| <service name='ProfileMgmtService'>
| <port binding='tns:ProfileMgmtBinding' name='ProfileMgmtPort'>
| <soap:address location='http://127.0.0.1:8080/gittigidiyor-gittigidiyor/ProfileMgmtBean'/>
| </port>
| </service>
| </definitions>
Any help would be greatly appreciated.
Thanks!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106339#4106339
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106339
18 years, 4 months
[JBossWS] - Re: wsconsume
by ahmedmhyd
I also got the same problem when trying to consume googlesearch.wsdl .Where u able to solve it?
Ahmed
Error:
[exec] parsing WSDL...
[exec] [WARNING] src-resolve.4.2: Error resolving component 'soapenc:Array'. It was detected that 'soapenc:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'file:/C:/Workspace/wsdl/GoogleSearch.wsdl#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 'soapenc:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'file:/C:/Workspace/wsdl/GoogleSearch.wsdl#types?schema1'.
[exec] line 57 of file:/C:/Workspace/wsdl/GoogleSearch.wsdl#types?schema1
[exec] [ERROR] undefined simple or complex type 'soapenc:Array'
[exec] line 57 of file:/C:/Workspace/wsdl/GoogleSearch.wsdl
[exec] [ERROR] undefined attribute 'soapenc:arrayType'
[exec] line 58 of file:/C:/Workspace/wsdl/GoogleSearch.wsdl
[exec] [ERROR] undefined simple or complex type 'soapenc:Array'
[exec] line 65 of file:/C:/Workspace/wsdl/GoogleSearch.wsdl
[exec] [ERROR] undefined attribute 'soapenc:arrayType'
[exec] line 66 of file:/C:/Workspace/wsdl/GoogleSearch.wsdl
[exec] Failed to invoke WsImport
[exec] java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/jboss-4.2.2.GA/client/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
[exec] at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:172)
[exec] at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
[exec] at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:286)
[exec] at com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getJAXBContext(BindInfo.java:332)
[exec] at com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:231)
[exec] at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:518)
[exec] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:232)
[exec] at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
[exec] at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:120)
[exec] at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2173)
[exec] at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:173)
[exec] at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:119)
[exec] at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:148)
[exec] at org.jboss.ws.tools.jaxws.impl.SunRIConsumerImpl.consume(SunRIConsumerImpl.java:187)
[exec] at org.jboss.wsf.spi.tools.cmd.WSConsume.importServices(WSConsume.java:216)
[exec] at org.jboss.wsf.spi.tools.cmd.WSConsume.main(WSConsume.java:79)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4106106#4106106
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4106106
18 years, 5 months