While executing [invoke] encountered [java.lang.UnsatisfiedLinkError].

While executing [invoke] encountered [java.lang.UnsatisfiedLinkError].

book

Article ID: KB0087813

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:
Abstract: While executing [invoke] encountered [java.lang.UnsatisfiedLinkError].

Description:
========
Error when invoking a Java method which will then invoke a method from a C++ library through JNI.

"While executing [invoke] encountered [java.lang.UnsatisfiedLinkError]"

Environment:
========
All

Symptoms:
======
2012 Jan 13 00:26:12:152 GMT -8 BW.zhangzhibin-dt Error [BW_Plugin] BW-JAVA-100001 Job-33000 Error in [Process Definition.process/Java Code]
While executing [invoke] encountered [java.lang.UnsatisfiedLinkError] : [swig.exampleJNI.get_time()Ljava/lang/String; at swig.exampleJNI.get_time(Native Method)]
    at com.tibco.plugin.java.JavaActivity.eval(Unknown Source)
    at com.tibco.pe.plugin.Activity.eval(Unknown Source)
    at com.tibco.pe.core.TaskImpl.eval(Unknown Source)
    at com.tibco.pe.core.Job.a(Unknown Source)
    at com.tibco.pe.core.Job.k(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.a(Unknown Source)
    at com.tibco.pe.core.JobDispatcher$JobCourier.run(Unknown Source)
called by: [Process Definition (1).process/Call Process]

<?xml version="1.0" encoding="UTF-8"?>
<Data>
    <ns0:InvocationException xmlns:ns0="http://schemas.tibco.com/bw/plugins/java/5.0/javaExceptions">
        <msg>While executing [invoke] encountered [java.lang.UnsatisfiedLinkError] : [swig.exampleJNI.get_time()Ljava/lang/String; at swig.exampleJNI.get_time(Native Method)]</msg>
        <msgCode>BW-JAVA-100001</msgCode>
        <methodName>invoke</methodName>
        <exceptionClassName>java.lang.UnsatisfiedLinkError</exceptionClassName>
        <exceptionMessage>swig.exampleJNI.get_time()Ljava/lang/String; at swig.exampleJNI.get_time(Native Method)</exceptionMessage>
    </ns0:InvocationException>
</Data>


Cause:
====
The JNI interface function is defined as a static function. The library is not loaded before the static class(function) initiated.

Resolution:
=======
Use static loadLibrary code in the static function defined class.


static {

     System.loadLibrary("msvcr100d");
     System.loadLibrary("swigexample");
}

Issue/Introduction

While executing [invoke] encountered [java.lang.UnsatisfiedLinkError].