In 1.x, we extended ContextLoaderListener. In 2.x, we changed that and don't extend it anymore. This is because in Servlet 2.4, the listeners load in their specified order rather than in any order (2.3).

Matt

On Apr 15, 2008, at 3:40 PM, koevet wrote:

Hello,
I'm having a very annoying problem when deploying a 1.9.x version of appfuse "enhanced" with bits from version 2 (I know it sounds scary, but, please
bear with me).

So, the problem takes place during deploy. This is the partial stack trace
from Tomcat 5.5.25:

[xxx] ERROR [main] [/xxx].listenerStart(3768) | Exception sending context
initialized event to listener instance of class
com.xxx.webapp.listener.StartupListener

java.lang.IllegalStateException: No WebApplicationContext found: no
ContextLoaderListener registered?
        at
org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext (WebApplicationContextUtils.java:95)
        at
com .xxx .webapp .listener.StartupListener.contextInitialized(StartupListener.java:56)
...

The StartupListener I'm using is the one from version 2.0.x. This is the
line of code in the StartupListener that fails:

ApplicationContext ctx =

WebApplicationContextUtils.getRequiredWebApplicationContext(context);

My web.xml seems to be correctly configured:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>

...

<context-param>
       <param-name>contextConfigLocation</param-name>
       <param-value>
           /WEB-INF/applicationContext*.xml
           /WEB-INF/security.xml
       </param-value>
</context-param>

...

<listener>

<listener- class>org.springframework.web.context.ContextLoaderListener</ listener-class>
</listener>
...
<listener>

<listener-class>com.thetapenet.webapp.listener.StartupListener</ listener-class>
</listener>

<servlet>
       <servlet-name>action</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</ servlet-class>
       <load-on-startup>2</load-on-startup>
</servlet>


After Tomcat logs out the previous error it continues loading the actual
Spring context:

[xxx] INFO [main] [/xproject].log(647) | Initializing Spring root
WebApplicationContext
[xxx] INFO [main] ContextLoader.initWebApplicationContext(189) | Root
WebApplicationContext: initialization started
[xxx] INFO [main] XmlWebApplicationContext.prepareRefresh(412) | Refreshing org [EMAIL PROTECTED]: display name [Root WebApplicationContext]; startup date [Tue Apr 15 23:17:43
CEST 2008]; root of context hierarchy
[xxx] INFO [main] XmlBeanDefinitionReader.loadBeanDefinitions(323) | Loading
XML bean definitions from ServletContext resource
[/WEB-INF/applicationContext-validation.xml]
[xxx] INFO [main] XmlBeanDefinitionReader.loadBeanDefinitions(323) | Loading
XML bean definitions from ServletContext resource
[/WEB-INF/applicationContext-resources.xml]
[xxx] INFO [main] XmlBeanDefinitionReader.loadBeanDefinitions(323) | Loading
XML bean definitions from ServletContext resource
[/WEB-INF/applicationContext-hibernate.xml]
[xxx] INFO [main] XmlBeanDefinitionReader.loadBeanDefinitions(323) | Loading
XML bean definitions from ServletContext resource
[/WEB-INF/applicationContext-service.xml]
[xxx] INFO [main] XmlBeanDefinitionReader.loadBeanDefinitions(323) | Loading XML bean definitions from ServletContext resource [/WEB-INF/ security.xml]

I have now spent some time on this issue with no success. Does anyone has an
idea on what is going on?

Thanks a million
Luciano
--
View this message in context: 
http://www.nabble.com/StartupListener-fails---AppFuse-Frankenstein-version-tp16711192s2369p16711192.html
Sent from the AppFuse - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to