Hey John,
same problem here. Something is wrong with the controller- or requestmapping: In my case it does not even pass through the HomeController (no System.out):
Code:
@Controller
public class HomeController {
private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
/**
* Simply selects the home view to render by returning its name.
*/
@RequestMapping(value = "/", method = RequestMethod.GET)
public String home(Locale locale, Model model) {
/*logger.info("Welcome home! the client locale is "+ locale.toString());
Date date = new Date();
DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
String formattedDate = dateFormat.format(date);
model.addAttribute("serverTime", formattedDate );
return "home";*/
System.out.println("HomeController: Passing through...");
return "WEB-INF/views/home.jsp";
}
}
Console output when starting the server:
Code:
Jan 23, 2012 7:23:37 PM com.springsource.tcserver.security.PropertyDecoder <init>
Information: tc Runtime property decoder using memory-based key
Jan 23, 2012 7:23:38 PM com.springsource.tcserver.security.PropertyDecoder <init>
Information: tcServer Runtime property decoder has been initialized in 285 ms
Jan 23, 2012 7:23:38 PM org.apache.coyote.AbstractProtocol init
Information: Initializing ProtocolHandler ["http-bio-8080"]
Jan 23, 2012 7:23:38 PM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
Information: Started up JMX registry on 127.0.0.1:6969 in 79 ms
Jan 23, 2012 7:23:38 PM org.apache.catalina.startup.Catalina load
Information: Initialization processed in 1042 ms
Jan 23, 2012 7:23:39 PM org.apache.catalina.core.StandardService startInternal
Information: Starting service Catalina
Jan 23, 2012 7:23:39 PM org.apache.catalina.core.StandardEngine startInternal
Information: Starting Servlet Engine: VMware vFabric tc Runtime 2.6.1.RELEASE/7.0.20.B.RELEASE
Jan 23, 2012 7:23:39 PM org.apache.catalina.startup.HostConfig deployDescriptor
Information: Deploying configuration descriptor gazetteer.xml from C:\Program Files\SpringSource Tool Suite\vfabric-tc-server-developer-2.6.1.RELEASE\spring-insight-instance\conf\Catalina\localhost
Jan 23, 2012 7:23:39 PM org.apache.catalina.startup.SetContextPropertiesRule begin
Warnung: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:DAIGazetteer' did not find a matching property.
Jan 23, 2012 7:23:39 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
Information: Context [localhost|gazetteer] will not be woven
Jan 23, 2012 7:23:39 PM org.apache.catalina.core.ApplicationContext log
Information: Initializing Spring root WebApplicationContext
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing Root WebApplicationContext: startup date [Mon Jan 23 19:23:39 CET 2012]; root of context hierarchy
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/root-context.xml]
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6a757925: defining beans []; root of factory hierarchy
INFO : org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 264 ms
Jan 23, 2012 7:23:40 PM org.apache.catalina.core.ApplicationContext log
Information: Initializing Spring FrameworkServlet 'appServlet'
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'appServlet': initialization started
INFO : org.springframework.web.context.support.XmlWebApplicationContext - Refreshing WebApplicationContext for namespace 'appServlet-servlet': startup date [Mon Jan 23 19:23:40 CET 2012]; parent: Root WebApplicationContext
INFO : org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/appServlet/servlet-context.xml]
INFO : org.springframework.context.annotation.ClassPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation found and supported for component scanning
INFO : org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
INFO : org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@419e8639: defining beans [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@6a757925
Jan 23, 2012 7:23:41 PM org.apache.catalina.startup.HostConfig deployDescriptor
Information: Deploying configuration descriptor insight.xml from C:\Program Files\SpringSource Tool Suite\vfabric-tc-server-developer-2.6.1.RELEASE\spring-insight-instance\conf\Catalina\localhost
Jan 23, 2012 7:23:41 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
Information: Context [localhost|insight] will not be woven
INFO : org.springframework.web.servlet.handler.SimpleUrlHandlerMapping - Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'appServlet': initialization completed in 801 ms
Jan 23, 2012 7:23:41 PM org.apache.catalina.core.ApplicationContext log
Information: Initializing Spring root WebApplicationContext
Jan 23, 2012 7:23:55 PM org.apache.catalina.core.ApplicationContext log
Information: Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet'
Jan 23, 2012 7:23:58 PM org.apache.catalina.startup.HostConfig deployDirectory
Information: Deploying web application directory manager
Jan 23, 2012 7:23:58 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
Information: Context [localhost|manager] will not be woven
Jan 23, 2012 7:23:58 PM org.apache.catalina.startup.HostConfig deployDirectory
Information: Deploying web application directory ROOT
Jan 23, 2012 7:23:58 PM com.springsource.insight.collection.tcserver.ltw.TomcatWeavingInsightClassLoader start
Information: Context [localhost|ROOT] will not be woven
Jan 23, 2012 7:23:58 PM org.apache.coyote.AbstractProtocol start
Information: Starting ProtocolHandler ["http-bio-8080"]
Jan 23, 2012 7:23:58 PM org.apache.catalina.startup.Catalina start
Information: Server startup in 19597 ms
WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/gazetteer/] in DispatcherServlet with name 'appServlet'
The last line is caused by trying to open "http://localhost:8080/gazetteer/"...
root-context.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
</beans>
servlet-context.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
<!-- Enables the Spring MVC @Controller programming model -->
<annotation-driven />
<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />
<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="org.dainst.gazetteer" />
</beans:beans>
Ideas anyone?