SpringMVC开发时出现的错误

1.
Caused by: org.springframework.beans.factory.BeanCreationException:

Error creating bean with name ‘cusCustomerDaoMybatisImpl’:

Injection of resource dependencies failed;

nested exception is org.springframework.beans.factory.BeanCreationException:

Error creating bean with name ‘sqlSession’ defined in class path resource [applicationContext-dao.xml]:

Cannot resolve reference to bean ‘sqlSessionFactory’ while setting constructor argument;

nested exception is org.springframework.beans.factory.BeanCreationException:

Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [applicationContext-dao.xml]:

Invocation of init method failed; nested exception is org.springframework.core.NestedIOException:

Failed to parse mapping resource: ‘file [D:\软件\eclipse\JAVAWorks\saleSys\target\classes\com\yc\dao\SaleOrderDaoMapper.xml]’;

nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance.

Cause: org.xml.sax.SAXParseException; lineNumber: 36; columnNumber: 42; 必须为元素类型 “insert” 声明属性 “useGeneratesKeys”。

错误原因:没写public void setSqlSession(SqlSessionTemplate sqlSession) {
this.sqlSession = sqlSession;
}


2.
Error creating bean with name ‘org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping’:
Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping.
Cannot map ‘saleOrderController’ method

错误原因:@RequestMapping(name=”saleOrder_save.action”)应该为@RequestMapping(”saleOrder_save.action”)

3.
严重: Servlet.service() for servlet [springmvc] in context with path [/saleSys] threw exception
[Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name ‘saleProductController’:
Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.
NoSuchBeanDefinitionException:
No bean named ‘SaleProductBizImpl’ available] with root cause

错误原因: @Resource(name=”SaleProductBizImpl”)应该为@Resource(name=”saleProductBizImpl”)


4.日志出不来 log4j的jar包slf4j的jar包有冲突

5.tomcat错误一般都是xml文件出错

6.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name
‘org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping’:
Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘userController’ method

错误原因:@RequestMapping()中的值相同

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值