Solved

JNI from trusted applet

Posted on 1998-03-03
1
412 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySqlDump not dumping triggers 1 43
jsp login check 12 42
eclipse console opening separately 2 29
ejb mdb examples 1 8
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…

856 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