Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java.lang.NoClassDefFoundError: com/sun/xml/ws/developer/WSBindingProvider

bdzevelDec 13 2013 — edited Dec 13 2013

Hello,

I was seeing the following error:

java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;

I did some googling and found that I needed to specify the endorsed directory java option:

java -Djava.endorsed.dirs="/mypathtoendorseddir" -jar myjar.jar

This directory contained my jaxws-rt.jar file. It was kind of tricky but I was eventually able to get past this error. Now I'm stuck with the following nonsensical error:

java.lang.NoClassDefFoundError: com/sun/xml/ws/developer/WSBindingProvider

This error occurs when I try to cast a binding as that com.sun.xml.ws.developer.WSBindingProvider (a few lines down from the original "java/lang/String" error). I've downloaded the latest jaxws-rt.jar, but no luck. How is it unable to find this WSBindingProvider class when my project compiles and builds a jar file successfully? Granted, the code is being run on another machine (I'm building locally obviously), but the jaxws-rt.jar file is THERE. I even modified the class-path entry in the jar manifest to include "endorseddir/jaxws-rt.jar" (previously, I had this in a "lib" folder and was just referencing "jaxws-rt.jar" in the class-path).

Again, it's able to resolve the WSBindingProvider class from the code, and when I go to the definition it throws me into jaxws-rt.jar (without any sources of course, but it does understand that the class is in there).

I'm lost. Any ideas?

P.S. After pulling my hair out for a while trying to figure this out, I figured I'd just take all the references to WSBindingProvider out of my code and replace it with BindingProvider. Unfortunately, BindingProvider doesn't expose a setOutboundHeaders function which is used in certain parts of our code. BindingProvider, by the way, properly resolves.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2014
Added on Dec 13 2013
1 comment
4,211 views