NutzCN Logo
问答 定时任务报错
发布于 3159天前 作者 CXW0504 2934 次浏览 复制 上一个帖子 下一个帖子
标签:

interface org.quartz.Scheduler , no config to enable AOP for this type.
org.nutz.ioc.IocException: create ioc bean fail name=nutQuartzCronJobFactory ioc define:
{
"type" :"org.nutz.integration.quartz.NutQuartzCronJobFactory",
"singleton" :true,
"events" :{
"create" :"init"
},
"args" :[],
"fields" :[{
"name" :"scheduler",
"value" :{
"type" :"refer",
"value" :"scheduler"
},
"optional" :false
}, {
"name" :"conf",
"value" :{
"type" :"refer",
"value" :"conf"
},
"optional" :false
}],
"scope" :"app"
}
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:132)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:194)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:212)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:139)
at com.hgd.MainSetup.init(MainSetup.java:42)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:256)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:115)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:78)
at com.hgd.action.filter.NUTZHGDfilter.init(NUTZHGDfilter.java:28)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4659)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run

8 回复

需要定义一个叫conf的bean

		conf : {
			type : "org.nutz.ioc.impl.PropertiesProxy",
			fields : {
				paths : ["custom/"]
			}
		},

放在dao.js或其他你喜欢的ioc js文件中

@wendal
org.quartz.scheduler.instanceName=NutzbookScheduler
org.quartz.threadPool.threadCount=2
org.quartz.jobStore.class=org.quartz.simpl.RAMJobStore
org.quartz.scheduler.skipUpdateCheck=true

clean non-active user

cron.com.hgd.task.CleanNonActiveOrderJob=0 0/1 * * * ?
cron.com.hgd.task.Autocensure=0 0/2 * * * ?
var ioc = {
conf : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : ["custom/"]
}
},
昨晚配置了,还是这样,没弄明白原理,

贴完整报错信息

@wendal 我把定时器删除了,发现IOC 一获取,就报错。
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.0.32
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Feb 2 2016 19:34:53 UTC
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.0.32.0
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 7
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jre7
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.7.0_80-b15
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\tomcat\apache-tomcat-8.0.32
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\tomcat\apache-tomcat-8.0.32
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:62478
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\tomcat\apache-tomcat-8.0.32
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\tomcat\apache-tomcat-8.0.32
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\tomcat\apache-tomcat-8.0.32\wtpwebapps
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\tomcat\apache-tomcat-8.0.32\endorsed
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=UTF-8
三月 30, 2016 12:11:23 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jdk1.7.0_80/bin/../jre/bin/server;C:/Program Files/Java/jdk1.7.0_80/bin/../jre/bin;C:/Program Files/Java/jdk1.7.0_80/bin/../jre/lib/amd64;C:\Program Files\Java\jdk1.7.0_80\bin;C:\Program Files\Java\jdk1.7.0_80\jre\bin;;D:\eclipse;;.
三月 30, 2016 12:11:23 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
三月 30, 2016 12:11:23 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
三月 30, 2016 12:11:23 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
三月 30, 2016 12:11:23 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 644 ms
三月 30, 2016 12:11:23 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
三月 30, 2016 12:11:23 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.0.32
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor D:\tomcat\apache-tomcat-8.0.32\conf\Catalina\localhost\yun.xml
三月 30, 2016 12:11:23 下午 org.apache.catalina.startup.SetContextPropertiesRule begin
警告: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:yun' did not find a matching property.
三月 30, 2016 12:11:25 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
ALL Nutz Log via Log4jLogAdapter
三月 30, 2016 12:11:37 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter yun
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: create ioc bean fail name=tokenFilter ioc define:
{
"type" :"com.yun.action.filter.AccessTokenFilter",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"jedisPool",
"value" :{
"type" :"refer",
"value" :"jedisPool"
},
"optional" :false
}],
"scope" :"app"
}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:17)
at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
at org.nutz.lang.Mirror.born(Mirror.java:931)
at org.nutz.lang.Lang.wrapThrow(Lang.java:164)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:78)
at com.yun.action.filter.NUTZyunfilter.init(NUTZyunfilter.java:28)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4659)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:585)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1794)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.nutz.ioc.IocException: create ioc bean fail name=tokenFilter ioc define:
{
"type" :"com.yun.action.filter.AccessTokenFilter",
"singleton" :true,
"events" :{
},
"args" :[],
"fields" :[{
"name" :"jedisPool",
"value" :{
"type" :"refer",
"value" :"jedisPool"
},
"optional" :false
}],
"scope" :"app"
}
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:132)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:194)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:212)
at org.nutz.mvc.impl.Loadings.evalObj(Loadings.java:257)
at org.nutz.mvc.impl.processor.AbstractProcessor.evalObj(AbstractProcessor.java:48)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.init(ActionFiltersProcessor.java:25)
at org.nutz.mvc.impl.NutActionChainMaker.eval(NutActionChainMaker.java:34)
at org.nutz.mvc.impl.UrlMappingImpl.add(UrlMappingImpl.java:47)
at org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:187)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:102)
... 19 more
Caused by: org.nutz.ioc.IocException: create ioc bean fail name=jedisPool ioc define:
{
"type" :"redis.clients.jedis.JedisPool",
"singleton" :true,
"events" :{
"depose" :"destroy"
},
"args" :[{
"type" :"refer",
"value" :"jedisPoolConfig"
}, {
"type" :"java",
"value" :"$conf.get('redis.host', 'localhost')"
}, {
"type" :"java",
"value" :"$conf.getInt('redis.port', 6379)"
}, {
"type" :"java",
"value" :"$conf.getInt('redis.timeout', 2000)"
}, {
"type" :"java",
"value" :"$conf.get('redis.password')"
}, {
"type" :"java",
"value" :"$conf.getInt('redis.database', 0)"
}],
"fields" :[],
"scope" :"app"
}
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:132)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:194)
at org.nutz.ioc.val.ReferValue.get(ReferValue.java:24)
at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:31)
at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:56)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:123)
... 28 more
Caused by: org.nutz.ioc.IocException: For object [conf] - type:[]
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:201)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:212)
at org.nutz.ioc.java.IocObjectNode.getValue(IocObjectNode.java:19)
at org.nutz.ioc.java.ChainNode.eval(ChainNode.java:24)
at org.nutz.ioc.java.ChainNode.eval(ChainNode.java:19)
at org.nutz.ioc.val.JavaValue.get(JavaValue.java:69)
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:73)
... 33 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'conf' without define!
at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:140)
at org.nutz.ioc.loader.cached.CachedIocLoaderImpl.load(CachedIocLoaderImpl.java:47)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:169)
... 39 more

三月 30, 2016 12:11:37 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
三月 30, 2016 12:11:37 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/yun] startup failed due to previous errors
三月 30, 2016 12:11:37 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks
严重: The web application [yun] created a ThreadLocal with key of type [org.nutz.mvc.NutMvcContext$1] (value [org.nutz.mvc.NutMvcContext$1@1e38e024]) and a value of type [org.nutz.lang.util.SimpleContext] (value [{
}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
三月 30, 2016 12:11:37 下午 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deployment of configuration descriptor D:\tomcat\apache-tomcat-8.0.32\conf\Catalina\localhost\yun.xml has finished in 13,903 ms
三月 30, 2016 12:11:37 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\docs
三月 30, 2016 12:11:38 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\docs has finished in 1,448 ms
三月 30, 2016 12:11:39 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\examples
三月 30, 2016 12:11:48 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
三月 30, 2016 12:11:48 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
三月 30, 2016 12:11:48 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\examples has finished in 9,714 ms
三月 30, 2016 12:11:48 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\host-manager
三月 30, 2016 12:11:50 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\host-manager has finished in 1,512 ms
三月 30, 2016 12:11:50 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\manager
三月 30, 2016 12:11:51 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\manager has finished in 1,539 ms
三月 30, 2016 12:11:51 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\ROOT
三月 30, 2016 12:11:53 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\tomcat\apache-tomcat-8.0.32\webapps\ROOT has finished in 1,333 ms
三月 30, 2016 12:11:53 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
三月 30, 2016 12:11:53 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
三月 30, 2016 12:11:53 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 29776 ms

Caused by: org.nutz.ioc.ObjectLoadException: Object 'conf' without define!

你依然没有定义conf呢? 你把代码写哪里了? dao.js里面? 完整贴.

PS: 菜单里面有代码高亮的按钮, 在里面贴, 才不会这么乱.

@wendal 日记文档短点地址 https://nutz.cn/s/c/5J```

var ioc = {
conf : {
type : "org.nutz.ioc.impl.PropertiesProxy",
fields : {
paths : ["custom/"]
}
},
dataSource : {
type : "com.alibaba.druid.pool.DruidDataSource",
events : {
create : "init",
depose : 'close'
},
fields : {
url : {java:"$conf.get('db.url')"},
username : {java:"$conf.get('db.username')"},
password : {java:"$conf.get('db.password')"},
testWhileIdle : true,
validationQuery : {java:"$conf.get('db.validationQuery')"},
maxActive : {java:"$conf.get('db.maxActive')"},
filters : "mergeStat",
connectionProperties : "druid.stat.slowSqlMillis=2000"
}
},
dao : {
type : "org.nutz.dao.impl.NutDao",
args : [{refer:"dataSource"}]
}
};

```

Nutz.Mvc[hgd] is up in 42076ms

日志里面显示已经启动成功呢, 连cron job定义都打印了

job define name=com.hgd.task.Autocensure cron=0 0/2 * * * ?
添加回复
请先登陆
回到顶部