我正在尝试部署一个使用 的应用程序原生 通过 实现 Tibrv TibrvJ 图书馆使用 Java Webstart .
我已经从 c:\tibco\tibrv\bin
内部打包了所有的 Windows dll。放入一个 Jar 文件并将这些添加到 nativelib
中的元素JNLP 文件。
我希望 webstart 会从 tibco-7.5.1-nativelibs.jar
获取 dll 文件。文件并允许它们通过 System.loadLibrary
加载从 Tibrv.open()
调用.但是,它似乎不想正常工作。
我的 JNLP 文件如下所示:
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd">
<jnlp spec="6.0+"
codebase="http://somewhere:8080/my-gui/application"
href="launch.jnlp">
<information>
<title>My GUI</title>
<vendor>Technology</vendor>
<description>Dashboard</description>
<description kind="short">Dashboard</description>
<icon href="icon/Stocks-128x128.png" />
<offline-allowed />
<shortcut online="true">
<desktop />
<menu submenu="Dashboard" />
</shortcut>
</information>
<security>
<all-permissions />
</security>
<update check="always" policy="prompt-update" />
<resources>
<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"
java-vm-args="-Xmx120M -ea />
<property name="log4j.configuration" value="live/log4j.xml" />
<property name="swing.aatext" value="true" />
<jar href="tibrvj-7.5.1.jar" />
<jar href="dashboard-gui.jar" main="true" />
</resources>
<resources>
<nativelib href="nativelib/tibco-7.5.1-nativelibs.jar" />
</resources>
<application-desc main-class="com.somewhere.Main">
<argument>classpath:/live/client.xml</argument>
<argument>/live/live.properties</argument>
</application-desc>
</jnlp>
应用程序启动,但一旦调用 open tib,它就会崩溃,并出现以下错误:
用户有 品种从 Tib 7.2 到 7.5 已经在他们的 PC 上安装了 Tib。 Webstart 应用程序只能在安装了 7.5 且与包内的 Jar 文件匹配的机器上正常工作。所以它似乎对 nativelib jar 没有任何作用。
我想避免为用户安装的不同版本的 Tib 部署 3 个版本的 web start 应用程序。
有没有其他人设法得到 的组合? TibrvJ 和 网络启动 在职的?
最佳答案
我已经设法让它工作了。问题是调用System.loadLibrary
使用 时网络启动 即使已将它们打包到 nativelib jar 中,也不会加载指定库的依赖项。
见 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6191612了解更多信息。
为了解决这个问题,有必要以正确的顺序显式加载所有依赖项。还需要将每个dll库放入自己的jar文件中。
因此,要使用 native TibrvJ,您需要在调用 Tibrv.Open
之前进行以下调用.
System.loadLibrary("msvcr71");
System.loadLibrary("tibrv");
System.loadLibrary("tibrvcm");
System.loadLibrary("tibrvft");
System.loadLibrary("tibrvcmq");
System.loadLibrary("tibrvj");
快乐的时光!
关于java-web-start - 使用 Tibco 原生库的 Java Webstart,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1399397/