我在一个service中调用一个service的事务方法,调用方法如下:
TermService service = Enhancer.enhance(TermService.class); service.updateSearchTimes(con.getKeywords());
被调用的service代码如下:
@Override @Before(Tx.class) public void updateSearchTimes(String name) throws KitException { Term cond = new Term(); cond.setName(name); cond.setStatus(TermConstant.TERM_REVIEW_PASS); List<Term> list = find(cond); TermSearchLog hotSearch = new TermSearchLog(); hotSearch.setId(KitIdGenerator.uuid()); hotSearch.setCreateTime(DateUtil.nowDate()); if(null==list || list.size()==0){ hotSearch.setName(name); hotSearch.setTermId("-1"); hotSearch.save(); return; } Term term = list.get(0); hotSearch.setName(term.getName()); hotSearch.setTermId(term.getTermId()); hotSearch.save(); AtomicLong al = new AtomicLong(null==term.getSearchTimes()?0 :term.getSearchTimes()); cond.setSearchTimes(al.incrementAndGet()); update(cond); }
结果报错,报错信息如下:
java.lang.NoSuchMethodError: java.lang.Object.updateSearchTimes(Ljava/lang/String;)V
项目:JFinal