NutzCN Logo
问答 NoSuchMethodError
发布于 3311天前 作者 milixiang 2542 次浏览 复制 上一个帖子 下一个帖子
标签: dao
@Inject protected Dao dao;
	
	public void execute(JobExecutionContext context) throws JobExecutionException {
		log.debug("clean Non-Active User , start");
		Date deadtime = new Date(System.currentTimeMillis() - 5*60*1000L); // 一天, 测试的时候可以改成1小时之类的
		Cnd cnd = Cnd.where("userId", ">", 10).and("createTime", "<", deadtime).and(Cnd.exps("emailChecked", "=", false).or("email", "IS", null));
		int deleted = dao.clear(UserProfile.class, cnd);
		log.debugf("delete %d UserProfile", deleted);
		
		Sql sql = Sqls.create("delete from $user_table where id > 10 and not exists (select 1 from $user_profile_table where $user_table.id = uid ) and ct < @deadtime");
		sql.vars().set("user_table", dao.getEntity(User.class).getTableName());
		sql.vars().set("user_profile_table", dao.getEntity(UserProfile.class).getTableName());
		sql.params().set("deadtime", deadtime);
		dao.execute(sql);
		log.debugf("delete %d User", sql.getUpdateCount());
		
		log.debug("clean Non-Active User , Done");
	}
java.lang.NoSuchMethodError: org.nutz.dao.Dao.execute(Lorg/nutz/dao/sql/Sql;)Lorg/nutz/dao/sql/Sql;
	at net.wendal.nutzbook.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:38)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
2015-10-29 13:34:00,011 org.quartz.core.ErrorLogger.schedulerError(QuartzScheduler.java:2425) ERROR - Job (DEFAULT.6da64b5bd2ee-eea58502-b67e-4bec-a715-7c9645e300ea threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NoSuchMethodError: org.nutz.dao.Dao.execute(Lorg/nutz/dao/sql/Sql;)Lorg/nutz/dao/sql/Sql;]
	at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.NoSuchMethodError: org.nutz.dao.Dao.execute(Lorg/nutz/dao/sql/Sql;)Lorg/nutz/dao/sql/Sql;
	at net.wendal.nutzbook.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:38)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	... 1 more
4 回复

换成1.b.53重新编译一次

@wendal clean 重启 clean 还是这样 本来就是53 untitled1_png

java.lang.NoSuchMethodError: org.nutz.dao.Dao.execute(Lorg/nutz/dao/sql/Sql;)Lorg/nutz/dao/sql/Sql;

这是1.b.53新增的Dao.execute(Sql sql)方法, 所以, 99%是有老的nutz.jar存在

老方法的签名是 dao,execute(Sql...sqls)

@wendal 果然还有个52也在

添加回复
请先登陆
回到顶部