Sign in to follow this  

[java] WebService exception

This topic is 4203 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm encountering an error when I call a specific set of methods that call a webservice. I've used the webserviuce without a problem in C#, but have to do it in Java now. In C#, I use the code: Engine engine = new Engine(); engine.Credentials = new System.Net.NetworkCredential(username, password); TrimResponse response = engine.Execute(request); in Java, it translates to: Engine engine = new Engine(); TrimResponse response = engine.getEngineSoap().execute(request); The middle line is missing because wsimport does not create anything like engine.Credentials on the engine object. So anyway, I get the error: Exception in thread "main" java.lang.NoSuchMethodError: javax.xml.bind.annotation.XmlAccessorType.value()Ljavax/xml/bind/annotation/XmlAccessType; at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getAccessType(ClassInfoImpl.java:353) at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:242) at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:89) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:127) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:204) at com.sun.xml.bind.v2.runtime.JAXBContextImpl$3.run(JAXBContextImpl.java:352) at com.sun.xml.bind.v2.runtime.JAXBContextImpl$3.run(JAXBContextImpl.java:350) at java.security.AccessController.doPrivileged(Native Method) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:349) at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:215) at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:76) at com.sun.xml.ws.model.RuntimeModel$1.run(RuntimeModel.java:194) at java.security.AccessController.doPrivileged(Native Method) at com.sun.xml.ws.model.RuntimeModel.createJAXBContext(RuntimeModel.java:191) at com.sun.xml.ws.model.RuntimeModel.postProcess(RuntimeModel.java:77) at com.sun.xml.ws.modeler.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:253) at com.sun.xml.ws.client.ServiceContextBuilder.processAnnotations(ServiceContextBuilder.java:117) at com.sun.xml.ws.client.ServiceContextBuilder.completeServiceContext(ServiceContextBuilder.java:85) at com.sun.xml.ws.client.WSServiceDelegate.processServiceContext(WSServiceDelegate.java:114) at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:266) at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:152) at javax.xml.ws.Service.getPort(Service.java:95) at tct.Engine.getEngineSoap(Engine.java:54) at tct.MainClass.main(MainClass.java:55) when I attempt to execute the last line of the code posted above. I've looked it up but haven't found a way of tracking the actul reason my my error. Any help would be great. Thanks

Share this post


Link to post
Share on other sites
post your WSDL that you're using to generate the client/server stub code (if you ARE using a WSDL). I've seen stuff like this because of ComplexTypes being extended by more than one element type, JAXB (for some apparently good reason) doesn't generate concrete impls or interfaces for the element types. Although actually the framework ought to handle that ... hmmm ...

D.

Share this post


Link to post
Share on other sites
Here's a copy of the WSDL.

http://filebox.vt.edu/users/ddonahoe/desk/trim.asmx.xml

Is there a better alternative to using wsimport to convert a WSDL to java? I used another tool (wscompile) and it encountered dozens of errors because of a known documented bug with complex types.

Are there other tools I could try out?

Thanks for the help

Share this post


Link to post
Share on other sites

This topic is 4203 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this