Help with Tomcat common lib

Hi

The Tomcat root is

/ usr/local/transendinc.com

|

-

conf webappslogs

|

-

apps1apps2WEB-INF

| | |

WEB-INF WEB-INFlib

| |

classesclasses

||

admin admin

||

adminCopy.javaadminCopy.java

As you can see, the adminCopy.java has been saved at two different locations. This is hard in terms of maintenance. Where can I place the adminCopy so that ALL of the applications can access it?

Thanks for your help.

Murthy

[530 byte] By [murthy64a] at [2007-11-26 21:35:36]
# 1

The diagram is all messed up

Here is the directory struction

Tomcat ROOT /usr/local/transendinc.om/webapps

apps1 and apps2 are applications under webapps

apps1/WEB-INF/classes/admin/adminCopy.java is same as

apps2/WEB-INF/classes/admin/adminCopy.java

Where can I place the file so that ALL the apps can access it?

I tried putting at TOMCAT_ROOT/WEB-INF/classes and it didn't work.

Thanks fo ryour help

murthy64a at 2007-7-10 3:16:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
$TOMCAT_HOME/common/classes
profluxa at 2007-7-10 3:16:12 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
> $TOMCAT_HOME/common/classesDo I need WEB-INF like$TOMCAT_HOME/common/WEB-INF/classesThanks
murthy64a at 2007-7-10 3:16:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Nope, any JAR files you put in $TOMCAT_HOME/common/lib or .class files you put in $TOMCAT_HOME/common/classes will be added to your classpath and visible to any of the webapps running on your tomcat instance.
profluxa at 2007-7-10 3:16:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

> Nope, any JAR files you put in

> $TOMCAT_HOME/common/lib or .class files you put in

> $TOMCAT_HOME/common/classes will be added to your

> classpath and visible to any of the webapps running

> on your tomcat instance.

This didn't work for me. I have to compile the other java code with adminCopy.java which happens to be the same code under two different apps. I know creating an ant script will solve the problem. But this is like using a hammer to swat a fly. Is there a simpler solution for my dilemma?

Thanks

murthy64a at 2007-7-10 3:16:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
What tool are you using to compile classes? (javac , IDE etc)Configure that tool's classpath so that it can see adminCopy.class and your project's classes also.You will need to configure the tool for every project you want adminCopy to be a part of.
appy77a at 2007-7-10 3:16:13 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...