• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

Common classloader Tomcat 7 versus 6, using SAP JCO library

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I wrote some web application (based on .jsp) running on Tomcat 6 using SAP's Java Connector.
The Java Connector files (.jar und some native .dll) are placed in the tomcat/lib folder.

I wrote a custom realm for tomcat that uses the Java Connector to authorize the user
in SAP. The web application also communicates via the pre-loaded Java Connector with
SAP. All this works fine for several years now, with hundreds of users.

Now I tried to upgrade to Tomcat 7 and encountered severe problems.

After converting the realm to Tomcat 7 the realm establishes the SAP connection correctly, but
when the web application is started, a new instance of the Java Connector is established and
this instance builds a new connection to SAP.
The problem is, that the Java Connector may only run once in the JVM, so at this point only one
user can use the web application. Starting the web application from another client causes errors.

It seems, that the web application class loader ignores the already loaded and initialized classes
in the common class loader (the static variables in the classes are null at startup of the web
application, even though the realm initialized the classes).

I tried to use the shared-class loader, but the realm requires to be loaded in the common class loader.
When the realm is loaded, the shared-class loader seems not to be present.

Any suggestions what to do ?

Ralf Mertens
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problem solved.
I moved the Java Connector Files to the tomcat/bin folder.
Seems that all .jars from this folder are initialized at startup, and are accessible
for both tomcat system modules (as realms) and web-applications.

No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!