Hi guys, I'm trying to create a Client with CXF from WSDL file, like this:Bus
bus = CXFBusFactory.newInstance().createBus();JaxWsDynamicClientFactory
factory = JaxWsDynamicClientFactory.newInstance (bus);URL url = new
URL(wsdlUrl);Client client = factory.createClient(url); ...But got an
following error:Exception in thread "main" java.lang.IllegalStateException:
Unable to create JAXBContext for generated packages: Provider
com.sun.xml.bind.v2.ContextFactory could not be instantiated:
javax.xml.bind.JAXBException: "com.peregrine.servicecenter.pws" doesnt
contain ObjectFactory.class or jaxb.index         at
org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:397)
        
atorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:276)
        
atorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:269)
        
atorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:204)
        
at Main.main(Main.java:57)Caused by: javax.xml.bind.JAXBException: Provider
com.sun.xml.bind.v2.ContextFactory could not be instantiated:
javax.xml.bind.JAXBException: "com.peregrine.servicecenter.pws" doesnt
contain ObjectFactory.class or jaxb.index  - with linked
exception:[javax.xml.bind.JAXBException: "com.peregrine.servicecenter.pws"
doesnt contain ObjectFactory.class or jaxb.index]         at
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:146)         at
javax.xml.bind.ContextFinder.find(ContextFinder.java:335)         at
javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:431)        
atorg.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:394)
        
... 4 moreCaused by: javax.xml.bind.JAXBException:
"com.peregrine.servicecenter.pws" doesnt contain ObjectFactory.class or
jaxb.index         at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:281)       
 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)         at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   
     
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        
at java.lang.reflect.Method.invoke(Method.java:498)         at
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:171)         at
javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:131)         ...
7 moreWhen I try to load the WSDL with WSDLToJava this works without any
problems. The same machine and same CXF. OS is Linux, JDK 1.8.0_112 and CXF
is at 3.7. Please help, any advice is welcome.BRPeter



--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-createClient-failing-with-javax-xml-bind-JAXBException-exception-tp5777348.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to