title: ClassFormatError: 56 while using hessian in j2me
body: <p>I am trying to use the hessian j2me implementation @ <a href="http://hessian.caucho.com/" rel="nofollow noreferrer">http://hessian.caucho.com/</a> using java me sdk 3.0. </p>
  
  <p><a href="http://hessian.caucho.com/doc/hessian-overview.xtp#Hessian%20Client%20for%20a%20cell-phone" rel="nofollow noreferrer">http://hessian.caucho.com/doc/hessian-overview.xtp#Hessian%20Client%20for%20a%20cell-phone</a> mentions the usage for j2me.</p>
  
  <p>The application builds without any errors/warning. But, the moment the line where <code>MicroHessianOutput</code> is instantiated is hit, a ClassFormatError ( <code>java.lang.Error: ClassFormatError:  56</code>
   ) is thrown. </p>
  
  <p>Heres the trace :</p>
  
  <pre><code>TRACE: &lt;at java.lang.Error: ClassFormatError:  56&gt;, startApp threw an Exception
  java.lang.Error: ClassFormatError:  56
   - alert.AlertDemo.showOption(), bci=26
   - alert.AlertDemo.startApp(), bci=9
   - javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
   - com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
   - com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
   - com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
   - com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
   - com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
   - com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
  </code></pre>
  
  <p>and heres showOption():</p>
  
  <pre><code>private void showOption () throws Exception{
         String url = "http://localhost/hello";
  
          HttpConnection c = (HttpConnection) Connector.open(url);
  
          c.setRequestMethod(HttpConnection.POST);
  
          OutputStream os = c.openOutputStream();
          MicroHessianOutput out = new MicroHessianOutput(os); //error throwing line
          /*
          out.startCall("hello");
  
          InputStream is = c.openInputStream();
  
          MicroHessianInput min = new MicroHessianInput(is);
          min.startReply();
          System.out.println(min.readString());
          */
      }
  </code></pre>
  
  <p>I have jdk 1.6u16 installed. I am thinking it might be because the classes in the library might have been written for an older jdk. I don't see any option in the IDE to configure this. </p>
  
  <p>Here's the class source code: <a href="http://pastebin.ca/1659596" rel="nofollow noreferrer">MicroHessianOutput</a></p>
  
  <p>Any idea why this could be happening ?</p>