Solved

JNI from trusted applet

Posted on 1998-03-03
1
408 Views
Last Modified: 2008-02-26
How do I cause a trusted applet to load a native library?  When running as either of the following, the native libary is successfully loaded:

- An application, or
- Appletviewer with classpath set, the native library is loaded.  Running appletviewer with CLASSPATH set and the .jars in   that classpath causes the file loader to be used and applet restrictions don't exist

.  However, when I run appletviewer without classpath (causing applet class loader to be used), the native library cannot be loaded.  The dlls are in my Win NT PATH.

I configured appletviewer for trusted applets and get beyond the initial security restrictions, e.g., reading restricted system propertities, but fail when trying to load a library:

java.lang.UnsatisfiedLinkError: fixFloat
      at
[888940955234] 0 S 1 [Thread-5] class com.ibm.frn.DocViewThread obj.id:8065d5 in GETNEXTDOCUMENT
      at java.lang.ClassLoader.resolveClass(ClassLoader.java:245)
java.lang.UnsatisfiedLinkError: fixFloat
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
      at
      at com.ibm.frn.EnvThread.run(EnvThread.java:87)
      at java.lang.ClassLoader.resolveClass(ClassLoader.java:245)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)


The same problem (UnsatisfiedLinkError) occurs with Netscape Communicator with Java Activator.  The applet's jar file is signed, and Activator is configured for trusted applets.

What do trusted applets use to locate native libraries?  I don't think it's PATH (on Win NT) because my PATH is correct.
0
Comment
Question by:dsanders030398
1 Comment
 
LVL 6

Accepted Solution

by:
jpk041897 earned 100 total points
ID: 1233397
As you tated you can use CLASSPTH.

Other option include placing the ative code on the same pat as the applet .class file or using the CODEBASE=path option inside the APPLET tag in your HTML file.

PATH will also work, but only if the PATH where the nativ code is stored is inside the web page servers directoy tree. The server willnot allow you to read/write files ouside of its web page directory structure for scurity reasons.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 80
firstChar challenge 13 107
Strange loading of website behaviour 3 31
expectj telnet failing 5 22
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now