Ho installato la versione 3.3.2 di tomcat (per esigenze didattiche) e la pagina iniziale non mi dà problemi. Nel tutorial che sto utilizzando per l'installazione trovo la seguente frase:
Adjust the Tomcat script %TOMCAT_HOME%\bin\tomcat.bat by locating the line:
:chkClasspath
Two lines down from that, change the set classpath statement to
explicitly put the xerces jar at the beginning of the list. For example:
set CP=c:\work\XERCES\xerces-1_4_4\xerces.jar;%CP%;%CLASSPATH%
Then save the script.
Apro in modalità modifica il file tomcat.bat e visualizzo quanto segue:
@echo off
rem tomcat.bat - Start/Stop Script for the TOMCAT Server
rem
rem Environment Variable Prerequisites:
rem
rem JAVA_HOME Must point at your Java Development Kit installation.
rem
rem TOMCAT_HOME (Optional) Should point to the directory containing
rem Tomcat's "conf" and "webapps" directory.
rem If not present, the current working directory is
rem assumed.
rem Note: This batch file does not function properly
rem if TOMCAT_HOME contains spaces.
rem
rem TOMCAT_INSTALL (Optional) Should point to the directory containing
rem Tomcat's "lib" directory.
rem If not present, the current working directory is
rem assumed. If this doesn't contain a "lib" directory,
rem or if the "lib" directory doesn't contain tomcat.jar.
rem TOMCAT_HOME is used.
rem
rem TOMCAT_OPTS (Optional) Java runtime options used when the "start",
rem "stop", or "run" command is executed
rem
rem NOTE: Tomcat does not use your system's CLASSPATH setting. Instead
rem Tomcat starts using only tomcat.jar on the classpath and builds
rem its "classpath" internally. To add your classes to those of
rem Tomcat, refer to the Tomcat Users Guide (tomcat_ug.html found
rem in the "doc" directory.
rem
rem $Id: tomcat.bat,v 1.50 2004/02/27 05:32:58 billbarker Exp $
rem -------------------------------------------------------------------------
rem ----- Save Environment Variables That May Change ------------------------
set _TOMCAT_HOME=%TOMCAT_HOME%
set _TOMCAT_INSTALL=%TOMCAT_INSTALL%
set _CLASSPATH=%CLASSPATH%
rem ----- Internal Environment Vars used somewhere --------------------------
set _NULL=nul
set _CONTAINER=contai~1
if not "%OS%" == "Windows_NT" goto cont
set _NULL=
set _CONTAINER=container
:cont
rem main startup class
set _MAIN=org.apache.tomcat.startup.Main
rem ----- Verify and Set Required Environment Variables ---------------------
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo You must set JAVA_HOME to point at your Java Development Kit installation
goto cleanup
:gotJavaHome
if not "%TOMCAT_HOME%" == "" goto gotTcHome
set TOMCAT_HOME=.
if exist "%TOMCAT_HOME%\conf\%_NULL%" goto okTcHome
set TOMCAT_HOME=..
:gotTcHome
if exist "%TOMCAT_HOME%\conf\%_NULL%" goto okTcHome
echo "%TOMCAT_HOME%\conf" not found.
echo Unable to locate Tomcat's "conf" directory, check the value of TOMCAT_HOME.
goto cleanup
kTcHome
rem Set the default -Djava.endorsed.dirs argument
set JAVA_ENDORSED_DIRS=%TOMCAT_HOME%\lib\endorsed
if not "%TOMCAT_INSTALL%" == "" goto gotTcInstall
set TOMCAT_INSTALL=.
if exist "%TOMCAT_INSTALL%\lib\tomcat.jar" goto okTcInstall
set TOMCAT_INSTALL=..
if exist "%TOMCAT_INSTALL%\lib\tomcat.jar" goto okTcInstall
set TOMCAT_INSTALL=%TOMCAT_HOME%
:gotTcInstall
if exist "%TOMCAT_INSTALL%\lib\tomcat.jar" goto okTcInstall
echo "%TOMCAT_INSTALL%\lib\tomcat.jar" not found.
echo Unable to locate "lib\tomcat.jar", check the value of TOMCAT_HOME and/or
echo TOMCAT_INSTALL.
goto cleanup
kTcInstall
rem ----- Prepare Appropriate Java Execution Commands -----------------------
if not "%OS%" == "Windows_NT" goto noTitle
set _SECSTARTJAVA=start "Secure Tomcat 3.3.2 Final" "%JAVA_HOME%\bin\java"
set _STARTJAVA=start "Tomcat 3.3.2 Final" "%JAVA_HOME%\bin\java"
set _RUNJAVA="%JAVA_HOME%\bin\java"
goto setClasspath
:noTitle
set _SECSTARTJAVA=start "%JAVA_HOME%\bin\java"
set _STARTJAVA=start "%JAVA_HOME%\bin\java"
set _RUNJAVA="%JAVA_HOME%\bin\java"
:setClasspath
set CLASSPATH=%TOMCAT_INSTALL%\lib\tomcat.jar;%TOMCAT_ INSTALL%\lib\common\commons-logging-api.jar
rem ----- Execute The Requested Command -------------------------------------
:execute
if "%1" == "start" goto startServer
if "%1" == "stop" goto stopServer
if "%1" == "run" goto runServer
if "%1" == "env" goto doEnv
if "%1" == "jspc" goto runJspc
if "%1" == "enableAdmin" goto enableAdmin
if "%1" == "estart" goto estart
:doUsage
echo "Usage: tomcat ( enableAdmin | env | estart | jspc | run | start | stop )"
echo Commands:
echo enableAdmin - Trust the admin web application,
echo i.e. rewrites conf/apps-admin.xml with trusted="true"
echo env - Set up environment variables that Tomcat would use
echo estart - Start Tomcat using the/your EmbeddedTomcat class which
echo uses a hardcoded set of modules
echo jspc - Run JSPC in Tomcat's environment
echo run - Start Tomcat in the current window
echo run -help - more options (usable with "start" as well):
echo (config, debug, estart, home, install, jkconf, sandbox)
echo start - Start Tomcat in a separate window
echo stop - Stop Tomcat
echo stop -help - more options:
echo (ajpid, host, home, pass, port)
goto cleanup
:startServer
echo Starting Tomcat in new window
if "%2" == "sandbox" goto startSecure
if "%2" == "-sandbox" goto startSecure
rem Note: Specify tomcat.policy in case -sandbox isn't the second argument
%_STARTJAVA% %TOMCAT_OPTS% -Djava.security.policy=="%TOMCAT_HOME%/conf/tomcat.policy" -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dtomcat.home="%TOMCAT_HOME%" %_MAIN% start %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup
:startSecure
echo Starting Tomcat with a SecurityManager
%_SECSTARTJAVA% %TOMCAT_OPTS% -Djava.security.policy=="%TOMCAT_HOME%/conf/tomcat.policy" -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dtomcat.home="%TOMCAT_HOME%" %_MAIN% start %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup
:runServer
rem Backwards compatibility for enableAdmin
if "%2" == "enableAdmin" goto oldEnbAdmin
if "%2" == "-enableAdmin" goto oldEnbAdmin
rem Running Tomcat in this window
%_RUNJAVA% %TOMCAT_OPTS% -Djava.security.policy=="%TOMCAT_HOME%/conf/tomcat.policy" -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dtomcat.home="%TOMCAT_HOME%" %_MAIN% start %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup
:enableAdmin
rem Run enableAdmin
%_RUNJAVA% %TOMCAT_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dtomcat.home="%TOMCAT_HOME%" %_MAIN% enableAdmin %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup
ldEnbAdmin
rem Run enableAdmin
%_RUNJAVA% %TOMCAT_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dtomcat.home="%TOMCAT_HOME%" %_MAIN% enableAdmin %3 %4 %5 %6 %7 %8 %9
goto cleanup
:estart
%_RUNJAVA% %TOMCAT_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dtomcat.home="%TOMCAT_HOME%" %_MAIN% estart %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup
:stopServer
rem Stopping the Tomcat Server
%_RUNJAVA% %TOMCAT_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dtomcat.home="%TOMCAT_HOME%" %_MAIN% stop %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup
:runJspc
rem Run JSPC in Tomcat's Environment
%_RUNJAVA% %JSPC_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Dtomcat.home="%TOMCAT_HOME%" %_MAIN% jspc %2 %3 %4 %5 %6 %7 %8 %9
goto cleanup
rem ----- Set CLASSPATH to Tomcat's Runtime Environment -----------------------
:doEnv
rem Try to determine if TOMCAT_INSTALL contains spaces
if exist %TOMCAT_INSTALL%\lib\%_NULL% goto dynClasspath
echo Your TOMCAT_INSTALL or TOMCAT_HOME appears to contain spaces.
echo Unable to set CLASSPATH dynamically.
goto staticClasspath
:dynClasspath
set _LIBJARS=
for %%i in (%TOMCAT_HOME%\lib\%_CONTAINER%\*.*) do call %TOMCAT_HOME%\bin\cpappend.bat %%i
if not "%_LIBJARS%" == "" goto getLibJars
echo Unable to set CLASSPATH dynamically.
if "%OS%" == "Windows_NT" goto staticClasspath
echo Note: To set the CLASSPATH dynamically on Win9x systems
echo only DOS 8.3 names may be used in TOMCAT_HOME or TOMCAT_INSTALL!
goto staticClasspath
:getLibJars
for %%i in (%TOMCAT_HOME%\lib\common\*.*) do call %TOMCAT_HOME%\bin\cpappend.bat %%i
for %%i in (%TOMCAT_HOME%\lib\apps\*.*) do call %TOMCAT_HOME%\bin\cpappend.bat %%i
echo Setting your CLASSPATH to Tomcat's runtime set of jars.
rem Note: _LIBJARS already contains a leading semicolon
set CLASSPATH=%CLASSPATH%%_LIBJARS%
goto finish
:staticClasspath
echo Setting your CLASSPATH statically.
rem Add lib jars
if exist "%TOMCAT_HOME%\lib\tomcat.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\tomcat.jar
rem Add lib\container jars
if exist "%TOMCAT_HOME%\lib\container\crimson.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\container\ crimson.jar
if exist "%TOMCAT_HOME%\lib\container\facade22.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\container\ facade22.jar
if exist "%TOMCAT_HOME%\lib\container\jasper.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\container\ jasper.jar
if exist "%TOMCAT_HOME%\lib\container\jaxp.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\container\ jaxp.jar
if exist "%TOMCAT_HOME%\lib\container\tomcat_modules.ja r" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\container\ tomcat_modules.jar
if exist "%TOMCAT_HOME%\lib\container\tomcat_util.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\container\ tomcat_util.jar
if exist "%TOMCAT_HOME%\lib\container\tomcat-startup.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\container\ tomcat-startup.jar
if exist "%TOMCAT_HOME%\lib\container\xalan.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\container\ xalan.jar
rem Add lib\common jars
if exist "%TOMCAT_HOME%\lib\common\connector_util.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\common\con nector_util.jar
if exist "%TOMCAT_HOME%\lib\common\core_util.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\common\cor e_util.jar
if exist "%TOMCAT_HOME%\lib\common\jasper-runtime.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\common\jas per-runtime.jar
if exist "%TOMCAT_HOME%\lib\common\servlet.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\common\ser vlet.jar
if exist "%TOMCAT_HOME%\lib\common\tomcat_core.jar" set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\common\tom cat_core.jar
goto finish
rem ----- Restore Environment Variables ---------------------------------------
:cleanup
set CLASSPATH=%_CLASSPATH%
set _CLASSPATH=
set TOMCAT_HOME=%_TOMCAT_HOME%
set _TOMCAT_HOME=
set TOMCAT_INSTALL=%_TOMCAT_INSTALL%
set _TOMCAT_INSTALL=
:finish
set _LIBJARS=
set _SECSTARTJAVA=
set _STARTJAVA=
set _RUNJAVA=
set _MAIN=
set _CONTAINER=
Set _NULL=
Praticamente :chkClasspath non esiste. Come posso fare per rispettare questa direttiva? ho provato ad ignorarla ma quando cerco di fare un deploy in http://localhost:8080/soap/admin/index.html
ottengo la seguente schermata:
Error: 500
Location: /soap/admin/deploy.jsp
Internal Servlet Error:
java.lang.NoClassDefFoundError: javax/mail/MessagingException
at admin.deploy_1._jspService(deploy_1.java:71)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:78)
at javax.servlet.http.HttpServlet.service(HttpServlet .java)
at org.apache.tomcat.facade.ServletHandler.doService( ServletHandler.java:534)
at org.apache.tomcat.core.Handler.invoke(Handler.java :280)
at org.apache.tomcat.core.Handler.service(Handler.jav a:193)
at org.apache.tomcat.facade.ServletHandler.service(Se rvletHandler.java:445)
at org.apache.tomcat.core.ContextManager.internalServ ice(ContextManager.java:874)
at org.apache.tomcat.core.ContextManager.service(Cont extManager.java:790)
at org.apache.coyote.tomcat3.Tomcat3Adapter.service(T omcat3Adapter.java:64)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:793)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:702)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:571)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Thread.java:479)
Come posso fare?