当前位置 - 養生大全網 - 養生之道 - jco連接sap失敗

jco連接sap失敗

jco連接SAP時,請務必將文件:sapjcorfc.dll,librfc32放到C:\WINDOWS\system32\下邊。

否則報錯如下:

xception in thread "main" java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'

JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [C:\WINDOWS\system32\sapjcorfc.dll: Can't find dependent libraries]. java.library.path [E:\eplat\JDK1.6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;E:\eplat\JDK1.6\jre\bin;D:/Program Files/Java/jdk1.6.0_12/bin/../jre/bin/client;D:/Program Files/Java/jdk1.6.0_12/bin/../jre/bin;D:/Program Files/Java/jdk1.6.0_12/bin/../jre/lib/i386;D:\oracle\product\10.2.0\db_1\bin;D:\OraHome_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;D:\Program Files\SecureCRT\;D:\Program Files\Tcent\QQPCMgr\6.8.2385.401;.;D:\Program Files\Java\jdk1.6.0_12\bin;D:\Program Files\Java\jdk1.6.0_12\jre\bin;;D:\Program Files\Tcent\QQPCMgr\6.8.2385.401]

at com.sap.mw.jco.JCO.<clinit>(JCO.java:776)

at com.magicoo.sale.sap.SAPConnect.getSAPPoolConnection(SAPConnect.java:13)

at com.magicoo.sale.service.YdmerchanlayerjkService.findFromSap(YdmerchanlayerjkService.java:21)

at com.magicoo.sale.service.YdmerchanlayerjkService$$FastClassByCGLIB$$f845a752.invoke(<generated>)

at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:696)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:631)

at com.magicoo.sale.service.YdmerchanlayerjkService$$EnhancerByCGLIB$$5d826ddb.findFromSap(<generated>)

at com.magicoo.sale.Test.main(Test.java:20)