• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UnsatisfiedLinkError, zayit, libzayit.so, wtk, linux

 
Fernando Gomes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Does anyone know how to enable native code under Linux version of WTK2.1 ?
It seems WTK2.1 cannot call a native code method inside libzayit.so.
I have already checked libzayit.so and the method I need is really there.
I've read that you have to define LD_LIBRARY_PATH to point at libzayit.so.
I also ready that -Xbootclasspath/a:/my-wtk-path/bin is need in order to libzayit to be found. I've tryed many "flavors" but it's not working.
I know JNI is not supported under MAC/OSX and I'm afraid that JNI is not supported under Linux too!
Below you can see my method, the error I got and my java.sh script I run inside my profile.
Thank you in advance
Fernando Gomes
fernando.gomes@bigfoot.com
mobile:+55(11)9993-2760
 
Fernando Gomes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems I discovered something weird in my Linux box.
The problem was hostname and domainname were misconfigured.
Probably you will receive a strange message when WTK emulator is started, telling you something like "hostname not found" or "wrong IP"... I don't remember very well.
My /etc/sysconfig/networking/profiles/default/network was ...
HOSTNAME=sirius.localdomain
... and should be:
HOSTNAME=sirius
DOMAIN=localdomain
Enter RedHat network configuration applet and reconfigure your system, restart networking and check if everything seem OK. Start WTK emulator and you should not see the weird message anymore.
I hope it helps.
Fernando Gomes
 
sun gong
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that the code attempts
to run (with calling native) without the sand box;

if run from :
public static void main(String[] args){
//the j2me code
}
it will throw the java.lang.UnsatisfiedLinkError:*****

but run from:
public class YourMIDlet extends MIDlet{
protected void startApp() throws MIDletStateChangeException {
//from here:
String msg = "你好!!";
SMSSendThreadHTTPImpl httpImpl = new SMSSendThreadHTTPImpl(msg);
Thread httpSend = new Thread(httpImpl);
httpSend.start();
}

}
it will OK!!!

[ January 10, 2006: Message edited by: sun gong ]
[ January 10, 2006: Message edited by: sun gong ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic