On 4/16/07, Mike Peremsky <[EMAIL PROTECTED]> wrote:
From the control panel. If I go to the system properties and look at the
environment variables I have the following: (I do not have a JRE_HOME defined)
CATALINA_HOME=c:\apache-tomcat
JAVA_HOME=c:\jdk1.5.0
Path=C:\jdk1.5.0\bin;%ANT_HOME%\bin
The above looks correct, but the PATH could still be improved so
change the above PATH
to PATH=%JAVA_HOME%/bin;%ANT_HOME%/bin;%CATALINA_HOME%/bin
There is a CLASSPATH variable set as:
.;C:\Program Files\Java\jre1.5.0_11\lib\ext\QTJava.zip
Temporarily unset the CLASSPATH (system environment variable).
My jdk is installed to c:\jdk1.5.0 and my tomcat is installed at
c:\apache-tomcat as is
stated in the environment variables.
This is fine.
I did a fresh install of Tomcat 5.5.23 (I had not had it installed
previously). Everything
was working fins until I tried to create a listener. My code is deployed to
c:\apache-tomcat\webapps\fs with all class files in WEB-INF\classes.
Each listener you write must also be defined in the deployment
descriptor \WEB-INF\web.xml , for example:
<listener>
<listener-class>any.package.SingletonLoader</listener-class>
</listener>
<listener>
<listener-class>any.package.ApplicationWatch</listener-class>
</listener>
and so on...
I also have 1 jar file that I have utility classes in
:\apache-tomcat\common\lib\mvpUtils.jar.
If the listener is in the catalina.jar file,
Actually the listener doesn't need to be in catalina.jar at all , it
can be anywhere under your project's /WEB-INF/classes/ folder also.
The reason why the code in the LifecycleListener isn't being called is
because an event that is supposed to be captured by the
LifecycleListener didn't occur .....
According to the definition
http://tomcat.apache.org/tomcat-5.0-doc/catalina/docs/api/org/apache/catalina/LifecycleListener.html
"Interface defining a listener for significant events (including
"component start" and "component stop" generated by a component that
implements the Lifecycle interface."
I tried implementing the ServletContextListener, and it was able to
capture the Tomcat start and shutdown events.
May be you could try one of the sub-interfaces such as:
http://tomcat.apache.org/tomcat-5.0-doc/catalina/docs/api/org/apache/catalina/mbeans/ServerLifecycleListener.html
and the jar file is in the c:\apache-tomcat\server\lib\ directory. Which, as you
say, should > already include any jars in that directory, how could it fail
finding the class?
It is not failing in finding the class (the NoClassDefinitionFound
error can be solved normally by unsetting the system classpath), as
long as the class is under the project's WEB-INF/classes folder , it
will find the class. The real question here is why didn't capture a
particular event that you expect it to capture.
What event are you expecting the LifecycleListener to capture?
-Rashmi
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]