开发者

Deploy Java Web Applet with Third Party Dependencies

I have made a Java Applet that depends on some third party libriaries as well as 开发者_运维技巧a DLL that is called via JNI. These will obviously not be installed on clients computers. Is there anyway to package these third party libriaries and external DLLs within my Applet's JAR so that it can be run by any client with a base Java install?


Using JNI within a web application is a recipe for heartburn, particularly in Windows.

  • You obviously can't deploy the DLL within your WAR file and will probably require a separate installer be run by the deployer beforehand.
  • You'll have to ensure that your java.library.path is setup correctly, which is usually done by settings in the application server rather than something deployable in the WAR file.
  • The way that JNI links the native class with the library will cause class loader headaches if you try to run more than one instance of that web application. One way to work around this is to move the containing JAR file into a shared class loader (like Tomcat's common folder) but that has its own complications.


Is there anyway to package these third party libriaries

In Eclipse, under the Java project properties (right click), I can do a:

 Export... => Export as Runnable JAR

Then I tell it to pack my jar dependencies into that exported JAR. The exported JAR will have all its dependencies packed into it.

alt text http://www.ubuntu-pics.de/bild/97131/selection_016_mg6IDm.png


I am no expert on the topic, but there are working solutions to all these problems. They might give you a headache, but some things can only be done this ways (and I am quite sure that your problem with the Entrust CSP is one of those).

You can take a look at OpenSign from the OpenOCES-project. The magic happens in org.openoces.opensign.client.applet.bootstrap.

I also believe that JNLPAppletLauncher solves the same problem, but I have no experience with i.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜