views:

38

answers:

4

In Eclipse I get this eror:

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.nokia.mid.impl.isa.util.SharedObjects.nativeSetTable(Ljava/util/Hashtable;)Ljava/util/Hashtable;

I can see SharedObjects, but nativeSetTable doesn't seem to be a method. It might however be hidden -> I don't have access to the source code.

This was my code:

connection = (HttpConnection)Connector.open(this.url);

This is the trace:

Exception in thread "main" java.lang.UnsatisfiedLinkError: com.nokia.mid.impl.isa.util.SharedObjects.nativeSetTable(Ljava/util/Hashtable;)Ljava/util/Hashtable; at com.nokia.mid.impl.isa.util.SharedObjects.nativeSetTable(Native Method) at com.nokia.mid.impl.isa.util.SharedObjects.createTable(SharedObjects.java:465) at com.nokia.mid.impl.isa.util.SharedObjects.(SharedObjects.java:181) at com.nokia.mid.impl.isa.io.GeneralSharedIO.(GeneralSharedIO.java:67) at com.sun.midp.io.ConnectionBaseAdapter.checkForPermission(ConnectionBaseAdapter.java:236) at com.sun.midp.io.ConnectionBaseAdapter.openPrim(ConnectionBaseAdapter.java:205) at com.sun.midp.io.ConnectionBaseAdapter.openPrim(ConnectionBaseAdapter.java:178) at com.sun.midp.io.InternalConnector.openPrim(InternalConnector.java:254) at com.sun.midp.io.InternalConnector.open(InternalConnector.java:153) at javax.microedition.io.Connector.open(Connector.java:138) at javax.microedition.io.Connector.open(Connector.java:120) at javax.microedition.io.Connector.open(Connector.java:104)

A: 

I guess you are coupling your source code with the wrong version of the nokia mid library.

tangens
A: 

It could be that your runtime classpath is using a different version of the jar where SharedObjects lives, when compared to your compile-time classpath in Eclipse. I would double-check your classpath settings.

MikeG
A: 

I think that nativeSetTable() is protected or private, that's why you don't see it. And moreover nativeSetTable() is a native method, which means that it is based on native code (already compiled for a specific processor and available in a specific lib [ie. a DLL]).

UnsatisfiedLinkError means that this particular method couldn't be retrieved and executed properly.

Thrown if the Java Virtual Machine cannot find an appropriate native-language definition of a method declared native.

This means that your Java ME emulator must have missing librairies. You should try to reinstall it.


Resources :

Colin Hebert
What should I re-install? the library? The Java ME emulator? I installed it like this: http://howto-programming.blogspot.com/2010/09/how-to-installconfigure-eclipse-for.html
hsmit
Well, if the method is private/protected and you can't invoke it, that must mean that your Nokia SDK installation/configuration is buggy one way or another.
Colin Hebert
A: 

Ok, I found one reason:

I created a test class in java to test my code, just a plain java file (with main method). And I ran it as a plain java application. Then, it doesn't work. But after I tried it in a Midlet, I didn't get the error!

hsmit