NutzCN Logo
问答 quartz 整合 NutQuartzCronJobFactory 没有定义
发布于 3212天前 作者 qq_ad4f65cb 3953 次浏览 复制 上一个帖子 下一个帖子
标签:

最新版 插件

MainSetup 如下

public class MainSetup implements Setup {

    public void init(NutConfig conf) {
        Ioc ioc = conf.getIoc();
        Dao dao = ioc.get(Dao.class);
        System.out.println("+++++++++++++++++" +ioc.has("NutQuartzCronJobFactory"));
        conf.getIoc().get(NutQuartzCronJobFactory.class).addPackage("org.nutz.integration.quartz.NutQuartzCronJobFactory");
    }

启动log

2016-03-07 16:20:46,953 org.nutz.dao.impl.DaoSupport.setDataSource(DaoSupport.java:224) DEBUG - Database info --> MYSQL:[MySQL - 5.6.16]
+++++++++++++++++false
2016-03-07 16:20:46,958 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:153) DEBUG - Get 'NutQuartzCronJobFactory'<class org.nutz.integration.quartz.NutQuartzCronJobFactory>
2016-03-07 16:20:46,959 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:173) DEBUG - 	 >> Load definition name=NutQuartzCronJobFactory
2016-03-07 16:20:46,960 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:147)
	at com.zyhk.paymentBalance.MainSetup.init(MainSetup.java:25)
	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 16:20:46,961 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:126) ERROR - try to depose ioc
2016-03-07 16:20:46,963 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:245) INFO  - org.nutz.ioc.impl.NutIoc@4838948 is closing. startup date [16-03-07 16:20:46.110]
2016-03-07 16:20:46,963 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:91) DEBUG - Depose object 'dao' ...
2016-03-07 16:20:46,964 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:91) DEBUG - Depose object 'conf' ...
2016-03-07 16:20:46,964 org.nutz.ioc.impl.ScopeContext.clear(ScopeContext.java:91) DEBUG - Depose object 'dataSource' ...
2016-03-07 16:20:46,968 com.alibaba.druid.pool.DruidDataSource.close(DruidDataSource.java:1385) INFO  - {dataSource-1} closed
2016-03-07 16:20:46,968 org.nutz.ioc.impl.NutIoc.depose(NutIoc.java:249) INFO  - org.nutz.ioc.impl.NutIoc@4838948 is deposed. startup date [16-03-07 16:20:46.110]
三月 07, 2016 4:20:46 下午 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:147)
	at com.zyhk.paymentBalance.MainSetup.init(MainSetup.java:25)
	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 4:20:46 下午 org.apache.catalina.core.StandardContext startInternal
严重: Error filterStart
三月 07, 2016 4:20:46 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/paymentBalance] startup failed due to previous errors
三月 07, 2016 4:20:46 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/paymentBalance] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
三月 07, 2016 4:20:46 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/paymentBalance] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
三月 07, 2016 4:20:46 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/paymentBalance] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
三月 07, 2016 4:20:46 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
三月 07, 2016 4:20:46 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
三月 07, 2016 4:20:46 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 3917 ms
19 回复

debug一下quart iocloader , 看看加载了哪些bean

@wendal
ins ==null 直接rerurn了

/**
 * 预定义的Quartz Ioc配置
 * @author wendal
 *
 */
public class QuartzIocLoader extends JsonLoader {
    
    public QuartzIocLoader() {
    	_load("quartz.js");
    }

    @SuppressWarnings("unchecked")
    public void _load(String path) {
        InputStream ins = getClass().getClassLoader().getResourceAsStream("ioc/"+path);
        if (ins == null)
            ins = getClass().getResourceAsStream(path);
        if (ins == null)
            return;
        try {
            String s = Lang.readAll(new InputStreamReader(ins));
            Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>) Json.fromJson(s);
            if (null != map && map.size() > 0)
                getMap().putAll(map);
        } catch (Exception e) {
            if (e instanceof RuntimeException)
                throw (RuntimeException)e;
            throw new RuntimeException("load fail , path="+path, e);
        } finally {
            Streams.safeClose(ins);
        }
    }
}

jar里面没有quart.js?

@wendal

没有,直接就是null ,没有获取到

哪里下载的jar?

@wendal
百度网盘

@qq_ad4f65cb 百度网盘?哪里冒出来的 上maven中央库下载一个

@wendal
我重新下了个,还是那样~~,还是null

下载地址贴出来

@wendal
这回是

org/slf4j/Logger FAIL to create Ioc Bean name=[scheduler] FAIL to create Ioc Bean name=[nutQuartzCronJobFactory]

log太长, 这里是链接 http://nutz.cn/yvr/t/sp615u3hiuisjr4b7gmaql2s4k

之前找不到js是因为我直接按照https://github.com/nutzam/nutzmore/tree/master/nutz-integration-quartz 这个做的,所有他没有js..

@qq_ad4f65cb
我直接把 源文件贴过来了,没有js。。。

用jar包,把拷贝过来的源码全删

晚上改一下说明才行

@wendal
删了,可是现在是这个错

org/slf4j/Logger FAIL to create Ioc Bean name=[scheduler] FAIL to create Ioc Bean name=[nutQuartzCronJobFactory]

log太长, 这里是链接 http://nutz.cn/yvr/t/sp615u3hiuisjr4b7gmaql2s4k

缺slf4j相关的jar

加上最新的slf4j-api和slf4j-log4j12就好了

@wendal
好了,多谢,终于弄好了~

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