title: NoClassDefFoundError for com.sun.xml.internal.ws.fault.SOAPFaultBuilder
body: <p>Our web service client in live environment recently got the exception:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.ws.fault.SOAPFaultBuilder 
  at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:107)
  at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
  at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:135)
  at com.sun.proxy.$Proxy146.search(Unknown Source)
  ....
  </code></pre>
  
  <p>I've done a lot of search online, including a few posts here at StackOverflow:</p>
  
  <p><a href="https://stackoverflow.com/questions/1494738/catching-webservice-exception-with-cxf-noclassdeffounderror-soapfaultbuilder">Catching webservice exception with CXF: NoClassDefFoundError: SOAPFaultBuilder</a></p>
  
  <p><a href="https://stackoverflow.com/questions/6585525/could-not-initialize-class-com-sun-xml-internal-ws-fault-soapfaultbuilder">Could not initialize class com.sun.xml.internal.ws.fault.SOAPFaultBuilder</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12785052/java-lang-noclassdeffounderror-could-not-initialize-class-com-sun-xml-internal">java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.ws.fault.SOAPFaultBuilder</a></p>
  
  <p>And my understanding was our client received a SOAP Fault from the server and it's missing some jar file. So I'm trying to solve the problem by first recreating it.</p>
  
  <p>I created a simple Web Service server project in Eclipse which has a web method throws a simple fault class annotated by <code>@WebFault</code>. Then I created a simple Web Service client project which consumes the web method. The client project doesn't have any additional libraries/jars in its classpath; all it has is the JRE. To my surprise, it didn't throw the NoClassDefFoundError exception! Instead, I got the <code>javax.xml.ws.soap.SOAPFaultException</code> I defined on the server side.</p>
  
  <p>The class <code>SOAPFaultBuilder</code> is indeed in rt.jar in JRE. So the simple web service projects I created probably just work as they should. However, how come the web service client in our live environment throw the <code>NoClassDefFoundError</code> exception? That project definitely has rt.jar in the classpath.</p>
  
  <p>Can anyone please shed some light on this problem? If it's missing some jar files (either from the jaxws RI or Apache CXF or others), why would the super simple client I created didn't throw the error? Both the live environment and my local environment use Java7u51.</p>