Home > Java > Workaround for WAS NoClassDefFoundError with JAX-WS

Workaround for WAS NoClassDefFoundError with JAX-WS

If you have to use IBM’s JDK with WebSphere Application Server and like to unit test web services outside of the container, you may encounter:


java.lang.NoClassDefFoundError: com.ibm.ffdc.Manager
  at com.ibm.ws.ffdc.FFDCFilter.processException(FFDCFilter.java:82)
  at com.ibm.ws.webservices.engine.components.logger.LogFactory$2.run(LogFactory.java:159)
  at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:63)
  at com.ibm.ws.webservices.engine.components.logger.LogFactory.createLogFactory(LogFactory.java:141)
  at com.ibm.ws.webservices.engine.components.logger.LogFactory.(LogFactory.java:98)
  at java.lang.J9VMInternals.initializeImpl(Native Method)
  at java.lang.J9VMInternals.initialize(J9VMInternals.java:205)
  at com.ibm.ws.webservices.engine.soap.MessageFactoryImpl.(MessageFactoryImpl.java:103)

What is that? A quick search indicates that the server administration client jar is missing from the classpath, but why would I need that? I just want to publish a simple JAX-WS web service.

Fortunately there is a workaround. Set a system property:


  System.setProperty("javax.xml.soap.MetaFactory",
    "com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl");

This forces the use of Sun’s web service stack and the problem is gone. When the code runs in the container the classes are available and in this way we can get the unit tests to work.

Advertisements
Categories: Java
  1. Petar Peric
    2015-04-28 at 11:28

    Hi Erik,

    what is the best way I can reach you?

    Best regards,
    Petar Peric

  2. 2015-04-28 at 20:42

    Depends on what you want, you could send a mail to info@codemint.com if it is business or you could elaborate in a comment.

  3. Scott
    2015-06-05 at 22:05

    Yes!

    You have no idea how relieving it is to see this post. I have no idea where or how you figured this out, but I am eternally grateful. Thank you Erik!!!

  4. Oz
    2015-08-26 at 23:40

    Excelent bro!!!! Your tip helped me a lot! I was triyng to get this error away for 2 days! Thank U!!!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: