Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
New Website 15 29
logging jar 1 106
How to disable Java updates on Server 2008 R2 Standard 1 282
Multi-threading in Tomcat 4 119
-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 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

18 Experts available now in Live!

Get 1:1 Help Now