Solved

JNI from trusted applet

Posted on 1998-03-03
1
416 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

630 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