ssm框架整合出现问题

myMarksa 2018-06-17 09:27:26
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orderService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.mall.db.mapper.TbItemDescMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(mappedName=, shareable=true, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)}
...全文
1134 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
myMarksa 2018-06-24
  • 打赏
  • 举报
回复
谁有带ssm框架+模板引擎的教程啊!!
myMarksa 2018-06-24
  • 打赏
  • 举报
回复
引用 13 楼 u012318873 的回复:
要注入的那个bean 上加注解 @Component

不行~
_jant 2018-06-22
  • 打赏
  • 举报
回复
要注入的那个bean 上加注解 @Component
myMarksa 2018-06-21
  • 打赏
  • 举报
回复
引用 8 楼 ilifetree 的回复:
[quote=引用 7 楼 weixin_41999507 的回复:]
[quote=引用 6 楼 ilifetree 的回复:]

史上最简单的spring+springMVC+mybaits整合SSM框架~Simple-SSM



一直报tomact 错误。、、[/quote] 错误信息贴出来,我看下[/quote]


我要把

改成html就报一下错误


还有一个问题,我想把访问路径开头的url改成demo

改了也没反应 ,改怎么改呢?
hi-face 2018-06-21
  • 打赏
  • 举报
回复
引用 7 楼 weixin_41999507 的回复:
[quote=引用 6 楼 ilifetree 的回复:]

史上最简单的spring+springMVC+mybaits整合SSM框架~Simple-SSM



一直报tomact 错误。、、[/quote] 错误信息贴出来,我看下
myMarksa 2018-06-21
  • 打赏
  • 举报
回复
我尝试了您的方法,第一个不是我想要的结果,我想要以html结尾。。
而第二个修改成这样还是访问了我原来的url。
<port>8080</port><!-- 端口号 -->
<path>/demo</path><!-- 访问项目路径 -->
<uriEncoding>utf-8</uriEncoding>
<server>tomcat7</server>
myMarksa 2018-06-21
  • 打赏
  • 举报
回复


引用 10 楼 ilifetree 的回复:
[quote=引用 9 楼 weixin_41999507 的回复:]
[quote=引用 8 楼 ilifetree 的回复:]
[quote=引用 7 楼 weixin_41999507 的回复:]
[quote=引用 6 楼 ilifetree 的回复:]

史上最简单的spring+springMVC+mybaits整合SSM框架~Simple-SSM



一直报tomact 错误。、、[/quote] 错误信息贴出来,我看下[/quote]


我要把

改成html就报一下错误


还有一个问题,我想把访问路径开头的url改成demo

改了也没反应 ,改怎么改呢?[/quote]

如果你想匹配/WEB-INF/ui下面的html页面的话,这样设置
<property name="suffix" value="" />

同时就要修改TestController ,相应的方法,如,原来的默认请求返回:return "index";,就要改成“return "index.jsp";”了

把访问路径开头的url改成demo,

<port>8080</port><!-- 端口号 -->
<path>/demo</path><!-- 访问项目路径 -->
<uriEncoding>utf-8</uriEncoding>
<server>tomcat7</server>



重启就可以了

会有打印信息的



[/quote]
谢谢您的回复。
myMarksa 2018-06-21
  • 打赏
  • 举报
回复
引用 6 楼 ilifetree 的回复:
史上最简单的spring+springMVC+mybaits整合SSM框架~Simple-SSM



一直报tomact 错误。、、
hi-face 2018-06-21
  • 打赏
  • 举报
回复
引用 9 楼 weixin_41999507 的回复:
[quote=引用 8 楼 ilifetree 的回复:]
[quote=引用 7 楼 weixin_41999507 的回复:]
[quote=引用 6 楼 ilifetree 的回复:]

史上最简单的spring+springMVC+mybaits整合SSM框架~Simple-SSM



一直报tomact 错误。、、[/quote] 错误信息贴出来,我看下[/quote]


我要把

改成html就报一下错误


还有一个问题,我想把访问路径开头的url改成demo

改了也没反应 ,改怎么改呢?[/quote]

如果你想匹配/WEB-INF/ui下面的html页面的话,这样设置
<property name="suffix" value="" />

同时就要修改TestController ,相应的方法,如,原来的默认请求返回:return "index";,就要改成“return "index.jsp";”了

把访问路径开头的url改成demo,

<port>8080</port><!-- 端口号 -->
<path>/demo</path><!-- 访问项目路径 -->
<uriEncoding>utf-8</uriEncoding>
<server>tomcat7</server>



重启就可以了

会有打印信息的



yjsl__ 2018-06-18
  • 打赏
  • 举报
回复
SSM整合的配置文件问题
stacksoverflow 2018-06-18
  • 打赏
  • 举报
回复
No qualifying bean of type [com.mall.db.mapper.TbItemDescMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependenc 提示创建OrderService的TbItemDescMapper出错,用autowire 注解试一下
myMarksa 2018-06-17
  • 打赏
  • 举报
回复
怎么会错呢。。在线求解答!!
myMarksa 2018-06-17
  • 打赏
  • 举报
回复
controller package com.mall.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.mall.db.po.TbItemDesc; import com.mall.service.IOrderService; @Controller public class sscon { private @Autowired IOrderService iOrderService; @RequestMapping("ss") public @ResponseBody List<TbItemDesc> s() { List<TbItemDesc> list = this.iOrderService.findById(679532); return list; } }
myMarksa 2018-06-17
  • 打赏
  • 举报
回复
service实现类 package com.mall.service.impl; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Service; import com.mall.db.mapper.TbItemDescMapper; import com.mall.db.po.TbItemDesc; import com.mall.db.po.TbItemDescExample; import com.mall.db.po.TbItemDescExample.Criteria; import com.mall.service.IOrderService; @Service public class OrderService implements IOrderService { private @Resource TbItemDescMapper tbItemDescMapper; public List<TbItemDesc> findById(long id) { TbItemDescExample example = new TbItemDescExample(); Criteria criteria = example.createCriteria(); criteria.andItemIdEqualTo(id); List<TbItemDesc> list = this.tbItemDescMapper.selectByExample(example); return list; } }

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧