Exception in thread "main" java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.ExceptionInInitializerError: Illegal JCo archive "sapjco3-6.0.0-SNAPSHOT.jar". It is not allowed to rename or repackage the original archive "sapjco3.jar".
The problem here is SAP has added code to check if the jar file is renamed. If you add this jar file this way to your studio, it will use the standard Maven functionality and this cause a rename of the jar to the pattern artifactId-version.jar
I would like to create and send an IDOC for which I need sapjco3.jar and sapidoc3.jar. But i am unable to find it. Could anyone please share or help me in getting these files ASAP. I am in urgent need of them. Thanks in advance.
sapjco3.jar and sapidoc3.jar are part fo so called SAP JAVA Connector (JCo). You can download it on service.sap.com/connectors. Under Tools menu. However notice that you need to have an SAP SMP (Market Place) valid account to do that. Plus you need to be authorized to do so.
I'm sure I have to install sapjco3.jar and it's corresponding .so file on the Linux server running the TAC, too. But where do I have to put the files? The documentation only describes where to copy them for TalendStudio. We're are running TAC version 6.2.1.
Also you can try to install SAP JCO on TAC machine of course. First step to install on OS is the same as for Studio. And after you can try to put sapjco3.jar to /lib folder and change start_rs.bat with adding this jar to MY_CLASSPATH.
After putting sapjco3.jar in /lib and adding it to MY_CLASSPATH the status hasn't changed. I double checked that sapjco3.jar is in the classpath - log entry "java.class.path=..." shows that it contains sapjco3.jar. I checked the file permissions. I checked that sapjco3.jar contains the requested com.sap.conn.jco.ext.DestinationDataProvider class.
2019-12-16 13:04:21 ISTwm.sap.Admin:registerLocalConnection
WmSAP Adapter: Error on creating new Object: [ART.118.5042] Adapter Runtime (Connection): Unable to enable connection resource wm.sap.internal.cs:emptyConnection.
[ART.118.5022] Adapter Runtime (Connection): Cannot create connection wm.sap.internal.cs:emptyConnection. Adapter type WmSAP does not exist.
[ART.118.5042] Adapter Runtime (Connection): Unable to enable connection resource wm.sap.internal.cs:emptyConnection.
[ART.118.5022] Adapter Runtime (Connection): Cannot create connection wm.sap.internal.cs:emptyConnection. Adapter type WmSAP does not exist.
Caused by: com.wm.pkg.art.error.DetailedException: [ART.118.5022] Adapter Runtime (Connection): Cannot create connection wm.sap.internal.cs:emptyConnection. Adapter type WmSAP does not exist.
Before placing a new version of sapjco3.dll under Windows/system directory, take a backup of an existing file just for the case that this might be needed by another SAP application installed on that system.
Although seniors already provided information on this blog. Would like to add my comments here.
We have prepared 10.3 environments recently and to enable SAP Adapters on 10.3 servers we need to place 3 files (2 Jar and one another) in two directories, with additional SAP_10.1_Fix3.
All these must be present in the server in order for WmSAP package to load successfully. Please bear in mind especially for sapjco3.jar there are different flavors for different platforms. You cannot take a jar file for Windows and put it in linux server and expect it will work.
Once you are done, try to restart the server and test the connection again.
Also, you need to verify whether your WebM system is allowed to have a connection with SAP system. There are many specific settings are required there end as well.
SAP Adapter 10.1 is not available on IS 9.6. You will have to use SAP Adapter 7.1 with latest Fixes which should allow for the latest SAP JCo 3.0.x libs.
JCo 3.1.x libs seems to be only supported on SAP Adapter 10.1 with Fix or newer.
SAP Adapter 10.1 requires IS 10.1 or newer.
"Hello, I have just installed JCO 3 on my laptop. I have download the latest version of JAVA from sun.com. Java functions correctly and can compile a simple JAVA file. Though when I check the JCO it fails to find the library when using the sapjco3.jar file and java -jar sapjco-install-path/sapjco3.jar. Details of error output are below: C:Documents and Settingswnash>java -jar c:tempsapjco-install-pathsapjco3.jar java.lang.UnsatisfiedLinkError: C:tempsapjco-install-pathsapjco3.dll: This ap plication has failed to start because the application configuration is incorrect . Reinstalling the application may fix this problem at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(Unknown Source) 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:987) at com.sap.conn.rfc.driver.CpicDriver.
Hi Warren and Desai, I had followed your guid and i installed windows installer WindowsXP-KB942288-v3-x86.exe->reboot ->doublw click vcredist_x86.exe but i still had same error JCO 3 problems with Library - UnsatisfiedLinkError. Could you detail how did you fixed that issue. Thanks a lot and Best Regard.
Very strange, I use your link and the file size for the file has increased
by 2KB. I had downloaded previously but it seemed to just cancel mid-way.
So I downloaded the 2008 version of the file and I still had problems.
This time Microsoft told me to also install the Windows Installers, which I
did first and then double clicked on the vcredist_x86.exe and it worked, now
I can see my library being used. Next is to test a BAPI from Java into SAP.
We would like to use Hibersap together with the latest SAP JCo which is version 3.0.11.
However, to some extremly strange quirk SAP decided to name the jar file sapjco3.jar and also hardcoded this name into its code and verify it at startup.
This in turn means we can't set up a proper maven dependency for sapjco and its current version.
Renaming the jar to sapjco-3.0.11.jar leads to a runtime exception: "java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.ExceptionInInitializerError: Illegal JCo archive "sapjco-3.0.11.jar". It is not allowed to rename or repackage the original archive "sapjco3.jar"."
Hi Thomas,
this is really a strange thing which SAP does here. I haven't tried with JCo 3.0.11 yet. As a first workaround you could try configuring the maven-dependency-plugin with the stripVersion attribute, which should have the effect that all version numbers of the dependent libs are stripped. Right now I can't test it myself, but maybe it's a starting point.
See: -dependency-plugin/copy-dependencies-mojo.html#stripVersion
"The recent JCo release includes an additional technical check by
intention and will not be removed. It was never allowed to rename or
repackage SAP software archives and because we ran into issues within
some customer scenarios who did nevertheless, we will now prevent this
technically with adding a check. Renaming or repackaging of the JCo
archives may cause strange error situations and results in upatchable
installations.
It should be possible to adapt the project build environment for also
dealing with the new JCo archives.
The maven-dependency-plugin configuration in pom.xml file can be
modified with adding the option true
for copying the JCo artifacts.
Further information is available externally at
-dependency-plugin/usage.html .
Please note that this is not an issue with SAP software but with Maven
build environment configuration only. So if the above information is
not sufficient for resolving the issue, I would like to ask you to
address the Maven community for further help and assistance with this."
If you try to work around the SAP-JCo-Problem, try to manually handle just the Hibersap lib and rely on Maven for the rest (adding the needed libs as Maven dependencies). So you just have to do the manual copy & classpath process for the JCo lib.
One approach is to download just sapjco3.jar from the local Maven repo using the maven-dependencies-plugin to, e.g. target/lib renaming it to sapjco3.jar and then add it to the project dependencies like this:
The check in JCo allows the jar to either be named "sapjco3.jar", to start with "com.sap.conn.jco", or to be named "sapjco3_IDE.jar". So for now I deploy the JCo jar to the Maven repository with a Maven artifactId of "com.sap.conn.jco.sapjco3" and it works.
but when i start the server(developed in springboot),the new exception occur like below:
JCo initialization failed with java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path
Can you please post your whole deploy command line, or pom file for deploy including groupId and version? Then post how you build the dependency to get the artifact (with long artifactId) you just deployed?
The SAP Java Connector (SAP JCo) is a toolkit that allows a Java application to communicate with any SAP system.It combines an easy to use API with unprecedented flexibility and performance. The package supports both, Javato SAP System as well as SAP System to Java calls.- All SAP Connectors are licensed without additional license fees as part of the respective solution or component license.However, please note that each connector may be used only for connecting external (non-SAP) applications to SAP Systems /SAP Solutions. Scenarios, in which two external (non-SAP) applications are integrated via an SAP Connector, are not allowed.- The redistribution of any connector is not allowed.- All SAP users accessing application functionality through the relevant connector are required to be licensed under arespective solution or component license.To use the SAP JCo with the Hibersap project, you need to either install the SAP JCo jar downloaded from SAP to your localMaven repository (variant a) or deploy it to e.g. an enterprise Maven repository like Nexus or Artifactory (variant b):(a) mvn install:install-file -DgroupId=org.hibersap -DartifactId=sapjco3 -Dversion=3.0.12 -Dpackaging=jar -Dfile=path/to/sapjco3.jar(b) mvn deploy:deploy-file -DrepositoryId=[your.repo.id] -DgroupId=org.hibersap -DartifactId=sapjco3 -Dversion=3.0.12 -Dpackaging=jar -Dfile=sapjco3.jar
64591212e2