let*_*nje 3 java rpc midp hessian java-me
我正在尝试使用java me sdk 3.0 来使用hessian j2me实现@ http://hessian.caucho.com/.
http://hessian.caucho.com/doc/hessian-overview.xtp#Hessian%20Client%20for%20a%20cell-phone提到了j2me的用法.
应用程序构建时没有任何错误/警告.但是,在MicroHessianOutput
实例化实例化的行的那一刻,java.lang.Error: ClassFormatError: 56
抛出了ClassFormatError().
继承人追踪:
TRACE: <at java.lang.Error: ClassFormatError: 56>, 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
Run Code Online (Sandbox Code Playgroud)
和继承人showOption():
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());
*/
}
Run Code Online (Sandbox Code Playgroud)
我安装了jdk 1.6u16.我想这可能是因为库中的类可能是为较旧的jdk编写的.我没有在IDE中看到任何选项来配置它.
这是类源代码:MicroHessianOutput
知道为什么会发生这种情况吗?
当您的JVM无法加载类时,会发生ClassFormatError,因为它无法识别它的格式(例如,JVM 1.4尝试加载由javac 1.5编译的类).
J2ME可能需要较旧的目标类.尝试重新编译你的Hessian东西
javac -target 1.4 ...
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2078 次 |
最近记录: |