Java调用COM的中间件Jintegra初探(二)

本文介绍在WebLogic环境中部署应用时遇到的Jintegra License缺失问题及两种解决方案:一种是通过修改CLASSPATH顺序并正确配置jintegra.jar的位置;另一种是直接将License文件放入weblogic.jar内。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

因为最终产品环境是WebLogic 8.1,所以最近两天我在把原来在Tomcat 5.5上开发的东西迁移到WebLogic上,痛苦了两三天终于有点上手了,Servlet  API从2.4降为2.3等等均改好了,最后发布的时候竟然出现Jintegra没有License。Tomcat下根本没有这样的问题。
    com.linar.jintegra.Version有一个静态方法getVersion(),WebLogic中带的Jintegra是2.3的和Java ADF中的是一个版本,所以如果要用Java调用自己写的COM组件,最好还是用weblogic带的com2java来生成比较保险,虽然经过试验2.4的Proxy class也没有发现问题。
      昨天的时候我就发现WL_HOME/bin/目录下有Jintegra的com2java.exe,后来又在WL_HOME/lib/目录下的weblogic.jar中发现jintegra的classes。原本以为可以在这里找到赠送的License,结果很失望没找到。当初猜测可能是BEA和Jintegra有协议,在WebLogic中使用Jintegra不需要License,没想到今天遭遇到这样的问题。而且当我按照Jintegra安装文档想把License导入时,它只认jintegra.jar这个包,不认-cp中指定weblogic.jar。我把weblogic.jar改名为jintegra.jar后,还是报错没有JintegraLicenseTool这个class,没办法只有动粗了,用Winrar把jintegra.xml强行放到weblogic.jar的com/intrinsyc/license/这个package中,License的问题解决了。
    问题是解决了,但是我在想ESRI的人会怎么回答这样的问题呢,上UserForum上一查,还真有正大光明的解决办法:
You have to perform some additional steps for WebLogic, below is the excerpt from the Java ADF install guide.
+++++++++
Additional steps for BEA WebLogic Server users:

If you are using BEA WebLogic Server you will need to edit your commEnv.cmd file. The commEnv.cmd file is located in a similar installation location to: /bea/weblogic81/common/bin/commEnv.cmd. Open the commEnv.cmd file in a text editor and add the following line after the comments at the beginning of the file:

set AGS_HOME=/ArcGIS

For example:

set AGS_HOME=C:/Program Files/ArcGIS

Also, locate the WEBLOGIC_CLASSPATH variable setting and change it to:

set WEBLOGIC_CLASSPATH=%AGS_HOME%/java/jintegra.jar;

%JAVA_HOME%/lib/tools.jar;%WL_HOME%/server/lib/weblogic_sp.jar;

%WL_HOME%/server/lib/weblogic.jar;%WL_HOME%/server/lib/ojdbc14.jar

The jintegra.jar must be the first entry in the WebLogic classpath. Inside the jintegra.jar is the license file (jintegra.xml) for the Intrinsyc JIntegra runtime. If you want to know the version of the jintegra.jar, it can be found with this command:

java -cp jintegra.jar com.intrinsyc.license.JintegraLicenseTool view

Restart the WebLogic Server.
+++++
Antony Jayaprakash
ESRI
http://forums.esri.com/Thread.asp?c=158&f=1698&t=158834&mc=11#msgid464770

简单地讲就是让Jintegra.jar在CLASSPATH中位于weblogic.jar前面,BEA真恶心,都打到weblogic.jar中的东西也不带个试用版的License,把事情弄得这么麻烦。

要面子的可以用ESRI的方法,粗鲁的人可以我的办法,哈哈!
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值