on 07-12-2005 9:35 AM
Hello everybody.
I'm developing a Java web application where I have to access the SAP system inside a company. I'm using JCO and it works fine, but whenever I deploy the web application in Tomcat, I must restart it to work with it again. If not I get the following exception:
JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [Native Library /usr/lib/libsapjcorfc.so already loaded in another classloader]
I found some threads about this problem in the forums, and the solution was to put the SapJco.jar into tomcat commons/lib directory, not inside the WEB-INF/lib. I did that and it's still not working.
Does anyone know what to do?
Thank's in advance.
Regards.
Daniel.
There is no step by step on that link. Do you have another source?
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Daniel,
I guess you have included SAPJCO.jar file and required sapjco.dll file in your application's JAR file and deployed on the server.
So, what happen is, Every time you deployed your application, this dll file also loaded in classloader.But as this dll file is already loaded by the privious deployment, you will get this error. So, dont include this dll or jar file in your application JAR/EAR file. But give only reference to this library in your application XML file.So, at runtime it will use this library from the server, which is already loaded.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, I think that was what I did at the begining, but know I'm not including the sapjco.jar file in my application. Instead I'm including it in the shared directory of my servlet server, Tomcat. I'm not referencing the shared library inside the web.xml file, perhaps that is the problem. It works because Tomcat includes all the libraries in the commons/lib in the classloader, but I'm still getting the problem.
Can you explain me how to reference the library from the web.xml file?
Thanks.
Hi Daniel,
You have to add following XML elements in your XML file.
<application-j2ee-engine>
<reference
reference-type="weak">
<reference-target
provider-name="sap.com"
target-type="library">com.sap.mw.jco</reference-target>
</reference>
<provider-name>sap.com</provider-name>
<fail-over-enable
mode="disable"/>
</application-j2ee-engine>
We are using this in WAS server. I guess for tomcat also its similar to this only.
Regards,
Bhavik
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.