You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Brian Briggman <b....@attbi.com> on 2003/04/17 17:34:17 UTC

Listener nested in DefaultContext in Tomcat 4.1.18?

According to the Tomcat 4.1 documentation, it is possible to nest a Listener
inside of a DefaultContext.  When I try to do this, Tomcat gives me the
error:

java.lang.NoSuchMethodException: No such accessible method:
addLifecycleListener() on object:
org.apache.catalina.core.StandardDefaultContext

Which leaves me questioning whether it's a bug in the StandardDefaultContext
implementation, or whether the documentation is wrong.

Here's my DefaultContext definition, which is nested inside my Host:

<DefaultContext>
<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
append="true" forwardAll="false" />
</DefaultContext>

My intent of putting the Listener in the DefaultContext is to have Tomcat
automagically add JKMounts into the automatically generated mod_jk.conf for
any webapps that exist, without having to hardcode the existing webapps in
the server.xml (with a Listener explicitly defined for each hardcoded
webapp).

Does anyone know of another way to accomplish this if you cannot nest a
Listener in a DefaultContext?

Thanks in advance,
Brian


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Listener nested in DefaultContext in Tomcat 4.1.18?

Posted by Qing Xie <xi...@ecopiabio.com>.
Hi Brian,

I think you may have helped me to figure out the problem. My tomcat was 
included as part of the WSDP package, therefor it was installed at 
/usr/java/jwsdp-1.1. I looked into /usr/java/jwsdp-1.1/server/lib and 
found I don't have tomcat-jk.jar there. Instead, i have 
tomcat-coyote.jar, and I guess it's a later version so 
"org.apache.ajp.tomcat4.config.ApacheConfig" classes are not there.

So, what I plan to do it to download tomcat separatly and redo the whole 
thing again.

Thank you very much for your help!


Qing


Brian Briggman wrote:

>The "org.apache.ajp.tomcat4.config.ApacheConfig" class resides in the
>tomcat-jk.jar file which is part of the default Tomcat install - located in
>/usr/local/tomcat/server/lib - so it should get picked up by default when
>Tomcat starts - you DO NOT want to manually add this jar to your CLASSPATH -
>Tomcat should get it by default, so please check to make sure you're not
>overriding the CLASSPATH...
>
>Thanks,
>Brian
>
>-----Original Message-----
>From: Qing Xie [mailto:xie@ecopiabio.com]
>Sent: Thursday, April 17, 2003 10:42 AM
>To: Tomcat Users List
>Subject: Re: Listener nested in DefaultContext in Tomcat 4.1.18?
>
>
>Hi Brian,
>
>Do you know where the class "org.apache.ajp.tomcat4.config.ApacheConfig"
>is? Should I set up my CLASSPATH to relect it? When I added the same
>listener tag in server.xml file, I got
>"org.apache.ajp.tomcat4.config.ApacheConfig" not found exception when I
>tried to start tomcat.
>
>Thanks a lot!
>
>
>Qing
>
>
>
>Brian Briggman wrote:
>
>  
>
>>According to the Tomcat 4.1 documentation, it is possible to nest a
>>    
>>
>Listener
>  
>
>>inside of a DefaultContext.  When I try to do this, Tomcat gives me the
>>error:
>>
>>java.lang.NoSuchMethodException: No such accessible method:
>>addLifecycleListener() on object:
>>org.apache.catalina.core.StandardDefaultContext
>>
>>Which leaves me questioning whether it's a bug in the
>>    
>>
>StandardDefaultContext
>  
>
>>implementation, or whether the documentation is wrong.
>>
>>Here's my DefaultContext definition, which is nested inside my Host:
>>
>><DefaultContext>
>><Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
>>append="true" forwardAll="false" />
>></DefaultContext>
>>
>>My intent of putting the Listener in the DefaultContext is to have Tomcat
>>automagically add JKMounts into the automatically generated mod_jk.conf for
>>any webapps that exist, without having to hardcode the existing webapps in
>>the server.xml (with a Listener explicitly defined for each hardcoded
>>webapp).
>>
>>Does anyone know of another way to accomplish this if you cannot nest a
>>Listener in a DefaultContext?
>>
>>Thanks in advance,
>>Brian
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Listener nested in DefaultContext in Tomcat 4.1.18?

Posted by Brian Briggman <b....@attbi.com>.
The "org.apache.ajp.tomcat4.config.ApacheConfig" class resides in the
tomcat-jk.jar file which is part of the default Tomcat install - located in
/usr/local/tomcat/server/lib - so it should get picked up by default when
Tomcat starts - you DO NOT want to manually add this jar to your CLASSPATH -
Tomcat should get it by default, so please check to make sure you're not
overriding the CLASSPATH...

Thanks,
Brian

-----Original Message-----
From: Qing Xie [mailto:xie@ecopiabio.com]
Sent: Thursday, April 17, 2003 10:42 AM
To: Tomcat Users List
Subject: Re: Listener nested in DefaultContext in Tomcat 4.1.18?


Hi Brian,

Do you know where the class "org.apache.ajp.tomcat4.config.ApacheConfig"
is? Should I set up my CLASSPATH to relect it? When I added the same
listener tag in server.xml file, I got
"org.apache.ajp.tomcat4.config.ApacheConfig" not found exception when I
tried to start tomcat.

Thanks a lot!


Qing



Brian Briggman wrote:

>According to the Tomcat 4.1 documentation, it is possible to nest a
Listener
>inside of a DefaultContext.  When I try to do this, Tomcat gives me the
>error:
>
>java.lang.NoSuchMethodException: No such accessible method:
>addLifecycleListener() on object:
>org.apache.catalina.core.StandardDefaultContext
>
>Which leaves me questioning whether it's a bug in the
StandardDefaultContext
>implementation, or whether the documentation is wrong.
>
>Here's my DefaultContext definition, which is nested inside my Host:
>
><DefaultContext>
><Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
>append="true" forwardAll="false" />
></DefaultContext>
>
>My intent of putting the Listener in the DefaultContext is to have Tomcat
>automagically add JKMounts into the automatically generated mod_jk.conf for
>any webapps that exist, without having to hardcode the existing webapps in
>the server.xml (with a Listener explicitly defined for each hardcoded
>webapp).
>
>Does anyone know of another way to accomplish this if you cannot nest a
>Listener in a DefaultContext?
>
>Thanks in advance,
>Brian
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Listener nested in DefaultContext in Tomcat 4.1.18?

Posted by Qing Xie <xi...@ecopiabio.com>.
Hi Brian,

Do you know where the class "org.apache.ajp.tomcat4.config.ApacheConfig" 
is? Should I set up my CLASSPATH to relect it? When I added the same 
listener tag in server.xml file, I got 
"org.apache.ajp.tomcat4.config.ApacheConfig" not found exception when I 
tried to start tomcat.

Thanks a lot!


Qing



Brian Briggman wrote:

>According to the Tomcat 4.1 documentation, it is possible to nest a Listener
>inside of a DefaultContext.  When I try to do this, Tomcat gives me the
>error:
>
>java.lang.NoSuchMethodException: No such accessible method:
>addLifecycleListener() on object:
>org.apache.catalina.core.StandardDefaultContext
>
>Which leaves me questioning whether it's a bug in the StandardDefaultContext
>implementation, or whether the documentation is wrong.
>
>Here's my DefaultContext definition, which is nested inside my Host:
>
><DefaultContext>
><Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
>append="true" forwardAll="false" />
></DefaultContext>
>
>My intent of putting the Listener in the DefaultContext is to have Tomcat
>automagically add JKMounts into the automatically generated mod_jk.conf for
>any webapps that exist, without having to hardcode the existing webapps in
>the server.xml (with a Listener explicitly defined for each hardcoded
>webapp).
>
>Does anyone know of another way to accomplish this if you cannot nest a
>Listener in a DefaultContext?
>
>Thanks in advance,
>Brian
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org