1

I'm trying to run real time java code using the Websphere Realtime Java VM on Ubuntu Linux 32 bit. I could get the code to build, but for some reason the VM is unable to locate the native libraries that implement the javax.realtime classes and throws an UnsatisfiedLinkError. Any ideas on how to fix this will be appreciated.

import javax.realtime.*;
public class HelloRTWorld {

public static void main(String[] args) {
    RealtimeThread rt = new RealtimeThread() {
        public void run() {
            System.out.println("Hello RT World");
        }
    };
    rt.start();
}   
}

This is the error trace:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: javax/realtime/RealtimeThread.putAsyncHandlerClassToThread(Ljava/lang/Class;)V
at javax.realtime.RealtimeThread.<clinit>(RealtimeThread.java:122)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:233)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at net.suhrid.HelloWorld.main(HelloWorld.java:9)
suhridk
  • 238
  • 3
  • 6
  • What's the command line you're using to call this? – kittylyst Dec 02 '11 at 17:45
  • I've set up the project in eclipse which produces the above error. I tried the below command line which produces the same error: opt/ibm/javawrt3/bin/java -classpath /opt/ibm/javawrt3/jre/lib/i386/realtime/jclSC170/realtime.jar:. HelloRTWorld. – suhridk Dec 02 '11 at 18:03
  • Printing the java.library.path system property gives: `/opt/ibm/javawrt3/jre/lib/i386/default:/opt/ibm/javawrt3/jre/lib/i386:/opt/ibm/javawrt3/jre/lib/i386/j9vm:/opt/ibm/javawrt3/jre/lib/i386:/opt/ibm/javawrt3/jre/../lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386:/usr/lib/xulrunner-addons:/usr/lib/xulrunner-addons:/usr/lib.` I've tried adding `/opt/ibm/javawrt3/jre/lib/i386/realtime` to the java.library.path which I assume contains native libraries for the realtime java implementation. Still no luck. – suhridk Dec 02 '11 at 18:09

2 Answers2

1

I had exactly the same problem. I added to my project the realtime.jar library provided with Websphere IBM Realtime but couldn't make my script run (I got the same output in the console than you). Finally I added -Xrealtime in the VM Argumnets (in the Arguments tab of the Run Configurations menu) and succeed!

Ricard
  • 11
  • 1
1

You don't need to put any jars on the command-line specifically, but you do need to run with -Xrealtime to activate real-time support.

You may also have trouble with the Ubuntu kernel not providing sufficient real-time performance (so WRT could fail to start with this option). The supported real-time operating systems are Red Hat's MRG and Novell SLERT.

Mark
  • 46
  • 2
  • This is correct. Thanks @Mark. Do you think installing an RT Kernel in Ubuntu will work ? – suhridk Dec 17 '11 at 13:31
  • It's possible, but it's not something we've tried. Ubuntu doesn't support it, to my knowledge, and that makes it tough to support the product in that configuration. – Mark Dec 21 '11 at 18:55