5

I have the jar and dll in the Talend lib directory. The path and classpath are set. I also have downloaded and installed the VC++ 2005 redistribution sp 1 patch and the missing dlls that are supplied by SAP. I have tried to run this ETL job on a windows 2003 machine and on a XP machine with the same result. Can anyone help me out here.

Starting job Chargebacks at 13:57 03/10/2014.

[statistics] connecting to socket on port 3350
[statistics] connected
java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at com.sap.conn.jco.rt.DefaultJCoRuntime.loadLibrary(DefaultJCoRuntime.java:441)
    at com.sap.conn.jco.rt.DefaultJCoRuntime.registerNativeMethods(DefaultJCoRuntime.java:307)
    at com.sap.conn.jco.rt.JCoRuntime.registerNatives(JCoRuntime.java:969)
    at com.sap.conn.rfc.driver.CpicDriver.<clinit>(CpicDriver.java:955)
    at com.sap.conn.rfc.engine.DefaultRfcRuntime.getVersion(DefaultRfcRuntime.java:43)
    at com.sap.conn.rfc.api.RfcApi.RfcGetVersion(RfcApi.java:261)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:200)
    at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:73)
    at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
    at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)
    at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)
    at jdi.chargebacks_0_1.Chargebacks.tSAPConnection_1Process(Chargebacks.java:361)
    at jdi.chargebacks_0_1.Chargebacks.runJobInTOS(Chargebacks.java:3718)
    at jdi.chargebacks_0_1.Chargebacks.main(Chargebacks.java:3577)
Exception in thread "main" java.lang.ExceptionInInitializerError: Error getting the version of the native layer: java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
    at com.sap.conn.jco.rt.MiddlewareJavaRfc.<clinit>(MiddlewareJavaRfc.java:212)
    at com.sap.conn.jco.rt.DefaultJCoRuntime.initialize(DefaultJCoRuntime.java:73)
    at com.sap.conn.jco.rt.JCoRuntimeFactory.<clinit>(JCoRuntimeFactory.java:23)
    at com.sap.conn.jco.rt.RuntimeEnvironment.<init>(RuntimeEnvironment.java:40)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at com.sap.conn.jco.ext.Environment.getInstance(Environment.java:121)
    at com.sap.conn.jco.ext.Environment.registerDestinationDataProvider(Environment.java:216)
[statistics] disconnected
    at jdi.chargebacks_0_1.Chargebacks.tSAPConnection_1Process(Chargebacks.java:361)
    at jdi.chargebacks_0_1.Chargebacks.runJobInTOS(Chargebacks.java:3718)
    at jdi.chargebacks_0_1.Chargebacks.main(Chargebacks.java:3577)
Job Chargebacks ended at 13:57 03/10/2014. [exit code=1]
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
user1082748
  • 365
  • 1
  • 7
  • 18

1 Answers1

4

First make sure you have the .jar file in \lib\java\ If you're on windows, you should place the dll and the sapjco3.jar to PATH If you're on linux, you need to place the .so files into your path.

  • copy sapjco3.jar into talend lib/java folder and make sure that sapjco3.dll is in the %PATH% (quick and dirty place it in windows\system32\ )
  • test it by double clicking sapjco3.jar it should show information about the location of the jar and the location of the dll

Common problems with Talend OS and sapjco3: You need 32bit version if you're running a 32bit JAVA. 64bit version if you have 64bit java.

Balazs Gunics
  • 2,017
  • 2
  • 17
  • 24
  • Thanks for the answer. I added the jar and dll to the Talend lib\java folder. I double clicked on the jar like you said and I am getting "not found" in the Path to Jco Library variable. But the dll is there in the same folder. I added the path the the Talend lib\java folder to the path env. variables but it didn't make any changes. How do we set the path to Jco Library – user1082748 Oct 06 '14 at 00:16
  • Ok. I installed Talend on another xp computer and double clicked on the jar sapjco3.jar file. I added the dll and jar file in the lib\java folder. All the variables were set and I was not getting any errors. However when I run my job, i am still getting the same error message from inside Talend. – user1082748 Oct 06 '14 at 01:00
  • Ok I restarted to computer after setting the path and added the lib\java to the Talend path variable. – user1082748 Oct 06 '14 at 01:09
  • Thats why I suggested using system32 to store the .dll (and the .jar since sap recommends having these 2 files in the same folder.) I'm happy you got it working. – Balazs Gunics Oct 06 '14 at 06:21
  • Another possibility is to ship the lib along with the war file. Btw. system specific files plus the fact that you cannot rename them. Those clowns know how mess up badly. – s.Daniel Dec 07 '15 at 21:13
  • Don't forget that licensing prohibit redistributing these files. – Balazs Gunics Dec 08 '15 at 10:07
  • 4
    Down voted because of the suggestion to copy the file to \Windows\System32 folder. You should NOT mess with the Operating System to make your application work. This is a bad practice and there is a note in the SAP Connector documentation to not copy the file to this place. – Diego Queiroz Jul 17 '17 at 22:20