带有 Tibco Native Libs 的 Java Webstart [英] Java Webstart with Tibco Native Libs
问题描述
我正在尝试使用 Java Webstart 通过 TibrvJ 库部署使用 Tibrv 的本机实现的应用程序.
I am trying to deploy an application that uses the native implementation of Tibrv through the TibrvJ library using Java Webstart.
我已将 c:\tibco\tibrv\bin
中的所有 Windows dll 打包到一个 Jar 文件中,并将它们添加到 nativelibJNLP 文件中的
元素.
I have packaged up all of the Windows dlls from inside c:\tibco\tibrv\bin
into a Jar file and have added these to the nativelib
element in the JNLP file.
我希望 webstart 能够从 tibco-7.5.1-nativelibs.jar
文件中获取 dll 文件,并允许它们通过 System 加载.loadLibrary
从 Tibrv.open()
调用.但是它似乎不想正常工作.
I was hoping that webstart would take the dll files from thetibco-7.5.1-nativelibs.jar
file and allow them to be loaded via System.loadLibrary
which is called from Tibrv.open()
. However it doesn't seem to want to work properly.
我的 JNLP 文件如下所示:
My JNLP file looks like this:
<?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>
应用程序启动,但一旦调用打开 tib 就会崩溃,并出现以下错误:
The application launches but as soon as a call is made to open tib then it falls apart with an error along the lines of:
[Root 异常为 TibrvException[error=22,message=Version mismatch: libtibrv version 7.4 与 tibrvj 共享库 7.5 的版本不匹配]]
[Root exception is TibrvException[error=22,message=Version mismatch: libtibrv version 7.4 does not match version of tibrvj shared library 7.5]]
TibrvException[error=901,message=未找到库:tibrvj]]
TibrvException[error=901,message=Library not found: tibrvj]]
用户已经在他们的 PC 上安装了各种的 Tib,从 Tib 7.2 到 7.5.Webstart 应用程序只能在安装了 7.5 且与包内的 Jar 文件匹配的机器上正常工作.所以它似乎对 nativelib jar 没有任何作用.
The users have a variety of Tib installations already on their PCs from Tib 7.2 through to 7.5. The Webstart Application only works correctly on a machine with 7.5 installed which matches the Jar file inside the package. So it doesn't appear to do anything with the nativelib jar.
我想避免为用户安装的不同版本的 Tib 部署 3 个版本的 web start 应用程序.
I would like to avoid having to deploy 3 versions of the web start application for the different versions of Tib that the users have installed.
有没有其他人设法让 TibrvJ 和 Webstart 的这种组合工作?
Has anyone else managed to get this combination of TibrvJ and Webstart working?
推荐答案
我已经设法让它发挥作用.问题是在使用 Webstart 时调用 System.loadLibrary
不会加载指定库的依赖项,即使它们已打包到 nativelib jar 中.
I've managed to get it working. The trouble is that the call to System.loadLibrary
when using Webstart doesn't load in the dependencies of the specified library even if they have been packaged up into a nativelib jar.
请参阅 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6191612 了解更多信息.
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6191612 for more info.
为了解决这个问题,有必要以正确的顺序显式加载所有依赖项.还需要把每个dll库放到自己的jar文件中.
To get around this problem it is necessary to explicity load all of the dependencies in the correct order. It is also necessary to put each dll library into its own jar file.
因此要使用原生 TibrvJ,您需要在对 Tibrv.Open
进行任何调用之前进行以下调用.
So to use native TibrvJ you need to make the following calls before any calls to Tibrv.Open
.
System.loadLibrary("msvcr71");
System.loadLibrary("tibrv");
System.loadLibrary("tibrvcm");
System.loadLibrary("tibrvft");
System.loadLibrary("tibrvcmq");
System.loadLibrary("tibrvj");
快乐的日子!
这篇关于带有 Tibco Native Libs 的 Java Webstart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!