Solved

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

Posted on 2004-04-07
3
1,761 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How following rewrite rule works in Apache? 7 121
Problem to refer to codes 10 120
Weblogic Logs 4 144
How do you get SOAP Header in Library call 4 116
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.…
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 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