Question

I have a Spring MVC Java web application using 2 Spring contexts. The root application context, loaded via ContextLoaderListener, and the servlet Context.

I'm loading the application with the Jetty Maven plugin without problems (9.0.0.RC2), but when I try to reload the app manually with the console scanner (just hitting enter in the console), the application gets loaded again, but the ContextLoaderListener is not called, and my servlet context fails as it does not find the beans in the root context.

The log in the initial load goes like this:

2013-05-21 12:13:32.676:INFO:oejw.WebInfConfiguration:main: Adding virtual project first in resource base list
2013-05-21 12:13:33.149:INFO:oejpw.PlusConfiguration:main: No Transaction manager found - if your webapp requires one, please configure one.
2013-05-21 12:13:34.879:INFO:/:main: No Spring WebApplicationInitializer types detected on classpath
2013-05-21 12:13:36.241:INFO:/:main: Initializing log4j from [classpath:log4j.properties]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/j.calero/.m2/repository/org/slf4j/slf4j-log4j12/1.5.10/slf4j-log4j12-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/Code/Java/sms/portal-licitacion/target/tmp/portal-notificaciones-0_0_3-SNAPSHOT_war1/WEB-INF/lib/slf4j-log4j12-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2013-05-21 12:13:36.690:INFO:/:main: Initializing Spring root WebApplicationContext
12:13:36,691  INFO ContextLoader:273 - Root WebApplicationContext: initialization started
12:13:37,068  INFO XmlWebApplicationContext:495 - Refreshing Root WebApplicationContext: startup date [Tue May 21 12:13:37 CEST 2013]; root of context hierarchy
12:13:37,372  INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from class path resource [context/applicationContext.xml]

And during the reload:

2013-05-21 09:59:28.179:INFO:oejw.WebInfConfiguration:Console scanner: Adding virtual project first in resource base list
2013-05-21 09:59:28.321:INFO:oejpw.PlusConfiguration:Console scanner: No Transaction manager found - if your webapp requires one, please configure one.
2013-05-21 09:59:28.831:INFO:Portal de Licitación:Console scanner: No Spring WebApplicationInitializer types detected on classpath
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/j.calero/.m2/repository/org/slf4j/slf4j-log4j12/1.5.10/slf4j-log4j12-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/Code/Java/sms/portal-licitacion/target/tmp/portal-notificaciones-0_0_3-SNAPSHOT_war4/WEB-INF/lib/slf4j-log4j12-1.5.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2013-05-21 09:59:29.293:INFO:Portal de Licitación:Console scanner: Initializing Spring FrameworkServlet 'portal'
09:59:29,294  INFO DispatcherServlet:444 - FrameworkServlet 'portal': initialization started
09:59:29,316  INFO XmlWebApplicationContext:495 - Refreshing WebApplicationContext for namespace 'portal-servlet': startup date [Tue May 21 09:59:29 CEST 2013]; root of context hierarchy
09:59:29,353  INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from class path resource [context/portal-servlet.xml]

How can I solve this?

Était-ce utile?

La solution

Well, it was a small bug, indeed. I filed the bug and it was solved in less than a day!

https://bugs.eclipse.org/bugs/show_bug.cgi?id=408723

It will be solved in 9.0.4

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top