Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UnsatisfiedLinkError + RMI + JNI

1 view
Skip to first unread message

Jason Woods

unread,
Jan 8, 2001, 2:41:14 PM1/8/01
to
All,
Here's the scenario... I have a servlet that uses RMI to make requests
to an
application residing on another machine. The application handles all
database
pooling and business rules ect. I have to implement JNI on this application
to
talk a proprietary database with no JDBC or ODBC drivers. My problem
arises when calling the native method from the servlet. I have written a
test
application and run it on the application server and it makes the native
call fine.
But when I attempt to make the call using RMI I get an UnsatisfiedLinkError
exception. I even tried writing a simple app that uses RMI and tested it on
the
app server, but still I get the same thing. So is it possible to call an
object's
methods via RMI that make calls to native methods? I don't see why not
but this problem only occurs when using RMI.


/*******************************************************
* Sample Code on Server
*******************************************************/
public Entry insertUser(String ispcode, User user, Product prd)
throws RemoteException {

String database = getUnisqldb(ispcode);
String username = "username";
String password = "password";

/**Call private method to insert user*/
Entry entry = nativeInsertUser(username, password, database, user, prd);

return entry;
}

/*******************************************************
* Sample Servlet Code
*******************************************************/
...
try {

Entry e = this.allegro.insertUser(request.getParameter("isp").
toUpperCase(),user,prd);
}
catch (Exception e) {

e.printStackTrace();
}
...
/*******************************************************
* Error Message
* Notice: runConnectDB is a native method
*******************************************************/
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.UnsatisfiedLinkError: runConnectDB
java.lang.UnsatisfiedLinkError: runConnectDB
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at Register_Stub.insertUser(Register_Stub.java:339)
at com.structus.registration.client.Signup.doPost(Signup.java:679)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:83)
at com.caucho.server.http.Invocation.service(Invocation.java:236)
at
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:142)
at
com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:342)
at
com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:263
)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:484)


---------------------------------------
Jason Woods
Programmer/Analyst
Structus - http://www.structus.com
---------------------------------------


0 new messages