cancel
Showing results for 
Search instead for 
Did you mean: 

Same User for JCo Connection pool for different applications in tomcat

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

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

regards franz

Former Member
0 Kudos

franz,

Actually at present sapjco.jar is placed in WEB-INF\lib of all the 3 applications.

This is added to this directory in order to compile individually from my eclipse.

So,you mean this is causing the problem?

Former Member
0 Kudos

Yes, that is in fact causing the problem

remove the jar from your WEB-INF/lib

put the jar in comm/lib directory of tomcat and nowhere else and the problem should disappear

to add the jar for compilation in eclipse put the jar somewhere on your filesystem

then in Eclipse: Project -> Properties -> Java Build path -> ... add external jar ... and select the jar on the filesystem

regards franz

...close thread if problem is solved

Former Member
0 Kudos

Frez,

This is resolved the problem.

But when i deliver the application ,i make jar and provide to customer.

Customer may deploy it on linuc or on windows.

during development i keep all jars in common folder line d:
eclispse_lib

This will be used for compilation.

There is no provision for compilation at customer site,so can i make jar and deploy directly at customer site and advice to place the jar in the common directory..<tomcat_dir_path>\common\lib

Is this correct way ?.

Former Member
0 Kudos

This is working on windows system..

This is not working if the same application is moved to linuxsystem..

All JCO Related Jars were added in

/usr/local/catalina/common/lib/ folder.

librfccm.so

libsapjcorfc.so

sapjco.jar

were added in /usr/local/catalina/common/lib/ folder..

Since my struts application creates connection pool through struts plugin class during application startup time.I get following error.

I get below error since i did not get reference to sapjco.jar during application startup time and i get java.lang.NoClassDefFoundError: .

look at struts.log

2008-10-16 13:19:55,478ERRORorg.apache.struts.action.ActionServlet~ Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.

java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO$Exception

Any thoughts ?

Edited by: Raghu v on Oct 16, 2008 2:14 PM

Former Member
0 Kudos

Hi

You will have to make a reference for your JCO library in application's EAR application-j2ee-engine.xml file.

<reference 
		reference-type="hard">
		<reference-target 
			provider-name="sap.com" 
			target-type="library">com.sap.mw.jco</reference-target>
	</reference>

Thanks

Answers (0)