tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand B N <ana...@learningbyte.com>
Subject Tomcat 4 problems accessing Deployer reference
Date Fri, 31 Aug 2001 06:16:41 GMT
Hi,

I'm stuck with my "Classes" problem in tomcat 4.

As I mentioned earlier the whole thing works fine in a IDE environment like 
JBuilder but when I make them jars and put them in a standalone Tomcat 4 
envrn it doesn't work.

Here's what I am doing:-

I have a JSP that invokes a method in a JavaBean which in turn contacts a 
Singleton class to get handles on Deployer  object to get all available 
contexts. Here's the code snippet:-

       1.Context context;
       2.Deployer deployer = TomcatManager.getSharedInstance().getDeployer();
       3. System.out.println(deployer);
       4. String contextPaths[] = deployer.findDeployedApps();
       5. casInstanceList = new Array();
       6. response = new ResponseObject();
       7.  for (int i = 0; i < contextPaths.length; i++) {
       8.   context = 
TomcatManager.getSharedInstance().getDeployer().findDeployedApp(contextPaths[i]);
       9.   casInstanceList.add(context);
       10. }

Here TomcatManager get's initialized by a Servlet[which  implements the 
ContainerServlet interface] on startup.

Sequence of Events:-
On startup
1. Servlet intializes and set's the reference of Tomcat Maanger's Deployer 
and other objects

 From the webapp -
2. JSP is called and it invokes a JavaBean that invokes method on 
TomcatManager to obtain the Deployer reference
3. deployer.finDeployedApps() and now the expcetion is thrown.

As I told earlier I tried the following:-

1. Since my Javabean uses Deployer and Context classes I put them also in 
common/classes aprt from them being a part of catalina.jar. I get a linkage 
error("loader constraints violated")

2. I remove these and it says "class not found"

That's the whole picture and I'm not sure if I'm getting the solution as 
mentioned but Craig earlier.

Thanks

Anand


Mime
View raw message