Sharing EJB Class Names Within Different Enterprise Applications
 Technote (FAQ)
 
Problem
If two Enterprise Applications containing EJB modules that share EJB class names are deployed on the same Application Server, then ClassCastException errors may be raised or unexpected EJB behavior may occur.
 
Cause
By default, each Application Server contains just one EJB classloader. As a result the common EJB class names in the different EARs will be loaded by the same classloader, and only the common EJB classes nearer the beginning of the classpath will be loaded.
 
Solution
This behavior can be changed by disabling class sharing on the Application Server, which is achieved by setting the Application Server's JVM property, com.ibm.ws.classloader.classSharing, to false. To set this property navigate through the Administrative Console's topology tree to the Application Server whose classloading behavior change:

WebSphere Administrative Domain -->

Nodes -->

{nodeName} -->

Application Servers -->

{applicationServerName}

Select the {applicationServer} to display its configuration on the right side of the Administrative Console.

Select the JVM Settings Tab, and scroll down until you see the button labeled "Advanced JVM Settings...". Press the Advanced JVM Settings button. The Advanced JVM Settings configuration window opens.

Add the following string to the text entry field labeled "Command line arguments:": Dcom.ibm.ws.classloader.classSharing=false

Press the OK button on the Advanced JVM Settings configuration window.

Press the Apply button on the Administrative Console's server configuration panel.

Restart the Application Server to start using the new property.

 
 
Historical Number
PMR 82651
004
000
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Classloader
Operating system(s): HP-UX
Software version: 4.0
Software edition:
Reference #: 1080769
IBM Group: Software Group
Modified date: Mar 29, 2005