Solved

JNI from trusted applet

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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 will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

734 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