具有Tibco本机Libs的Java Webstart [英] Java Webstart with Tibco Native Libs

查看:67
本文介绍了具有Tibco本机Libs的Java Webstart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 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.

我已将所有Windows dll c:\tibco\tibrv\bin内部打包到一个Jar文件中,并将它们添加到 JNLP 文件中的nativelib元素中.

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加载,而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 文件如下所示:

<?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:

  • [根本异常是TibrvException [错误= 22,message =版本不匹配:libtibrv版本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]]

从Tib 7.2到7.5,用户的PC上已经有多种的Tib安装. 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 了解更多信息.

要解决此问题,必须以正确的顺序显式加载所有依赖项.还有必要将每个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本机Libs的Java Webstart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆