NutzCN Logo
精华 Quartz 注解注入失败
发布于 3182天前 作者 qq_ad4f65cb 3657 次浏览 复制 上一个帖子 下一个帖子
标签: quartz

最新版的插件

这里是 MainModule

@IocBy(type=ComboIocProvider.class, args={"*js", "ioc/",
        "*anno", "com.xxx.demo","*org.nutz.integration.quartz.QuartzIocLoader",
        "*tx"})
@Ok("json:full")

这里是 MainSetup

public class MainSetup implements Setup {

    public void init(NutConfig conf) {
        Ioc ioc = conf.getIoc();
       // Scheduler.class;
        ioc.get(NutQuartzCronJobFactory.class);
		......

启动时抛错

2016-03-07 13:51:58,222 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:124) ERROR - Error happend during start serivce!
org.nutz.ioc.IocException: Object 'nutQuartzCronJobFactory' without define! For object [nutQuartzCronJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzCronJobFactory]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:211)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:229)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:148)
	at com.zyhk.paymentBalance.MainSetup.init(MainSetup.java:15)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at com.zyhk.paymentBalance.NutzNutFilter.init(NutzNutFilter.java:22)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	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.ObjectLoadException: Object 'nutQuartzCronJobFactory' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:154)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:176)
	... 21 more
2016-03-07 13:51:58,223 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:126) ERROR - try to depose ioc
2016-03-07 13:51:58,226 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:245) INFO  - org.nutz.ioc.impl.NutIoc@31975999 is closing. startup date [16-03-07 13:51:57.976]
2016-03-07 13:51:58,227 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:249) INFO  - org.nutz.ioc.impl.NutIoc@31975999 is deposed. startup date [16-03-07 13:51:57.976]
三月 07, 2016 1:51:58 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: Object 'nutQuartzCronJobFactory' without define! For object [nutQuartzCronJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzCronJobFactory]
	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:988)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:165)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:134)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at com.zyhk.paymentBalance.NutzNutFilter.init(NutzNutFilter.java:22)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	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: Object 'nutQuartzCronJobFactory' without define! For object [nutQuartzCronJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzCronJobFactory]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:211)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:229)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:148)
	at com.zyhk.paymentBalance.MainSetup.init(MainSetup.java:15)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
	... 16 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'nutQuartzCronJobFactory' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:154)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:176)
	... 21 more

三月 07, 2016 1:51:58 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
三月 07, 2016 1:51:58 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/paymentBalance] startup failed due to previous errors
三月 07, 2016 1:51:58 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
三月 07, 2016 1:51:58 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
三月 07, 2016 1:51:58 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 3204 ms
26 回复

是不是有自定义的quart.js ? 删掉

@wendal 没有,只有一个 quartz.properties

ioc.getNames 看看有无quart相关的bean

@wendal
只有这部分

dao
emailAuthenticator
dataSource
htmlEmail
nutQuartzJobFactory
userService
cleanNonActiveUserJob
txREPEATABLE_READ
txSERIALIZABLE
txNONE
txREAD_UNCOMMITTED
txREAD_COMMITTED

把启动日志完整贴上

话说,为啥conf,scheduler都没有呢

@wendal

conf
dao
emailAuthenticator
dataSource
htmlEmail
ITClassificationTableService
tDacService
ITIncomeImpItemService
pbflowDesignModule
ITMKeyPointService
ITCountyMonthlyReportService
sectionReportModule
userModule
ITPayImpItemService
nutQuartzJobFactory
tReportProcessService
reportAction
loginModule
pbManageModule
ITStructureIncomeService
userProfileModule
ITStructurePayService
reportModule
tCountyMonthlyReportMergeService
emailService
userService
ITAccountsService
cleanNonActiveUserJob
ITAreaPlanService
ITMonthReportStatusService
statusModule
tReportStatusService
ITRatioService
mDepartmentService
loginService
pbPowerModule
txREPEATABLE_READ
txSERIALIZABLE
txNONE
txREAD_UNCOMMITTED
txREAD_COMMITTED

有的,有的,我没贴完整的,这个是。。日志太长,我慢慢贴,你等下。

@wendal
日志 part 1

2016-03-07 14:12:58,977 org.nutz.mvc.NutFilter._init(NutFilter.java:81) INFO  - NutFilter[nutz] starting ...
2016-03-07 14:12:59,055 org.nutz.resource.Scans.<init>(Scans.java:486) DEBUG - Locations for Scans:
[FileSystemResourceLocation [root=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\classes], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\nutz-1.r.55.jar], JarResourceLocation [jarPath=D:\nutzbook\apache-tomcat-7.0.40\bin\tomcat-juli.jar], FileSystemResourceLocation [root=D:\nutzbook\eclipse], JarResourceLocation [jarPath=D:\nutzbook\apache-tomcat-7.0.40\bin\bootstrap.jar]]
2016-03-07 14:12:59,681 org.nutz.resource.Scans.init(Scans.java:75) DEBUG - Locations for Scans:
[JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\poi-scratchpad-3.9-20121203.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\quartz-2.2.1.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\log4j-1.2.15.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\axis2-kernel-1.6.2.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\commons-email-1.4.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\axis2-adb-1.6.2.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\mysql-connector-java-5.1.37.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\fastjson-1.1.24.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\poi-ooxml-3.9-20121203.jar], JarResourceLocation [jarPath=D:\nutzbook\apache-tomcat-7.0.40\bin\tomcat-juli.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\commons-dbutils-1.2.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\standard.jar], FileSystemResourceLocation [root=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\classes], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\nutz-1.r.55.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\druid-1.0.16.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\javax.mail.jar], JarResourceLocation [jarPath=D:\nutzbook\apache-tomcat-7.0.40\bin\bootstrap.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\poi-excelant-3.9-20121203.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\poi-3.9-20121203.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\poi-ooxml-schemas-3.9-20121203.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\commons-beanutils-1.8.3.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\jstl.jar], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\poi-examples-3.9-20121203.jar], FileSystemResourceLocation [root=D:\nutzbook\eclipse], JarResourceLocation [jarPath=D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\paymentBalance\WEB-INF\lib\axiom-api-1.2.13.jar]]
2016-03-07 14:12:59,686 org.nutz.mvc.config.AbstractNutConfig.getMainModule(AbstractNutConfig.java:128) DEBUG - MainModule: <com.zyhk.paymentBalance.MainModule>
2016-03-07 14:12:59,698 org.nutz.mvc.config.AbstractNutConfig.createLoading(AbstractNutConfig.java:59) DEBUG - Loading by class org.nutz.mvc.impl.NutLoading
2016-03-07 14:12:59,701 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:55) INFO  - Nutz Version : 1.r.55 
2016-03-07 14:12:59,701 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:56) INFO  - Nutz.Mvc[nutz] is initializing ...
2016-03-07 14:12:59,701 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:60) DEBUG - Web Container Information:
2016-03-07 14:12:59,702 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:61) DEBUG -  - Default Charset : UTF-8
2016-03-07 14:12:59,703 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:62) DEBUG -  - Current . path  : D:\nutzbook\eclipse\.
2016-03-07 14:12:59,703 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:63) DEBUG -  - Java Version    : 1.8.0_31
2016-03-07 14:12:59,703 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:64) DEBUG -  - File separator  : \
2016-03-07 14:12:59,703 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:65) DEBUG -  - Timezone        : Asia/Shanghai
2016-03-07 14:12:59,703 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:66) DEBUG -  - OS              : Windows 7 x86
2016-03-07 14:12:59,704 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:67) DEBUG -  - ServerInfo      : Apache Tomcat/7.0.40
2016-03-07 14:12:59,704 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:68) DEBUG -  - Servlet API     : 3.0
2016-03-07 14:12:59,704 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:73) DEBUG -  - ContextPath     : /paymentBalance
2016-03-07 14:12:59,704 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:74) DEBUG -  - context.tempdir : D:\nutzbook\eclipse\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\paymentBalance
2016-03-07 14:12:59,705 org.nutz.mvc.config.AbstractNutConfig.getMainModule(AbstractNutConfig.java:128) DEBUG - MainModule: <com.zyhk.paymentBalance.MainModule>
2016-03-07 14:12:59,705 org.nutz.mvc.impl.NutLoading.createContext(NutLoading.java:237) DEBUG - >> app.root = D:/nutzbook/eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/paymentBalance
2016-03-07 14:12:59,779 org.nutz.castor.Castors.reload(Castors.java:115) DEBUG - Using 94 castor for Castors
2016-03-07 14:12:59,781 org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:378) DEBUG - @IocBy(type=org.nutz.mvc.ioc.provider.ComboIocProvider, args=["*js", "ioc/", "*anno", "com.zyhk.paymentBalance", "*org.nutz.integration.quartz.QuartzIocLoader", "*tx"],init=[])
2016-03-07 14:12:59,809 org.nutz.resource.Scans.scan(Scans.java:233) DEBUG - Found 2 resource by src( ioc/ ) , regex( ^(.+[.])(js|json)$ )
2016-03-07 14:12:59,810 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:48) DEBUG - loading ioc js config from [dao.js]
2016-03-07 14:12:59,814 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:48) DEBUG - loading ioc js config from [mail.js]
2016-03-07 14:12:59,815 org.nutz.ioc.loader.json.JsonLoader.<init>(JsonLoader.java:56) DEBUG - Loaded 5 bean define from path=[ioc/] --> [conf, dao, emailAuthenticator, dataSource, htmlEmail]
2016-03-07 14:12:59,846 org.nutz.resource.Scans.scan(Scans.java:233) DEBUG - Found 154 resource by src( com/zyhk/paymentBalance/ ) , regex( ^.+[.]class$ )

叫nutQuartzJobFactory, get的时候带上名称吧

@wendal

2016-03-07 14:13:00,340 org.nutz.mvc.impl.UrlMappingImpl.printActionMapping(UrlMappingImpl.java:135) DEBUG -    '/manage/getaccountslist'   >> PbManageModule.getAccountsList(...) : Object     | @Ok(json ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2016-03-07 14:13:00,341 org.nutz.mvc.impl.UrlMappingImpl.printActionMapping(UrlMappingImpl.java:135) DEBUG -    '/manage/saveaccountslist'  >> PbManageModule.saveAccountsList(...) : Object     | @Ok(json ) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2016-03-07 14:13:00,342 org.nutz.mvc.impl.UrlMappingImpl.printActionMapping(UrlMappingImpl.java:135) DEBUG -    '/manage/report/expsubject' >> reportModule.expSubject(...)   : void       | @Ok(redirect:/pb/expReport/expSubject.jsp) @Fail(http:500) | by 0 Filters | (I:UTF-8/O:UTF-8)
2016-03-07 14:13:00,342 org.nutz.mvc.impl.NutLoading.evalUrlMapping(NutLoading.java:219) INFO  - Found 55 module methods
2016-03-07 14:13:00,345 org.nutz.mvc.impl.NutLoading.evalLocalization(NutLoading.java:333) DEBUG - @Localization not define
2016-03-07 14:13:00,345 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:273) INFO  - Setup application...
2016-03-07 14:13:00,347 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:153) DEBUG - Get 'nutQuartzCronJobFactory'<class org.nutz.integration.quartz.NutQuartzCronJobFactory>
2016-03-07 14:13:00,348 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:173) DEBUG - 	 >> Load definition name=nutQuartzCronJobFactory
2016-03-07 14:13:00,351 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:124) ERROR - Error happend during start serivce!
org.nutz.ioc.IocException: Object 'nutQuartzCronJobFactory' without define! For object [nutQuartzCronJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzCronJobFactory]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:211)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:229)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:148)
	at com.zyhk.paymentBalance.MainSetup.init(MainSetup.java:21)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at com.zyhk.paymentBalance.NutzNutFilter.init(NutzNutFilter.java:22)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	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.ObjectLoadException: Object 'nutQuartzCronJobFactory' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:154)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:176)
	... 21 more
2016-03-07 14:13:00,352 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:126) ERROR - try to depose ioc
2016-03-07 14:13:00,355 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:245) INFO  - org.nutz.ioc.impl.NutIoc@11582825 is closing. startup date [16-03-07 14:13:00.149]
2016-03-07 14:13:00,355 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:249) INFO  - org.nutz.ioc.impl.NutIoc@11582825 is deposed. startup date [16-03-07 14:13:00.149]

@qq_ad4f65cb

三月 07, 2016 2:13:00 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: Object 'nutQuartzCronJobFactory' without define! For object [nutQuartzCronJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzCronJobFactory]
	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:988)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:165)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:134)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at com.zyhk.paymentBalance.NutzNutFilter.init(NutzNutFilter.java:22)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	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: Object 'nutQuartzCronJobFactory' without define! For object [nutQuartzCronJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzCronJobFactory]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:211)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:229)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:148)
	at com.zyhk.paymentBalance.MainSetup.init(MainSetup.java:21)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
	... 16 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'nutQuartzCronJobFactory' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:154)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:176)
	... 21 more

三月 07, 2016 2:13:00 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
三月 07, 2016 2:13:00 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/paymentBalance] startup failed due to previous errors
三月 07, 2016 2:13:00 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
三月 07, 2016 2:13:00 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
三月 07, 2016 2:13:00 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 3090 ms

@wendal

我看了一下,ioc.getNames 确实没有nutQuartzJobFactory

应该是nutQuartzJobFactory

@wendal

    public void init(NutConfig conf) {
        Ioc ioc = conf.getIoc();
        ioc.get(NutQuartzJobFactory.class);

出错

2016-03-07 14:28:32,567 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:153) DEBUG - Get 'nutQuartzJobFactory'<class org.nutz.integration.quartz.NutQuartzJobFactory>
2016-03-07 14:28:32,567 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:173) DEBUG - 	 >> Load definition name=nutQuartzJobFactory
2016-03-07 14:28:32,569 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:124) ERROR - Error happend during start serivce!
org.nutz.ioc.IocException: Object 'nutQuartzJobFactory' without define! For object [nutQuartzJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzJobFactory]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:211)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:229)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:148)
	at com.zyhk.paymentBalance.MainSetup.init(MainSetup.java:21)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at com.zyhk.paymentBalance.NutzNutFilter.init(NutzNutFilter.java:22)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	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.ObjectLoadException: Object 'nutQuartzJobFactory' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:154)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:176)
	... 21 more
2016-03-07 14:28:32,570 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:126) ERROR - try to depose ioc
2016-03-07 14:28:32,572 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:245) INFO  - org.nutz.ioc.impl.NutIoc@24635712 is closing. startup date [16-03-07 14:28:32.353]
2016-03-07 14:28:32,573 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:249) INFO  - org.nutz.ioc.impl.NutIoc@24635712 is deposed. startup date [16-03-07 14:28:32.353]
三月 07, 2016 2:28:32 下午 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter nutz
org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: Object 'nutQuartzJobFactory' without define! For object [nutQuartzJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzJobFactory]
	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:988)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:165)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:134)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at com.zyhk.paymentBalance.NutzNutFilter.init(NutzNutFilter.java:22)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	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: Object 'nutQuartzJobFactory' without define! For object [nutQuartzJobFactory] - type:[class org.nutz.integration.quartz.NutQuartzJobFactory]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:211)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:229)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:148)
	at com.zyhk.paymentBalance.MainSetup.init(MainSetup.java:21)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
	... 16 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'nutQuartzJobFactory' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:154)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:176)
	... 21 more

三月 07, 2016 2:28:32 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
三月 07, 2016 2:28:32 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/paymentBalance] startup failed due to previous errors
三月 07, 2016 2:28:32 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
三月 07, 2016 2:28:32 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
三月 07, 2016 2:28:32 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 3111 ms

? 上面不是显示有bean叫nutQuartzJobFactory吗

@wendal

那个是我自己定义的类

 //ioc.get(com.zyhk.paymentBalance.base.bean.NutQuartzJobFactory.class);

我引用的类是

import org.nutz.integration.quartz.NutQuartzJobFactory;

那我不知道你改啥了,参考nutz.cn的源码吧

@wendal
我就是参考,入门文档的代码,然后引入 nutz-integration-quartz
修改 ioc.get(NutQuartzJobFactory.class);
然后就出现这个问题了啊

我说的是nutz.cn的源码,也就是这个论坛的源码,里面就是配好的,可用的。

问题有解决没?同样的错误, nutz-integration-quartz的文档不详细呀,程序没法运行。如果在dao.js加

nutQuartzCronJobFactory : {
		type : "org.nutz.integration.quartz.NutQuartzCronJobFactory"
	}

程序是能编译通过,但没法执行定时任务呀。

报的错误是:

org.nutz.mvc.LoadingException: org.nutz.ioc.IocException: [nutQuartzCronJobFactory, conf] # For object [conf] - type:[]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	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:990)
	at org.nutz.lang.Lang.wrapThrow(Lang.java:169)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:134)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:87)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:65)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
	at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: org.nutz.ioc.IocException: [nutQuartzCronJobFactory, conf] # For object [conf] - type:[]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:217)
	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:135)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:209)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:235)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
	at com.quart.test.MainSetup.init(MainSetup.java:23)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:276)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:120)
	... 17 more
Caused by: org.nutz.ioc.ObjectLoadException: Object 'conf' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:166)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:181)
	... 27 more

异常信息说这个nutQuartzCronJobFactory未在dao.js定义

异常说的不是"nutQuartzCronJobFactory未在dao.js定义", 而是 conf 未定义

http://nutzbook.wendal.net/dev_prepare/better_dao_js.html

找到原因了,原来约定的是读取属性文件的bean名称是"conf",我之前的代码定义的都是“config”,只做简单的读取数据源操作,没问题,用这个 nutz-integration-quartz插件就有问题了,这个问题nutz-integration-quartz需在文档里说明下注意事项。另外我做的 nutz-plugins-multiview 多视图插件读取属性文件的bean名称用的是“config”,看来要改成“conf”了,防止重复定义,统一用“conf”吧。
以下是我之前读取属性文件的bean定义:

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

@wendal 任务定时执行了,但是还是报错

2016-10-27 10:56:32,082 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 1 triggers
2016-10-27 10:57:00,017 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:151) DEBUG - Get 'recordNodeInfoJob'<class com.amax.quartz.job.RecordNodeInfoJob>
2016-10-27 10:57:00,017 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:177) DEBUG - 	 >> Load definition name=recordNodeInfoJob
2016-10-27 10:57:00,022 org.nutz.integration.quartz.NutQuartzJobFactory.newJob(NutQuartzJobFactory.java:30) WARN  - Not ioc bean? fallback to SimpleJobFactory
org.nutz.ioc.IocException: [recordNodeInfoJob] # For object [recordNodeInfoJob] - type:[class com.amax.quartz.job.RecordNodeInfoJob]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:218)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:239)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:146)
	at org.nutz.integration.quartz.NutQuartzJobFactory.newJob(NutQuartzJobFactory.java:27)
	at org.quartz.core.JobRunShell.initialize(JobRunShell.java:127)
	at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:375)
Caused by: org.nutz.ioc.ObjectLoadException: Object 'recordNodeInfoJob' without define!
	at org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:174)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:180)
	... 5 more
2016-10-27 10:57:00,026 org.quartz.simpl.SimpleJobFactory.newJob(SimpleJobFactory.java:51) DEBUG - Producing instance of Job 'DEFAULT.com.amax.quartz.job.RecordNodeInfoJob', class=com.amax.quartz.job.RecordNodeInfoJob
2016-10-27 10:57:00,027 org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:276) DEBUG - batch acquisition of 0 triggers
2016-10-27 10:57:00,030 org.quartz.core.JobRunShell.run(JobRunShell.java:201) DEBUG - Calling execute on job DEFAULT.com.amax.quartz.job.RecordNodeInfoJob
job is run!

一个简单的任务 就是答应job is run!,他也按计划每分钟执行一次,但是还是报错没注入进去????

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