UnsatisfiedLinkError when trying to run Real time Java code on Websphere Real Time JVM on Linux

StackOverflow https://stackoverflow.com/questions/8360302

  •  27-10-2019
  •  | 
  •  

Question

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)
Was it helpful?

Solution

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.

OTHER TIPS

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top