Skip to Main Content

Embedded Technologies

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!

hessian + creme 4.12

843849Apr 4 2010 — edited Sep 6 2010
Hi,

I've been struggling with getting Hessian (4.0.3) to work on a device running creme 4.12 (arm architecture).
I'm using netbeans 6.8 and the code's working if I'm running it by using the emulator.

When I run the same test program on the remote vm (the connected device), it throws an exception.

Client code:
 String url = "http://192.168.1.7:8080/WebApplication1/BasicService";

            HttpConnection c = (HttpConnection) Connector.open(url);
            c.setRequestMethod(HttpConnection.POST);
            c.setRequestProperty("content-type","x-application/hessian");
            
            OutputStream os = c.openOutputStream();
            MicroHessianOutput out = new MicroHessianOutput(os);

            out.startCall("hello");
            out.writeString("3552AGNH");
            out.completeCall();
            //os.flush();

            InputStream is = c.openInputStream();

            MicroHessianInput in = new MicroHessianInput(is);
            in.startReply();
            String result = in.readString();
            JOptionPane.showMessageDialog(this, result);
            in.completeReply();
Servlet code:
public class BasicService extends HessianServlet
{
    public String hello(String artCode)
    {
        return "result: " + artCode;
    }
}
Exception thrown when the code is run in the remote VM:
NSIcom Ltd., CrEme(tm) Evaluation Version
CrE-ME J2ME(tm)
CrE-ME V4.12.26 B160.081109 8-November-2009
  MemoryLimit=28608Kb
EBCI(TM) Interpreter V1.00,
Copyright 1998-2002 by Bytecodes, Inc.
java.io.IOException: expected string at end of file
	at com.caucho.hessian.micro.MicroHessianInput.protocolException()
	at com.caucho.hessian.micro.MicroHessianInput.expect()
	at com.caucho.hessian.micro.MicroHessianInput.readString()
	at be.carglass.main.Main.test()
	at be.carglass.main.Main.btnNewCrateActionPerformed()
	at be.carglass.main.Main.access$000()
	at be.carglass.main.Main$2.actionPerformed()
	at javax.swing.AbstractButton.fireActionPerformed()
	at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed()
	at javax.swing.DefaultButtonModel.fireActionPerformed()
	at javax.swing.DefaultButtonModel.setPressed()
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased()
	at java.awt.Component.processMouseEvent()
	at java.awt.Component.processEvent()
	at java.awt.Container.processEvent()
	at java.awt.Component.dispatchEventImpl()
	at java.awt.Container.dispatchEventImpl()
	at java.awt.Component.dispatchEvent()
	at java.awt.LightweightDispatcher.retargetMouseEvent()
	at java.awt.LightweightDispatcher.processMouseEvent()
	at java.awt.LightweightDispatcher.dispatchEvent()
	at java.awt.Container.dispatchEventImpl()
	at java.awt.Window.dispatchEventImpl()
	at java.awt.Component.dispatchEvent()
	at java.awt.EventDispatchThread.run()
Does anyone know how I can resolve this issue?

Looking forward to your replies.

Edited by: sirdeaz on Apr 5, 2010 12:02 AM

Edited by: sirdeaz on Apr 5, 2010 12:14 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 4 2010
Added on Apr 4 2010
1 comment
1,441 views