Note that there are some explanatory texts on larger screens.

plurals
  1. POGroovy: WSClient throwing JAXBException
    primarykey
    data
    text
    <p>I am trying to call a simple public Web Service with WSClient in a Groovy script, but it explodes when initializing ...</p> <p>TestService.groovy:</p> <pre><code>@Grab(group='org.codehaus.groovy.modules', module='groovyws', version='0.5.2') import groovyx.net.ws.WSClient def proxy = new WSClient("http://www.w3schools.com/webservices/tempconvert.asmx?WSDL", this.class.classLoader) proxy.initialize(); def result = proxy.CelsiusToFahrenheit(0) println "You are probably freezing at ${result} degrees Farhenheit" </code></pre> <p>The error message:</p> <pre><code>SEVERE: Could not compile java files for http://www.w3schools.com/webservices/tempconvert.asmx?WSDL. Caught: 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: "org.tempuri" doesnt contain ObjectFactory.class or jaxb.index java.lang.IllegalStateException: Unable to create JAXBContext for generated pack ages: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: jav ax.xml.bind.JAXBException: "org.tempuri" doesnt contain ObjectFactory.class or j axb.index at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:343) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:196) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:175) at groovyx.net.ws.AbstractCXFWSClient.createClient(AbstractCXFWSClient.java:229) at groovyx.net.ws.WSClient.initialize(WSClient.java:108) at groovyx.net.ws.IWSClient$initialize.call(Unknown Source) at TestService.run(TestService.groovy:5) Caused by: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory could not be instantiated: javax.xml.bind.JAXBException: "org.tempuri" doesnt contain ObjectFactory.class or jaxb.index - with linked exception: [javax.xml.bind.JAXBException: "org.tempuri" doesnt contain ObjectFactory.classor jaxb.index] at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:340) ... 6 more Caused by: javax.xml.bind.JAXBException: "org.tempuri" doesnt contain ObjectFactory.class or jaxb.index at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:197) ... 7 more </code></pre> <p>Any hint? Why should I have a jaxb.index?</p> <p>Just discovered that the problem occurs with Java 1.7 (jdk1.7.0_21)... it's OK when running with Java 6 (jdk1.6.0_31)</p> <p>Any hint to work with Java 7?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload