Hi all,

after moving a jar file from tomcat/common/lib to tomcat/shared/lib, JSPs
that use that library don't compile anymore, it says package does not
exist. It is a library from my company, used by all webapps in the server
installation. It used to be in tomcat/common/lib as it was used by a 
tomcat
valve that exists no longer. As it now needs other libraries in
tomcat/shared/lib, we want to move it.

Now, the classloader howto says:

> Common - This class loader contains additional classes that are made
> visible
> to both Tomcat internal classes and to all web applications. Normally,
> application classes should NOT be placed here.
>
> Shared - This class loader is the place to put classes and resources
> that you wish to share across ALL web applications (unless Tomcat
> internal classes also need access, in which case you should put them in
> the Common class loader instead)

This library is only used in our application code, mostly in servlets, but
also in some JSP, which can use it after being compiled. Only compiling
doesn't work. Logically, this is thus no code that tomcat internal classes
need.

One can argue, however, that the JSP compiler is a tomcat internal class,
and that using a library as compile class path means that this internal
class needs it, and it thus needs to be in tomcat/common/lib.

For me, this is not intuive, though, and I couldn't find any explicit
documentation about it. My question is now:
Must all libraries that contain classes used in JSPs be in 
tomcat/common/lib
(or WEB-INF/lib), or is this a bug in tomcat, or is this an error in our
installation/configuration?

Thanks,
Rainer Frey

P.S.:Here is the stack trace, showing no tomcat/shared/lib/anything in
classpath:

SEVERE: Javac exception
Compile failed; see the compiler error output for details.
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
        at
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:373)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:441)
        at org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
        at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at
org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:287)
        at
org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:84)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:417)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
        at java.lang.Thread.run(Thread.java:619)
15.08.2007 12:50:39 org.apache.jasper.compiler.Compiler generateClass
SEVERE: Env: Compile:
javaFileName=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/work/Catalina/localhost/inxadm//org/apache/jsp/index_jsp.java
   
classpath=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/webapps/inxadm/WEB-INF/lib/inxmail_admin.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/webapps/inxadm/WEB-INF/lib/log4j.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/work/Catalina/localhost/inxadm:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/webapps/inxadm/WEB-INF/lib/inxmail_admin.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/webapps/inxadm/WEB-INF/lib/log4j.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-ant.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-cluster.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-i18n-es.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-i18n-fr.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-i18n-ja.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-optional.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/commons-beanutils.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/commons-digester.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/commons-fileupload-1.0.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/commons-modeler.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/inxmailerror.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/jakarta-regexp-1.3.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/jkconfig.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/jkshm.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/servlets-common.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/servlets-default.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/servlets-invoker.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/servlets-webdav.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-coyote.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-http11.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-jk.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-jk2.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-jni.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-util.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/classes/:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/endorsed/xercesImpl.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/endorsed/xmlParserAPIs.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/ant.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/commons-collections.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/commons-dbcp-1.1.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/commons-el.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/commons-pool-1.1.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/jasper-compiler.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/jasper-runtime.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/jsp-api.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/naming-common.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/naming-factory.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/naming-java.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/naming-resources.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/servlet-api.jar:/opt/jdk1.6.0/lib/tools.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/bin/bootstrap.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/bin/commons-logging-api.jar:/opt/jdk1.6.0/jre/lib/ext/sunjce_provider.jar:/opt/jdk1.6.0/jre/lib/ext/sunpkcs11.jar:/opt/jdk1.6.0/jre/lib/ext/dnsns.jar:/opt/jdk1.6.0/jre/lib/ext/localedata.jar
   
cp=/opt/java/lib/tools.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/bin/bootstrap.jar:/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/bin/commons-logging-api.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/webapps/inxadm/WEB-INF/lib/inxmail_admin.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/webapps/inxadm/WEB-INF/lib/log4j.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/work/Catalina/localhost/inxadm
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/webapps/inxadm/WEB-INF/lib/inxmail_admin.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/webapps/inxadm/WEB-INF/lib/log4j.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-ant.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-cluster.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-i18n-es.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-i18n-fr.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-i18n-ja.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina-optional.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/catalina.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/commons-beanutils.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/commons-digester.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/commons-fileupload-1.0.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/commons-modeler.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/inxmailerror.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/jakarta-regexp-1.3.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/jkconfig.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/jkshm.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/servlets-common.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/servlets-default.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/servlets-invoker.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/servlets-webdav.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-coyote.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-http11.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-jk.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-jk2.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-jni.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/server/lib/tomcat-util.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/classes
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/endorsed/xercesImpl.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/endorsed/xmlParserAPIs.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/ant.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/commons-collections.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/commons-dbcp-1.1.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/commons-el.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/commons-pool-1.1.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/jasper-compiler.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/jasper-runtime.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/jsp-api.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/naming-common.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/naming-factory.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/naming-java.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/naming-resources.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/common/lib/servlet-api.jar
    cp=/opt/jdk1.6.0/lib/tools.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/bin/bootstrap.jar
   
cp=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/bin/commons-logging-api.jar
    cp=/opt/jdk1.6.0/jre/lib/ext/sunjce_provider.jar
    cp=/opt/jdk1.6.0/jre/lib/ext/sunpkcs11.jar
    cp=/opt/jdk1.6.0/jre/lib/ext/dnsns.jar
    cp=/opt/jdk1.6.0/jre/lib/ext/localedata.jar
    work
dir=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/work/Catalina/localhost/inxadm
    extension dir=/opt/jdk1.6.0/jre/lib/ext:/usr/java/packages/lib/ext
   
srcDir=/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/work/Catalina/localhost/inxadm
    include=org/apache/jsp/index_jsp.java

15.08.2007 12:50:39 org.apache.jasper.compiler.Compiler generateClass
SEVERE: Error compiling
file: 
/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/work/Catalina/localhost/inxadm//org/apache/jsp/index_jsp.java
    
[javac] Compiling 1 source file

/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/work/Catalina/localhost/inxadm/org/apache/jsp/index_jsp.java:20:
package com.inxmail.util does not exist
import com.inxmail.util.StringUtils;
                       ^
/home/rfy/development/inxmail/installation/070815/inxmail-3.5-server/tomcat/work/Catalina/localhost/inxadm/org/apache/jsp/index_jsp.java:159:
cannot find symbol
symbol  : variable StringUtils
location: class org.apache.jsp.index_jsp
                                entry.setValue( StringUtils.replaceAll( (
String )entry.getValue(), "$$INXMAIL_DIR$$",
                                                ^
-- 
Inxmail GmbH
Web: http://www.inxmail.de
Handelsregister Freiburg, HRB 5870
USt-Id DE198371679
Geschäftsleitung Martin Bucher, Peter Ziras 

Reply via email to