[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Applet, JNLP, native library, UnsatisfiedLinkError

Asked by KhaiPi in Java Programming Language

Tags: Java, JNLP, applet

I am using Java 6 Update 16.

I have an applet from which I would like to access code in a DLL (natives-1.1.dll).  The applet is launched via JNLP and is a true applet that runs inside the browser.  I have put the DLL into a JAR (natives-1.1.jar) and signed the JAR and also signed the applet's JAR with the same certificate.  I have included a <nativelib> element in the JNLP.  However, when I try to load the library inside the applet I get an UnsatisfiedLinkError:

Validating http://localhost:8080/test/applet.jar , version null...
Validating http://localhost:8080/test/natives-1.1.jar , version null...
Exception in thread "thread MyApplet-2" java.lang.UnsatisfiedLinkError: no natives-1.1 in java.library.path
      at java.lang.ClassLoader.loadLibrary(Unknown Source)
      at java.lang.Runtime.loadLibrary0(Unknown Source)
      at java.lang.System.loadLibrary(Unknown Source)
      at MyApplet$1.run(MyApplet.java:39)
      at java.security.AccessController.doPrivileged(Native Method)
      at MyApplet.init(MyApplet.java:36)
      at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

So as you can see, it's definitely downloading the JAR containing the DLL.

The code in the applet to load the library looks like this:

AccessController.doPrivileged(new PrivilegedAction() {
    public Object run() {
        try {
            System.loadLibrary("natives-1.1");
        } catch (Exception e) {
        }
        return null;
    }
});

and the relevant JNLP entry looks like this:

<resources os="Windows" arch="x86">
      <nativelib href="natives-1.1.jar" download="eager"/>
</resources>

I am only running on a Windows x86 machine at the moment so it should work and it's definitely being downloaded as above.

Can someone tell me why the DLL is not being found?

Thanks,

KP
 
Related Solutions
Keywords: Applet, JNLP, native library, Unsati…
 
Loading Advertisement...
 
[+][-]08/22/09 08:25 PM, ID: 25161241Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Java Programming Language
Tags: Java, JNLP, applet
Sign Up Now!
Solution Provided By: objects
Participating Experts: 1
Solution Grade: A
 
[+][-]08/22/09 08:23 PM, ID: 25161236Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/22/09 08:28 PM, ID: 25161244Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/22/09 08:30 PM, ID: 25161248Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/22/09 08:31 PM, ID: 25161250Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/22/09 09:23 PM, ID: 25161353Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93 - Hierarchy / EE_QW_3_20080625