You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by MiSt <ms...@gazeta.pl> on 2006/05/08 17:38:44 UTC

Listener in tld files - bug ?

I added (by mistake) element
<listener>
		<listener-class>
		org.springframework.web.context.ContextLoaderListener
		</listener-class>
</listener>

to  struts .tld file (after <taglib> ) despite web.xml and I noticed
that  Spring context was loaded properly! Why? Elment <listener> is
illegal in tld files. Tomcats notifies listeners defined in tld files
and throws error for not existing classes:


ERROR [[/service]] Error configuring application listener of class
org.springframework.wsssaasdfeb.context.ContextLoaderListener
java.lang.ClassNotFoundException:
org.springframework.wsssaasdfeb.context.ContextLoaderListener
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181)
	at org.apache.catalina.core.Standa
(...)




  It is a Bug in Tomcat ? Or JBoss?

Tomcat 5.5 (JBoss 4.0.3SP1)

-- 
MichaƂ Steiner





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


Re: Listener in tld files - bug ?

Posted by Tim Funk <fu...@joedog.org>.
Yes. You can turn on XML validation of the XML file before using it - but 
many people believe that should be a build time exercise and not a run/deploy 
time exercise.

-Tim

MiSt wrote:
> Tim Funk:
> 
>> Listeners are allowed in TLD files.
>>
> Thanks for answer
> 
> You are right. Element listener is allowed in tld from version 1.2 
> http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd
> but not in 1.1
> http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
> 
> My tld file
> 
> <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 
> 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
> <taglib>
> <tlibversion>1.2</tlibversion>
> <jspversion>1.1</jspversion>
> (...)
> 
> it is ok that tomcat doesnt ignore illegal element?
> 
> 

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


Re: Listener in tld files - bug ?

Posted by MiSt <ms...@gazeta.pl>.
Tim Funk:
> Listeners are allowed in TLD files.
> 
Thanks for answer

You are right. Element listener is allowed in tld from version 1.2 
http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd
but not in 1.1
http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd

My tld file

<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 
1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.2</tlibversion>
<jspversion>1.1</jspversion>
(...)

it is ok that tomcat doesnt ignore illegal element?


-- 
Michael Steiner




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


Re: Listener in tld files - bug ?

Posted by Tim Funk <fu...@joedog.org>.
Listeners are allowed in TLD files.

-Tim

MiSt wrote:

> I added (by mistake) element
> <listener>
>         <listener-class>
>         org.springframework.web.context.ContextLoaderListener
>         </listener-class>
> </listener>
> 
> to  struts .tld file (after <taglib> ) despite web.xml and I noticed
> that  Spring context was loaded properly! Why? Elment <listener> is
> illegal in tld files. Tomcats notifies listeners defined in tld files
> and throws error for not existing classes:
> 
> 
> ERROR [[/service]] Error configuring application listener of class
> org.springframework.wsssaasdfeb.context.ContextLoaderListener
> java.lang.ClassNotFoundException:
> org.springframework.wsssaasdfeb.context.ContextLoaderListener
>     at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1332) 
> 
>     at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1181) 
> 
>     at org.apache.catalina.core.Standa
> (...)
> 

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