no sapjco3 in java.library.path

今天将一个老项目部署到一台新liunx服务器之后报错信息如下: no sapjco3 in java.library.path。

## 报错信息

Caused by: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
        at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:229)
        at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:98)
        at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
        at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:43)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at java.lang.Class.newInstance(Class.java:442)
        at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:155)
        at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:259)
        at com.pda.jco.dataprovider.MyDestinationDataProvider.<clinit>(MyDestinationDataProvider.java:27)
        at com.pda.service.impl.FunctionExecuteServiceImpl.setJCoDestination(FunctionExecuteServiceImpl.java:48)
        at com.pda.service.impl.FunctionExecuteServiceImpl.login(FunctionExecuteServiceImpl.java:114)
        at com.pda.service.impl.FunctionExecuteServiceImpl$$FastClassByCGLIB$$467dda3f.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:701)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:634)
        at com.pda.service.impl.FunctionExecuteServiceImpl$$EnhancerByCGLIB$$d898e192.login(<generated>)
        at com.pda.action.LogintomainAction.check(LogintomainAction.java:117)

## 排查思路

看着报错信息,应该与SAP交互有关,主要是sapjco3包的问题,咨询了SAP开发的小伙伴,告知win部署与liunx部署对应的jar包不同。(老的部署文档里面未说明,囧~~~)

## 解决思路

查看下正式环境liunx下的lib包,发现部署的是sapjco3.jar、libsapjco3.so

而自己是从本地部署的项目发现部署的是sapjco3.jar、sapjco3.dll

将上传到liunx的sapjco3.dll 删除,重新上传libsapjco3.so,重启tomcat解决。

SAP RFC接口对应Java jar包如下

liunx :libsapjco3.so

win:sapjco3.dll

相关资源包下载地址: sapJco3相关资料包-Java文档类资源-CSDN文库 

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

逍遥则子

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值