Solved

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

Posted on 2004-04-07
3
1,764 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jBoss vs. other App Servers 11 399
error when deploying 23 941
how to check weblogic application stop/start status in python 1 121
need to apply latest fix to websphere 7 2 99
-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 …
Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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