Cannot find class for bean with name '/hello' defined in ServletContext resource [/WEB-INF/chapter2-servlet.xml]

今天第一天使用Spring MVC按照pdf上的例子来做第一个"Hello World",结果就报错了。

我用的是eclipse来做的。

  1. 首先新建一个web项目,项目截图如图所示,注意观察一下WEB-INF下面是没有"classes"文件夹的。

  2. 然后右键一下看看build path,然后我好想明白了点什么,编译之后的classes文件夹根本就没有放到WEB-INF目录下,当然会找不到类了。

  3. 后来直接把build path下的classes文件直接复制到了WEB-INF目录下,然后重启tomcat,我的hello, world就这样出来了。

希望能报这个错误给大家拿来参考下!

Cannot find class for bean with name '/hello' defined in ServletContext resource的更多相关文章

  1. Linux:Tomcat报错: Error creating bean with name 'mapScheduler' defined in ServletContext resource 的解决方法

    2013-12-31 14:22:28 [ERROR] [ContextLoader.java->initWebApplicationContext(220) Context initializ ...

  2. 错误/异常:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/beans_common.xml]...的解决方法

    1.第一个这种类型的异常 1.1.异常信息:org.springframework.beans.factory.BeanCreationException: Error creating bean w ...

  3. Error creating bean with name 'transactionManager' defined in ServletContext resource XXX

    spring & hibernate整合时候 ,并且使用hibernate.cfg.xml文件时回报这个错误, 解决办法,在hibernate.cfg.xml中加入 <property ...

  4. Spring MVC集成thymeleaf时提示:defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException

    错误提示: defined in ServletContext resource [/WEB-INF/SrpingMVCTest-servlet.xml]: Instantiation of bean ...

  5. Spring:No bean named 'beanScope' is defined

    初学Spring,“No bean named 'beanScope' is defined”这个问题困扰了我好几个小时,查资料无果后,重写好几遍代码后发现问题居然是配置文件不能放在包里...要放在s ...

  6. No bean named 'transactionManager' is defined

    2016-10-20 23:27:17.771 INFO 7096 --- [ main] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped &quo ...

  7. Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; neste

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto ...

  8. org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSessionRepositoryFilter' is defined

    spring-session 集成redis,web.xml配置filter时候出现  No bean named 'springSessionRepositoryFilter' is defined ...

  9. 【Spring】手动获取spring容器对象时,报no qualifying bean of type is defined

    手动获取容器对象时,报no qualifying bean of type is defined, 经过调查,发现手动获取的时候,该类所在的包必须经过spring容器初始化. 1.SpringConf ...

随机推荐

  1. Final-阶段站立会议3

    组名:天天向上 组长:王森 组员:张政.张金生.林莉.胡丽娜 代码地址:HTTPS:https://git.coding.net/jx8zjs/llk.git SSH:git@git.coding.n ...

  2. 解决Sublime Text 3 Package Control 问题

    我使用的环境是 Mac OS X 10.11.5. 安装Packet Control之后,尝试安装插件,出现如下问题: There are no packages available for inst ...

  3. ThinkPHP 3.2.3 简单后台模块开发(二)RBAC

    RBAC(Role-Based Access Controll)基于角色的访问控制 在 ThinkPHP3.2.3 中 RBAC 类位于 /ThinkPHP/Library/Org/Util/Rbac ...

  4. 【java基础学习】数据库编程

    数据库编程 import java.sql.*; public class JdbcDemo1{ public static void main(String[] args){ try{ //1.加载 ...

  5. ajax同步、异步执行简单理解与证明

    此理解范例代码来自前几篇随笔! 首先我们来先了解下AJAX: Ajax:全称“Asynchronous Javascript and XML”(异步Javascript和XML),他是由Javascr ...

  6. dom4j微信接口开发

    新建一个web项目,我用的是eclipse和tomcat7.0 ,外网环境用的nat123 先建立一个实体bean:TextMessage /** * xml基本对象 * @author xiaohu ...

  7. spring记录

    context:property-placeholder 是将properties加载到Spring上下文中,接下来在定义bean的时候就能用${xx.xx}来访问了. util:properties ...

  8. this的指向

    在JS中,有三种需要注意的this:寻常的this/事件的this/ajax请求的this. 寻常的this 这种this的判断很简单,this是指向执行函数的对象.下面是事例说明: var name ...

  9. CentOS 7 搭建 LNMP

    一.安装httpd 1.yum install httpd -y 2.启动服务:systemctl start httpd 3.设置开机启动:systemctl enable 二.安装mariadb ...

  10. AngularJS Best Practices: pretty urls

    By default, AngularJS will route URLs with a hashtag. For example: http://example.com/ http://exampl ...