Skip to main content

Client ClassCastException

7 replies [Last post]
brianpdoyle
Offline
Joined: 2005-05-01
Points: 0

I'm getting the following error below when I attempt to run a web service client. I have no clue what this error means or how to fix the problem. I generate the client code from the server source and it runs just fine. When I jar up the client code and attempt to use it in a different project it produces this error. Thanks.

Exception in thread "main" java.lang.ClassCastException: java.lang.NoSuchMethodError
at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:130)
at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:76)
at $Proxy20.geocode(Unknown Source)
at com.company.etosha.web.MappingClient.geocode(MappingClient.java:81)

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohlert
Offline
Joined: 2003-06-16
Points: 0

What do you mean you generate the client code from teh server source? You generated the client from the WSDL right? And you have made sure that your classpath is correct (you are not picking up old jax-ws jars, or other old class files).

brianpdoyle
Offline
Joined: 2005-05-01
Points: 0

I'm using wsgen to generate the client code which I don't have the wsdl and just the server class file. Should I be using the wsdl to generate the client code instead?

kohlert
Offline
Joined: 2003-06-16
Points: 0

Yes, I am not sure how you are making the client working with wsgen. Anyway, you do have to generate the client code from the published WSDL using wsimport.

brianpdoyle
Offline
Joined: 2005-05-01
Points: 0

Sorry, I'm using wsgen to generate the wsdl and then I pump that into wsimport to generate the client code. When I run the client code that it creates it works just fine.

When I jar up that client code and attempt to run it fails and with that error message. Does that error message indicate what the problem would be? I don't have anything else in my classpath other than the needed libs. Thanks.

kwalsh
Offline
Joined: 2003-06-10
Points: 0

Brian-
Offhand,I'm am not sure why this exception is occuring but I would like to investigate this issue. Can you either isolate
your client code, or reproduce the problem outside of your application? Can you also send the wsdl for the service or
a wsdl that your isolated code is generate from?

Also, what is in the classpath and what is in the client
jar when you get this error, and also files and jars are present when you do not jar up the client?

If you can send me this information, I will debug the problem tomorrow-

brianpdoyle
Offline
Joined: 2005-05-01
Points: 0

Okay I discovered that if I move the saaj.jar file up in my classpath the error goes away. I don't have two saaj.jar files in my classpath so I'm trying to narrow down what other jar file is conflicting with that.

brianpdoyle
Offline
Joined: 2005-05-01
Points: 0

I discovered that the saaj-imp.jar and the older version of xbean.jar were not playing well together. I grabbed the latest version of xbean.jar (2.0.0) and all appears to be well.