带有 Tibco Native Libs 的 Java Webstart

发布于 2024-08-04 10:39:03 字数 2491 浏览 7 评论 0原文

我正在尝试使用 Java Webstart 通过 TibrvJ 库部署一个使用 Tibrv 本机实现的应用程序。

我已将 c:\tibco\tibrv\bin 中的所有 Windows dll 打包到一个 Jar 文件中,并将它们添加到 nativelibJNLP 文件中的 > 元素。

我希望 webstart 能够从 tibco-7.5.1-nativelibs.jar 文件中获取 dll 文件,并允许通过 System.loadLibrary< 加载它们/code> 从 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> 

应用程序启动,但一旦调用打开 tib,它就会崩溃,并出现以下错误:

  • [根异常是 TibrvException[错误=22,message=版本不匹配: libtibrv 版本 7.4 与 tibrvj 共享库 7.5 的版本不匹配]]

  • TibrvException[error=901,message=未找到库: tibrvj]]

用户有各种各样的情况 他们的 PC 上已安装了从 Tib 7.2 到 7.5 的 Tib。 Webstart 应用程序仅在安装了 7.5 且与包内的 Jar 文件匹配的计算机上才能正常工作。所以它似乎没有对 nativelib jar 做任何事情。

我希望避免为用户安装的不同版本的 Tib 部署 3 个版本的 Web Start 应用程序。

还有其他人设法让 TibrvJWebstart 的组合发挥作用吗?

I am trying to deploy an application that uses the native implementation of Tibrv through the TibrvJ library using Java Webstart.

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.

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.

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> 

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 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=Library not found: tibrvj]]

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.

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.

Has anyone else managed to get this combination of TibrvJ and Webstart working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薆情海 2024-08-11 10:39:03

我已经成功让它发挥作用了。问题在于,使用 Webstart 时对 System.loadLibrary 的调用不会加载指定库的依赖项,即使它们已打包到 nativelib jar 中。

请参阅https://bugs.java.com/bugdatabase/view_bug?bug_id=6191612 了解更多信息。

为了解决这个问题,有必要以正确的顺序显式加载所有依赖项。还需要将每个dll库放入自己的jar文件中。

因此,要使用本机 TibrvJ,您需要在调用 Tibrv.Open 之前进行以下调用。

    System.loadLibrary("msvcr71");
    System.loadLibrary("tibrv");
    System.loadLibrary("tibrvcm");
    System.loadLibrary("tibrvft");
    System.loadLibrary("tibrvcmq");
    System.loadLibrary("tibrvj");

快乐的日子!

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.

See https://bugs.java.com/bugdatabase/view_bug?bug_id=6191612 for more info.

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.

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");

Happy Days!

蓝眼睛不忧郁 2024-08-11 10:39:03

我认为您在使用 Webstart 时遇到了问题。

几年前,我有一个使用 Java 3D 的 Webstart 应用程序,但它无法在 Mac 上运行。最终我发现所有 Mac 都安装了旧版本的 Java 3D,并且已安装的版本用于覆盖我包含在 JNLP 文件中的新版本。您的问题听起来几乎与此完全相同,因此很可能是同一个问题。

I think you have encountered a problem with Webstart.

Some years ago, I had a Webstart application using Java 3D that didn't work on Macs. Eventually I found that all Macs some with an old version of Java 3D installed, and that already installed version was used over the newer version that I had included in the in my JNLP file. Your problem sounds almost exactly like this, so it could very well be the same problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文