因为最终产品环境是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的方法,粗鲁的人可以我的办法,哈哈!
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的方法,粗鲁的人可以我的办法,哈哈!