Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using J2ME APIs in J2SE, or vice versa?

 
Wen Jia Gan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to use J2SE APIs in a J2ME MIDlet, or vice versa? Or are there any workarounds?

The reason why I am even doing this is that I have a study project to make work a communication gateway between 2 systems. And 1 of them provides APIs in J2SE and 1 in J2ME.

I tried serveral ways.
1. In a J2ME MIDP 1.0 MIDlet, when calling the APIs provided in J2SE, I get :
ALERT : Bad method signature

2. In a J2ME MIDP 2.0 MIDlet, when calling the APIs provided in J2SE, I get :

a. Before obfuscating:
java.lang.NoclassDefFoundError:java/net/UnknownHostException:Cannot create class in system package
at Canvas.<init>(+18)
at MIDlet.startApp(+15)

b. After obfuscating:
Error verifying method MIDlet startApp()V
Method...

3. In a J2SE program, when calling J2ME APIs like
javax.microedition.io.Connector.open(url);
I get the
java.lang.UnsatisfiedLinkError
(see below for more details)

Any help would be appreciated...
Wen
--------------------------------------------
3. Details of java.lang.UnsatisfiedLinkError
Exception in thread "main"
java.lang.UnsatisfiedLinkError: getProperty0
at
com.sun.midp.Configuration.getProperty0(Native
Method)
at
com.sun.midp.Configuration.getProperty(C:/tmp_java/build_WTK/j2me_mid
p/src/share/classes/com/sun/midp/Configuration.java:34)
at
com.sun.midp.io.InternalConnector.<clinit>(C:/tmp_java/build_WTK/j2me
_wtk/midp/src/lime/classes/com/sun/midp/io/InternalConnector.java:91)
at
javax.microedition.io.Connector.open(C:/tmp_java/build_WTK/j2me_midp/
src/share/classes/javax/microedition/io/Connector.java:158)
at
javax.microedition.io.Connector.open(C:/tmp_java/build_WTK/j2me_midp/
src/share/classes/javax/microedition/io/Connector.java:138)
at
javax.microedition.io.Connector.open(C:/tmp_java/build_WTK/j2me_midp/
src/share/classes/javax/microedition/io/Connector.java:120)
at
terraplay.networking.SendReceiveHTTPDefault.openUrl(SendReceiveHTTPDe
fault.java:40)
at
terraplay.networking.AsyncCommunicationHandler.setup(AsyncCommunicati
onHandler.java:44)
at Tgateway12.main(Tgateway12.java:45)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic