I am building a GWT app with Spring. I am having some issues to inject a dependency to one of my Servlets, so I am trying to narrow down what can be wrong.
First, when my app starts I get:
[WARN] Server class
‘org.springframework.web.context.ContextLoaderListener’
could not be found in the web app, but
was found on the system classpath
[WARN] Adding classpath entry
‘file:/home/macarse/.m2/repository/org/springframework/spring/2.5.6/spring-2.5.6.jar’
to the web app classpath for this
session For additional info see:
file:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/doc/helpInfo/webAppClassPath.html
[WARN] Server class
‘org.apache.commons.collections.map.CaseInsensitiveMap’
could not be found in the web app, but
was found on the system classpath
[WARN] Adding classpath entry
‘file:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/gwt-dev.jar’ to the web app classpath for this
session For additional info see:
file:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/doc/helpInfo/webAppClassPath.html
Jul 18, 2010 11:07:00 AM
org.springframework.web.context.ContextLoader
initWebApplicationContext INFO: Root
WebApplicationContext: initialization
started Jul 18, 2010 11:07:00 AM
org.springframework.context.support.AbstractApplicationContext
prepareRefresh INFO: Refreshing
org.springframework.web.context.support.XmlWebApplicationContext@16b904d:
display name [Root
WebApplicationContext]; startup date
[Sun Jul 18 11:07:00 ART 2010]; root
of context hierarchy Jul 18, 2010
11:07:00 AM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory INFO: Bean
factory for application context
[org.springframework.web.context.support.XmlWebApplicationContext@16b904d]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@1a8dfb3
Jul 18, 2010 11:07:01 AM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons INFO:
Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@1a8dfb3:
defining beans []; root of factory
hierarchy Jul 18, 2010 11:07:01 AM
org.springframework.web.context.ContextLoader
initWebApplicationContext
Is that OK?
In my web.xml I have:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:/META-INF/spring-presentation.xml, classpath*:/META-INF/spring-persistence.xml
</param-value>
</context-param>
Is there a way to know if those two xml were loaded?
Scan your application startup logs. You should find logs telling you which context files it loaded in the following format (log pattern might differ based on your log config):
org.springframework.beans.factory.xml.XmlBeanDefinitionReader (315): Loading XML bean definitions from ServletContext resource [/META-INF/spring-presentation.xml]
org.springframework.beans.factory.xml.XmlBeanDefinitionReader (315): Loading XML bean definitions from ServletContext resource [/META-INF/spring-persistence.xml]