0

我正在尝试使用 java 程序名称 JavaCANativeDispatcher 在我的 Web 应用程序上测试 CorrectAddress API。在 Linux 环境下的 jboss 应用服务器上部署了这个 .war 文件。

CorrectA 的位置如下 - /apps/jboss-5.1.0.GA/IstCorrectAddress/libCorrectA.so
/apps/jboss-5.1.0.GA/IstCorrectAddress/Data/CorrectAddressData

路径设置在 bashrc 中,代码如下 -# .bashrc

# Source global definitions  
if [ -f /etc/bashrc ]; then
    . /etc/bashrc
fi


# User specific aliases and functions

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/apps/jboss-5.1.0.GA/IstCorrectAddress/libCorrectA.so;
export LD_LIBRARY_PATH;
export CA_DATA=/apps/jboss-5.1.0.GA/IstCorrectAddress/Data;

当最终用户通过浏览器(从 windows )运行此应用程序时,它会在 server.log 上引发以下错误-

 2013-07-23 15:06:21,830 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].        [localhost].[/].[Controller]] Servlet.service() for servlet Controller threw exception
java.lang.UnsatisfiedLinkError:         com.gfw.biz.JavaCANativeDispatcher.FindCityCounty([C[C[C[C[C)I
    at com.gfw.biz.JavaCANativeDispatcher.FindCityCounty(Native Method)
    at com.gfw.biz.JavaCANativeDispatcher.CallFindCityCounty(JavaCANativeDispatcher.java:487)
    at com.gfw.jsp.Address.standardize(Address.java:113)
    at com.gfw.jsp.actions.SetMailOptOutsAction.validate(SetMailOptOutsAction.java:385)
    at com.gfw.jsp.actions.SetMailOptOutsAction.execute(SetMailOptOutsAction.java:97)
    at com.gfw.jsp.Controller.processRequest(Controller.java:72)
    at com.gfw.jsp.Controller.doPost(Controller.java:114)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Unknown Source)

注意 - 如果我通过给出命令 java JavaCANativeDispatcher 在 linux 服务器上运行程序 JavaCANativeDispatcher 它工作得很好。我只为运行这个程序做了 -

   export CA_DATA=/apps/jboss-5.1.0.GA/IstCorrectAddress/Data  

似乎缺少配置或设置中的某些内容。请建议。

4

1 回答 1

0

需要设置tomcat的路径-

export PATH=$PATH:$LIBPATH
CLASSPATH=$CLASSPATH:$CA_DATA export LD_LIBRARY_PATH=$LIBPATH export CA_DATA=/apps/apache-tomcat-7.0.42/shared/IstCorrectAddress/Data export JAVA_OPTS="-Djava.library.path= /apps/apache-tomcat-7.0.42/shared"

于 2014-03-24T19:34:07.337 回答