关于ssm ,出现一个莫名其妙的错误,不太懂

裸睡的雨 2017-10-02 09:58:41

java.lang.IllegalStateException: The class com.e3mall.service.impl.ItemServiceImpl unimplemented interface interface com.e3mall.service.ItemCatService!

就这个接口实现类问题,还有一个也这样一点错没有
这是接口

package com.e3mall.service;

import java.util.List;

import com.e3mall.pojo.EasyUITreeNode;

public interface ItemCatService {
public List<EasyUITreeNode> getItemCatlist(long parentId) ;
}


这是接口实现类

package com.e3mall.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.e3mall.mapper.TbItemCatMapper;
import com.e3mall.pojo.EasyUITreeNode;
import com.e3mall.pojo.TbItemCat;
import com.e3mall.pojo.TbItemCatExample;
import com.e3mall.pojo.TbItemCatExample.Criteria;
import com.e3mall.service.ItemCatService;

/**
* 商品分类管理
* <p>Title: ItemCatServiceImpl</p>
* <p>Description: </p>
* <p>Company: www.itcast.cn</p>
* @version 1.0
*/
@Service
public class ItemCatServiceImpl implements ItemCatService {

@Autowired
private TbItemCatMapper itemCatMapper;

@Override
public List<EasyUITreeNode> getItemCatlist(long parentId) {
//根据parentId查询子节点列表
TbItemCatExample example = new TbItemCatExample();
Criteria criteria = example.createCriteria();
//设置查询条件
criteria.andParentIdEqualTo(parentId);
//执行查询
List<TbItemCat> list = itemCatMapper.selectByExample(example);
//创建返回结果List
List<EasyUITreeNode> resultList = new ArrayList<>();
//把列表转换成EasyUITreeNode列表
for (TbItemCat tbItemCat : list) {
EasyUITreeNode node = new EasyUITreeNode();
//设置属性
node.setId(tbItemCat.getId());
node.setText(tbItemCat.getName());
node.setState(tbItemCat.getIsParent()?"closed":"open");
//添加到结果列表
resultList.add(node);
}
//返回结果
return resultList;
}

}


我只要把这接口注释了就没错了,但要写,不太懂这个错什么鬼?
...全文
763 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
裸睡的雨 2017-10-02
  • 打赏
  • 举报
回复
已经找到错误了,是我的spring的xml了文件配置错误

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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