On 8/21/2013 12:58 PM, D C wrote:
Tomcat 7.0.40
CentOS 6.3
Java 1.7.0_21


I am trying to move all libraries out of my webapps directory, and into a
common place.

I have my libs that were bundled with tomcat in /tomcat/lib (the default),
and my extra libs i want to keep in /web/lib.

I've updated /tomcat/conf/catalina.properties to use the following:
common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,/web/lib,/web/lib/*.jar

I have my database resource located in
/tomcat/conf/Catalina/localhost/myApp.xml  (probably not relevant)

When I start tomcat, I get the errors listed below.  However if I move
/web/lib/*  to webapps/myApp/WEB_INF/lib/  it works fine.

What am I missing here?
Thanks,
Dan


First of all, don't do this.

Seriously, there are really no good reasons to do this and many, many reasons not to.

Now, let's look at where you put your jars:

You said you put them in /web/lib - where is /web/lib located?

In the above catalina.properties line, you added:

/web/lib/*.jar

This is an absolute path, where /web is at the root of your file system.

I doubt you a) meant to put the JARs there, and b) have read permission on that directory should it even exist. You have three options for describing the directory location:

${property.name}/directory/. . . . ./*.jar

where property.name is either catalina.home or catalina.base.

some-other-directory/. . . ./*.jar
../some-other-directory/. . . ./*.jar

where the location is relative to catalina.base ($CATALINA_BASE).

/some-absolute-directory/path/*.jar

which just as it says, is an absolute directory path.

There may be other property.name(s) exposed - read the documentation.

Can you explain your use case for doing this? This will make a mess of builds, and who knows what will happen if a developer uses a different version of a library in a web application.

a) will it fail because the library operation is different?
b) will you get spurious class not found exceptions?
c) will the developer remember to leave some JARs out, but include ones
   that you left out?

Inquiring minds really don't want to think about the above mess. I know system administrators don't.

. . . . just my two cents.
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to