springmvc

来源:互联网 发布:淘宝层级和排名关系 编辑:程序博客网 时间:2024/06/05 06:58

Error creating bean with name 'userController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'studentService' is defined


springmvc 访问时报错误,问题是没有找到这个bean

上面启动tomcat服务器时,

八月 09, 2016 9:44:44 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath

这句话说明spring的配置文件没有找到,

我的web.xml中的配置

 <context-param>  
        <param-name>contextConfigLocation</param-name>  
        <param-value>classpath*:config/application.xml</param-value>  
        <!-- <param-value>classpath*:config/springAnnotation-servlet.xml</param-value> -->  
  </context-param>  


在tomcat的webapp目录下aplication.xml没有在config目录下

所以没有启动成功


application.xml文件应该放在红色config文件夹下,

而不是蓝色config文件夹内。



0 0
原创粉丝点击