问题
I know this question is asked many times, I have tried all the possible solutions still the problem persists. Actually the very same project runs with 0 errors in Tomcat 8 which was deployed directly from netbeans. I created a new project in eclipse and deployed in Websphere Application Server 8.0. Then all goes fine but the URL is not recognized. My code is below.
Servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:lang="http://www.springframework.org/schema/lang"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd>
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
<mvc:annotation-driven />
<context:annotation-config />
<context:component-scan base-package="com.ibm.app" />
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="mediaTypes">
<map>
<entry key="html" value="text/html"/>
<entry key="json" value="application/json"/>
</map>
</property>
<property name="viewResolvers">
<list>
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/Content/pages/" />
<property name="suffix" value=".jsp" />
</bean>
</list>
</property>
<property name="defaultViews">
<list>
<bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
<property name="prefixJson" value="true"/>
</bean>
</list>
</property>
</bean>
<bean id="jspViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/Content/pages/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:resources/messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<!-- <bean id="portalDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="PORTALDB"/>
</bean>
<bean id="jdbcTemp" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="portalDataSource" />
</bean> -->
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />
</beans>
Controller
@Controller
public class AspireController {
@RequestMapping(value="/homes.htm", method = { RequestMethod.GET, RequestMethod.POST }, headers="Accept=*/*")
public String homes(Model model) {
System.out.println("AspireController || home");
return "Additem";
}
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>ReportGenerator</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
I am not able to find any problem as there are no errors except 1 at start up
> [2/4/15 13:10:31:050 IST] 0000001f webapp I
> com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message -
> [ReportGeneratorEAR#ReportGenerator.war]:.No Spring
> WebApplicationInitializer types detected on classpath [2/4/15
> 13:10:32:118 IST] 0000001f webapp I
> com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message -
> [ReportGeneratorEAR#ReportGenerator.war]:.Initializing Spring
> FrameworkServlet 'spring' [2/4/15 13:10:32:119 IST] 0000001f
> DispatcherSer I org.springframework.web.servlet.DispatcherServlet
> initServletBean FrameworkServlet 'spring': initialization started
> [2/4/15 13:10:32:256 IST] 0000001f XmlWebApplica I
> org.springframework.web.context.support.XmlWebApplicationContext
> prepareRefresh Refreshing WebApplicationContext for namespace
> 'spring-servlet': startup date [Wed Feb 04 13:10:32 IST 2015]; root of
> context hierarchy [2/4/15 13:10:32:292 IST] 0000021d AlarmThreadMo W
> UTLS0008W: The return of alarm thread "Deferrable Alarm : 1"
> (0000001f) to the alarm thread pool has been delayed for 12391
> milliseconds. This may be preventing normal alarm function within the
> application server. The alarm listener stack trace is as follows: at
> java.io.WinNTFileSystem.getBooleanAttributes(Native Method) at
> java.io.File.exists(File.java:744) at
> sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1231)
> at sun.misc.URLClassPath.getResource(URLClassPath.java:289) at
> java.net.URLClassLoader$ClassFinder.run(URLClassLoader.java:1036) at
> java.security.AccessController.doPrivileged(AccessController.java:288)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:429) at
> com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:198)
> at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:665) at
> java.lang.ClassLoader.loadClass(ClassLoader.java:644) at
> com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:113)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:627) at
> com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
> at
> com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
> at
> com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:597)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:627) at
> com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:565)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:627) at
> com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:565)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:627) at
> java.lang.ClassLoader.defineClassImpl(Native Method) at
> java.lang.ClassLoader.defineClass(ClassLoader.java:262) at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
> at
> com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:829)
> at
> com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:744)
> at
> com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:567)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:627) at
> org.springframework.context.support.AbstractRefreshableApplicationContext.createBeanFactory(AbstractRefreshableApplicationContext.java:195)
> at
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:128)
> at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
> at
> org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:631)
> at
> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:588)
> at
> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:645)
> at
> org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:508)
> at
> org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:449)
> at
> org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
> at javax.servlet.GenericServlet.init(GenericServlet.java:161) at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:336)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
> at
> com.ibm.ws.webcontainer.servlet.ServletWrapper.loadOnStartupCheck(ServletWrapper.java:1341)
> at
> com.ibm.ws.webcontainer.webapp.WebApp.doLoadOnStartupActions(WebApp.java:588)
> at
> com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinally(WebApp.java:559)
> at
> com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:421)
> at
> com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
> at
> com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
> at
> com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746)
> at
> com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
> at
> com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:422)
> at
> com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:714)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1160)
> at
> com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1369)
> at
> com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:638)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl.startModule(ApplicationMgrImpl.java:1656)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl.access$400(ApplicationMgrImpl.java:212)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl$3.run(ApplicationMgrImpl.java:1591)
> at
> com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5413)
> at
> com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5539)
> at
> com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl._startModule(ApplicationMgrImpl.java:1620)
> at
> com.ibm.ws.runtime.component.ApplicationMgrImpl$ApplicationNotifier.classChanged(ApplicationMgrImpl.java:1837)
> at
> com.ibm.ws.classloader.ClassLoaderManager.checkAndNotify(ClassLoaderManager.java:550)
> at
> com.ibm.ws.classloader.ClassLoaderManager.access$000(ClassLoaderManager.java:82)
> at
> com.ibm.ws.classloader.ClassLoaderManager$ReloadTimerTask.alarm(ClassLoaderManager.java:586)
> at com.ibm.ejs.util.am._Alarm.run(_Alarm.java:133) at
> com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659). [2/4/15
> 13:10:32:476 IST] 0000001f XmlBeanDefini I
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> loadBeanDefinitions Loading XML bean definitions from ServletContext
> resource [/WEB-INF/spring-servlet.xml] [2/4/15 13:10:32:936 IST]
> 0000001f ClassPathBean I
> org.springframework.context.annotation.ClassPathBeanDefinitionScanner
> registerDefaultFilters JSR-250 'javax.annotation.ManagedBean' found
> and supported for component scanning [2/4/15 13:10:32:938 IST]
> 0000001f ClassPathBean I
> org.springframework.context.annotation.ClassPathBeanDefinitionScanner
> registerDefaultFilters JSR-330 'javax.inject.Named' annotation found
> and supported for component scanning [2/4/15 13:10:33:716 IST]
> 0000001f PropertyPlace I
> org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
> loadProperties Loading properties file from ServletContext resource
> [/WEB-INF/jdbc.properties] [2/4/15 13:10:33:740 IST] 0000001f
> AutowiredAnno I
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
> <init > JSR-330 'javax.inject.Inject' annotation found and supported
> for autowiring [2/4/15 13:10:33:835 IST] 0000001f DefaultListab I
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> preInstantiateSingletons Pre-instantiating singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@6bae513:
> defining beans
> [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,aspireController,org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0,jspViewResolver,messageSource,propertyConfigurer,multipartResolver,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0];
> root of factory hierarchy [2/4/15 13:10:34:200 IST] 0000001f
> RequestMappin I
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
> registerHandlerMethod Mapped "{[/homes.htm],methods=[GET ||
> POST],params=[],headers=[],consumes=[],produces=[*/*],custom=[]}" onto
> public java.lang.String
> com.ibm.app.controller.AspireController.homes(org.springframework.ui.Model)
> [2/4/15 13:10:36:332 IST] 0000001f DispatcherSer I
> org.springframework.web.servlet.DispatcherServlet initServletBean
> FrameworkServlet 'spring': initialization completed in 4213 ms [2/4/15
> 13:10:36:333 IST] 0000001f servlet I
> com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I:
> [ReportGeneratorEAR] [/ReportGenerator] [spring]: Initialization
> successful. [2/4/15 13:10:36:334 IST] 0000001f webapp W
> com.ibm.ws.webcontainer.webapp.WebApp initializeStaticFileHandler
> SRVE0278E: Error while adding servlet mapping -- > /*. [2/4/15
> 13:10:36:334 IST] 0000001f webcontainer I
> com.ibm.ws.webcontainer.VirtualHostImpl addWebApplication SRVE0250I:
> Web Module ReportGenerator has been bound to
> default_host[*:9081,*:80,*:9444,*:5063,*:5062,*:443,*:10046,*:10049,*:10027,*:10025,*:10028,*:10039,*:10029,*:10032].
> [2/4/15 13:10:36:364 IST] 0000001f ApplicationMg I WSVR0226I: User
> initiated module start operation request completed on Module,
> ReportGenerator.war, of application, ReportGeneratorEAR [2/4/15
> 13:10:36:365 IST] 0000001f AlarmThreadMo W UTLS0009W: Alarm Thread
> "Deferrable Alarm : 1" (0000001f) previously reported to be delayed
> has now completed. It was active for approximately 16493
> milliseconds. [2/4/15 13:10:47:600 IST] 00000261 ApplicationMg I
> WSVR0227I: User initiated module stop operation requested on Module,
> ReportGenerator.war, of application, ReportGeneratorEAR [2/4/15
> 13:10:47:642 IST] 00000261 webapp I
> com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message -
> [ReportGeneratorEAR#ReportGenerator.war]:.Destroying Spring
> FrameworkServlet 'spring' [2/4/15 13:10:47:644 IST] 00000261
> XmlWebApplica I
> org.springframework.web.context.support.XmlWebApplicationContext
> doClose Closing WebApplicationContext for namespace 'spring-servlet':
> startup date [Wed Feb 04 13:10:32 IST 2015]; root of context hierarchy
> [2/4/15 13:10:47:645 IST] 00000261 DefaultListab I
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> destroySingletons Destroying singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@6bae513:
> defining beans
> [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,aspireController,org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0,jspViewResolver,messageSource,propertyConfigurer,multipartResolver,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0];
> root of factory hierarchy [2/4/15 13:10:47:709 IST] 00000261 servlet
> I com.ibm.ws.webcontainer.servlet.ServletWrapper doDestroy SRVE0253I:
> [ReportGeneratorEAR] [/ReportGenerator] [spring]: Destroy successful.
> [2/4/15 13:10:48:174 IST] 00000261 ApplicationMg I WSVR0228I: User
> initiated module stop operation request completed on Module,
> ReportGenerator.war, of application, ReportGeneratorEAR [2/4/15
> 13:10:53:306 IST] 00000261 ApplicationMg I WSVR0225I: User initiated
> module start operation requested on Module, ReportGenerator.war, of
> application, ReportGeneratorEAR [2/4/15 13:10:58:891 IST] 00000261
> webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup
> SRVE0169I: Loading Web Module: ReportGenerator. [2/4/15 13:10:59:065
> IST] 00000261 WASSessionCor I SessionContextRegistry getSessionContext
> SESN0176I: Will create a new session context for application key
> default_hostReportGenerator [2/4/15 13:11:06:710 IST] 00000261 webapp
> I com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message
> - [ReportGeneratorEAR#ReportGenerator.war]:.No Spring WebApplicationInitializer types detected on classpath [2/4/15
> 13:11:07:774 IST] 00000261 webapp I
> com.ibm.ws.webcontainer.webapp.WebApp log SRVE0292I: Servlet Message -
> [ReportGeneratorEAR#ReportGenerator.war]:.Initializing Spring
> FrameworkServlet 'spring' [2/4/15 13:11:07:775 IST] 00000261
> DispatcherSer I org.springframework.web.servlet.DispatcherServlet
> initServletBean FrameworkServlet 'spring': initialization started
> [2/4/15 13:11:07:914 IST] 00000261 XmlWebApplica I
> org.springframework.web.context.support.XmlWebApplicationContext
> prepareRefresh Refreshing WebApplicationContext for namespace
> 'spring-servlet': startup date [Wed Feb 04 13:11:07 IST 2015]; root of
> context hierarchy [2/4/15 13:11:08:117 IST] 00000261 XmlBeanDefini I
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> loadBeanDefinitions Loading XML bean definitions from ServletContext
> resource [/WEB-INF/spring-servlet.xml] [2/4/15 13:11:08:565 IST]
> 00000261 ClassPathBean I
> org.springframework.context.annotation.ClassPathBeanDefinitionScanner
> registerDefaultFilters JSR-250 'javax.annotation.ManagedBean' found
> and supported for component scanning [2/4/15 13:11:08:569 IST]
> 00000261 ClassPathBean I
> org.springframework.context.annotation.ClassPathBeanDefinitionScanner
> registerDefaultFilters JSR-330 'javax.inject.Named' annotation found
> and supported for component scanning [2/4/15 13:11:09:249 IST]
> 00000261 PropertyPlace I
> org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
> loadProperties Loading properties file from ServletContext resource
> [/WEB-INF/jdbc.properties] [2/4/15 13:11:09:264 IST] 00000261
> AutowiredAnno I
> org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
> <init > JSR-330 'javax.inject.Inject' annotation found and supported
> for autowiring [2/4/15 13:11:09:352 IST] 00000261 DefaultListab I
> org.springframework.beans.factory.support.DefaultListableBeanFactory
> preInstantiateSingletons Pre-instantiating singletons in
> org.springframework.beans.factory.support.DefaultListableBeanFactory@7a16141:
> defining beans
> [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.validation.beanvalidation.LocalValidatorFactoryBean#0,org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver#0,org.springframework.web.servlet.mvc.annotation.ResponseStatusExceptionResolver#0,org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver#0,org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,aspireController,org.springframework.web.servlet.view.ContentNegotiatingViewResolver#0,jspViewResolver,messageSource,propertyConfigurer,multipartResolver,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0];
> root of factory hierarchy [2/4/15 13:11:09:647 IST] 00000261
> RequestMappin I
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
> registerHandlerMethod Mapped "{[/homes.htm],methods=[GET ||
> POST],params=[],headers=[],consumes=[],produces=[*/*],custom=[]}" onto
> public java.lang.String
> com.ibm.app.controller.AspireController.homes(org.springframework.ui.Model)
> [2/4/15 13:11:11:567 IST] 00000261 DispatcherSer I
> org.springframework.web.servlet.DispatcherServlet initServletBean
> FrameworkServlet 'spring': initialization completed in 3790 ms [2/4/15
> 13:11:11:567 IST] 00000261 servlet I
> com.ibm.ws.webcontainer.servlet.ServletWrapper init SRVE0242I:
> [ReportGeneratorEAR] [/ReportGenerator] [spring]: Initialization
> successful. [2/4/15 13:11:11:568 IST] 00000261 webapp W
> com.ibm.ws.webcontainer.webapp.WebApp initializeStaticFileHandler
> SRVE0278E: Error while adding servlet mapping -- > /*. [2/4/15
> 13:11:11:569 IST] 00000261 webcontainer I
> com.ibm.ws.webcontainer.VirtualHostImpl addWebApplication SRVE0250I:
> Web Module ReportGenerator has been bound to
> default_host[*:9081,*:80,*:9444,*:5063,*:5062,*:443,*:10046,*:10049,*:10027,*:10025,*:10028,*:10039,*:10029,*:10032].
> [2/4/15 13:11:11:609 IST] 00000261 ApplicationMg I WSVR0226I: User
> initiated module start operation request completed on Module,
> ReportGenerator.war, of application, ReportGeneratorEAR [2/4/15
> 13:11:11:609 IST] 00000261 AppBinaryProc I ADMA7021I: Distribution
> of application ReportGeneratorEAR completed successfully. [2/4/15
> 13:11:11:616 IST] 00000261 FileRepositor A ADMR0015I: User
> defaultWIMFileBasedRealm/wpsadmin created document
> cells/9Cell/applications/ReportGeneratorEAR.ear/deltas/ReportGeneratorEAR/delta-1423035646490.
> [2/4/15 13:11:11:617 IST] 00000261 FileRepositor A ADMR0016I: User
> defaultWIMFileBasedRealm/wpsadmin modified document
> cells/9Cell/nodes/9Node/serverindex.xml. [2/4/15 13:11:11:617 IST]
> 00000261 FileRepositor A ADMR0016I: User
> defaultWIMFileBasedRealm/wpsadmin modified document
> cells/9Cell/applications/ReportGeneratorEAR.ear/deployments/ReportGeneratorEAR/deployment.xml.
> [2/4/15 13:11:11:618 IST] 00000261 FileRepositor A ADMR0016I: User
> defaultWIMFileBasedRealm/wpsadmin modified document
> cells/9Cell/applications/ReportGeneratorEAR.ear/deployments/ReportGeneratorEAR/META-INF/ibm-application-runtime.props.
> [2/4/15 13:11:41:557 IST] 000000b6 PageNotFound W
> org.springframework.web.servlet.PageNotFound noHandlerFound No mapping
> found for HTTP request with URI [/ReportGenerator/] in
> DispatcherServlet with name 'spring' [2/4/15 13:11:48:333 IST]
> 000000b6 PageNotFound W org.springframework.web.servlet.PageNotFound
> noHandlerFound No mapping found for HTTP request with URI
> [/ReportGenerator/home.htm] in DispatcherServlet with name 'spring'
> [2/4/15 13:11:50:470 IST] 000000b6 PageNotFound W
> org.springframework.web.servlet.PageNotFound noHandlerFound No mapping
> found for HTTP request with URI [/ReportGenerator/home.htm] in
> DispatcherServlet with name 'spring'
回答1:
After straining my eyes for while I changed this line
<context:component-scan base-package="com.ibm.app" />
to
<context:component-scan base-package="com.ibm.app.*" />
That worked like a charm. Thankyou all
来源:https://stackoverflow.com/questions/28316187/org-springframework-web-servlet-pagenotfound-nohandlerfound-no-mapping-found-for