Same User for JCo Connection pool for different applications in tomcat
I have 3 applications running on tomcat,with
UserId = TestId
All the 3 applications are designed in JSp,Struts to use JCO Connection for connecting to SAP.
During application startup time connection pool of 50 connections were created.
At any point of time Connection pool is created for ONLY ONE applycation.
For other applications i get following error.
Caused by: java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
Native Library /usr/local/sapjco/libsapjcorfc.so already loaded in another classloader
Do every application should have separate user?
What to be done to use any number of applications for same User Id.
you only can have one JCO Instance per JVM Instance
on tomcat you can achive this by removing the jco jar files from your web applications and put in to the servers lib dir - so they only get loaded once
for tomcat this should be $TOMCAT_HOME/common/lib