Solved

WEB-INF/lib : Jar location problem for mqccf.jar

Posted on 2004-04-07
3
1,754 Views
Last Modified: 2013-12-10
Hi all,

We are migrating our websphere 4.0 to websphere 5.0.1 and also WSAD4.0 to WSAD 5.0. We have one project which uses mqccf.jar that comes with VA for java 3.x version. we used to to include this jar in application classpath. with websphere 5.0.1 migration, I put this mqccf.jar file in application class path. with this change I am not even able to start my app server. The reason might be it is over writing mq.jar which is used by embeded JMS server.

Then I put the jar file in WEB-INF/lib. Now I am able to start my app server. But my classes unable to find classes avaible in mqccf.jar.So i am getting below exception.

[4/6/04 19:24:13:621 EDT]    c05c2 ExceptionUtil E CNTR0020E: Non-application exception occurred
 while processing method "getQueueDepthForMonitoring" on bean "BeanId(CRMSMS#CRMSMSEJB.jar#CRMMe
ssaging, null)". Exception data: java.lang.NoClassDefFoundError: com/ibm/connector/mq/MQCommunic
ationErrorException

My Questions are

*) How websphere app server locates jar files available in WEB-INF/lib?
*) why I am unable to start my app server if I include VA for Java mqccf.jar in my app server classpath?

Please suggest me a solution for this problem.


Thanks in advance,
Ravi Kothyala






0
Comment
Question by:kothyala
3 Comments
 
LVL 4

Accepted Solution

by:
pluim earned 500 total points
ID: 10775947
From the symptoms you're describing, WAS doesn't start because the mqccf.jar is taking precedence over mq.jar if you put it in the app server classpath.
The older mqccf.jar doesn't have the necessary functions/ classes/ implementation, causing WAS to fail.

The error you're getting when you put the jar in WEB-INF/lib suggests that WAS is selecting mq.jar before mqccf.jar, i.e. the app server classpath takes precedence over WEB-INF/lib. The setup you want is
(a) application server uses mq.jar
(b) application uses mqccf.jar

Take a look at the article J2EE class loading demystified (http://www-106.ibm.com/developerworks/websphere/library/techarticles/0112_deboer/deboer.html).
Relevant section:

-------
The most important concept in Figure 1 above is that each classloader is defined as a child of the classloader above it. A classloader can have delegation turned on or off. The first two classloaders (Java and WebSphere) have it turned on and the last two (AEX and module) have it turned off.

When delegation is turned on, the classloader first delegates the request to its parent classloader. If none of the parent classloaders can find the class, the original classloader attempts to load the class.

When delegation is turned off, the classloader first attempts to load the class itself. If it can't load the class, it asks its parent to load the class.
In either case, requests can only go up the tree; they cannot go down. If the WebSphere classloader is requested to find a class in a J2EE module, it cannot go down to the module classloader to find that class, and a ClassNotFoundException will occur. After a class is loaded by a classloader, any new classes that it tries to load will reuse the same classloader, or go up the chain until the class is found.
-------

To accomplish what you want, you need to turn delegation OFF. All this assumes mqccf.jar can actually co-exist in this environment. If there is a real compatibility problem, then solving the classloader issue won't help.

0
 
LVL 4

Expert Comment

by:greyfairer
ID: 10806684
Jars that are in WEB-INF/lib are found by the classloader for the web module it is contained in, not for the entire ear.  Since you need to access them from an EJB (I assume -> CRMSMSEJB.jar), you have to make it available for the ejb-jar.  One solution that should work, is to include mqccf.jar as a dependency jar in your ear, that is, at the same level as your ejb jar, and reference it from the META-INF/MANIFEST.MF in a Classpath entry:
Class-Path: mqccf.jar

When starting the EJB Module, the classloader will read this section, and will try to locate the dependendcy jar relative to the ear root. See also http://www.theserverside.com/articles/content/J2EE-Deployment/chapter.html
0
 

Author Comment

by:kothyala
ID: 10816769
Thanks a Bunch...It really saved my time.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now