My goal is to make an "universal" applet that runs regardless browser. When
using Suns JVM, Rainbow instructs to use a DLL as a proxy module (the source
code how to load it on the remote client is included). I think that I can
use this approach even with IE, using also the classes destined for JVM...
The applet is put into a Java Archive (jar) and signed with a digital
certificate. Upon laoding the applet, the JavaPlug-In asks if I trust the
company that issued the certificate. I do grant it access.
The problem I encounter is a runtime java.lang.UnspecifiedLinkError. The
java console output is as follows:
--- Java console ---
<loading all classes in package>
...
.dll
null
Starting load: iKeyNspx.dll --> c:\temp\iKeyNspx.dll
File exist; try to delete
File does not exist
Seeking remote file
Got input stream
Have files.
Copying data
Done.
loading library c:\temp\iKeyNspx.dll
starting...
Create COM object failed : Init
................................java.lang.UnsatisfiedLinkError: Init
at ikeycom.iKeyAPI.Init(Native Method)
at ikeycom.iKeyAPI.<init>(iKeyAPI.java)
at ikeycom.CoiKey.<init>(CoiKey.java)
at iKey_app.start(iKey_app.java:124)
at sun.applet.AppletPanel.run(AppletPanel.java:355)
at java.lang.Thread.run(Thread.java:536)
DEBUG: Exiting!
--- END java console output ---
Here are some code snippets (including the linke given in the above error):
--- Java applet source ---
public class iKey_app extends Applet {
TextArea field;
protected RemoteLib iKeyCOMDir = null;
...
IiKey iKey = null;
...
// readdll is called in the init method
private void readdll() {
try {
debug("Setting up DLL file");
iKeyCOMDir = new RemoteLib("ikeycom", "CLASS_PATH");
iKeyAPIClass = new RemoteLib("ikeycom/iKeyAPI.class",
"ikeycom/iKeyAPI.class", true);
SAccessInfoClass = new RemoteLib("ikeycom/SAccessInfo.class",
"ikeycom/SAccessInfo.class", true);
SVersionInfoClass = new RemoteLib("ikeycom/SVersionInfo.class",
"ikeycom/SVersionInfo.class", true);
SSysInfoClass = new RemoteLib("ikeycom/SSysInfo.class",
"ikeycom/SSysInfo.class", true);
SFileInfoClass = new RemoteLib("ikeycom/SFileInfo.class",
"ikeycom/SFileInfo.class", true);
SDirInfoClass = new RemoteLib("ikeycom/SDirInfo.class",
"ikeycom/SDirInfo.class", true);
iKeyNspx = new RemoteLib("iKeyNspx.dll", "iKeyNspx.dll", true);
iKeyNspx.load();
}
catch (SecurityException se) {
addItem("Security exception while setting up DLL file!\n" +
se.getMessage()+"\n");
}
catch (IOException ioe) {
addItem("Could not setup DLL file - I/O exception.\n");
}
}
...
public void start() {
addItem("starting... \n");
try {
// create a COM object instance for the iKey
iKey = (IiKey) new CoiKey(); // <<< this line is referenced in the
error
}
catch (Throwable e) {
addItem("Create COM object failed : " + e.getMessage() + "\n");
e.printStackTrace(System.err);
debug("Exiting!");
return;
}
...
--- END java applet source ---
Does this mean that the DLL is not working or is the error in the classes
that Rainbow provided? If anyone has done something similar (or has any
ideas), I'd be greatly thankful for tips.
--
Dipl. Inform. (FH) Sabine Dinis Blochberger
Developer
Op3racional
Email: s.bloc...@op3racional.de