Monday, January 12, 2009

NoClassDefFoundError when attempting to use MTOM with NetBeans 6.5 Jax-WS 2.1 client

A Java client that communicates with a .NET host has problems when the HOST has messageEncoding set to MTOM in web.config :

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="FileTransferServicesBinding" transferMode="Streamed" 
          messageEncoding="Mtom" maxReceivedMessageSize="10067108864">
        </binding>
      </basicHttpBinding>
    </bindings>
...


(it works fine when messageEncoding="Text")



The client app throws:

    java.lang.NoClassDefFoundError: org/jvnet/mimepull/MIMEMessage



I fixed the problem by downloading from: here and including the mimepull.jar in the libraries.



[One can only hope that the data is transmitted to the host with MTOM encoding]



MTOM stands for Message Transmission Optimization Mechanism, it's explained here.

1 comment:

Anonymous said...

I had the same problem using NetBeans when a Web client tries to connect to a web service.FIX: add the mimepull.jar Classpath to the JAX-WS 2.1 library in the Library Manager