NutzCN Logo
问答 java.lang.ClassNotFoundException: quartz
发布于 2344天前 作者 qq_5a88e4e5 1633 次浏览 复制 上一个帖子 下一个帖子
标签:

maven

  <!-- https://mvnrepository.com/artifact/org.nutz/nutz-integration-quartz -->
        <dependency>
            <groupId>org.nutz</groupId>
            <artifactId>nutz-integration-quartz</artifactId>
            <version>1.r.63.r5</version>
        </dependency>

public class MainSetupBy implements Setup {
    @Override
    public void init(NutConfig nc) {

        nc.getIoc().get(Scheduler.class);
        Dao dao = nc.getIoc().get(Dao.class, "dao");
        NutTxDao tx1 = new NutTxDao(dao).setDebug(true);
        Record re = dao.fetch("book", Cnd.where("id", "=", 3));
        System.out.println(re.getString("name"));
        try {
            tx1.beginRC();
            tx1.update(Book.class, Chain.make("name", "化学"), Cnd.where("id", "=", "3"));
            tx1.update(Book.class, Chain.make("name", "化学"), Cnd.where("id", "=", "4"));
            tx1.commit();
        } catch (Throwable e) {
            tx1.rollback();
        } finally {
            tx1.close();
        }
    }
}
@IocBy(type=ComboIocProvider.class, args={
        "*js", "ioc/",
        "*anno", "com.lx.demo",
        "*tx",
        "*quartz"})
15 回复

nutz版本比较低吧?? 这样写 "*org.nutz.plugins.quartz.QuartzIocLoader"

还是不行

java.lang.RuntimeException: java.lang.ClassNotFoundException: org.nutz.plugins.quartz.QuartzIocLoader
	at org.nutz.lang.Lang.wrapThrow(Lang.java:185)
	at org.nutz.mvc.ioc.provider.ComboIocProvider.create(ComboIocProvider.java:23)
	at org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:384)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:103)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4637)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5282)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.nutz.plugins.quartz.QuartzIocLoader
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1136)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.nutz.lang.Lang.loadClass(Lang.java:2074)
	at org.nutz.ioc.loader.combo.ComboIocLoader.createIocLoader(ComboIocLoader.java:122)
	at org.nutz.ioc.loader.combo.ComboIocLoader.<init>(ComboIocLoader.java:98)
	at org.nutz.mvc.ioc.provider.ComboIocProvider.create(ComboIocProvider.java:20)

quartz IDEA报错无法解析

org.nutz.integration.quartz.QuartzIocLoader 这个

java.lang.RuntimeException: java.lang.ClassNotFoundException: org.nutz.integration.quartz.QuartzIocLoader
	at org.nutz.lang.Lang.wrapThrow(Lang.java:185)
	at org.nutz.mvc.ioc.provider.ComboIocProvider.create(ComboIocProvider.java:23)
	at org.nutz.mvc.impl.NutLoading.createIoc(NutLoading.java:384)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:103)
	at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
	at org.nutz.mvc.NutFilter._init(NutFilter.java:91)
	at org.nutz.mvc.NutFilter.init(NutFilter.java:69)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:285)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:266)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4637)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5282)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
	at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:482)
	at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:431)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.nutz.integration.quartz.QuartzIocLoader
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308)
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1136)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.nutz.lang.Lang.loadClass(Lang.java:2074)
	at org.nutz.ioc.loader.combo.ComboIocLoader.createIocLoader(ComboIocLoader.java:122)
	at org.nutz.ioc.loader.combo.ComboIocLoader.<init>(ComboIocLoader.java:98)
	at org.nutz.mvc.ioc.provider.ComboIocProvider.create(ComboIocProvider.java:20)
	... 53 more

你加的是假的依赖吧, 搜一下QuartzIocLoader


package org.nutz.integration.quartz; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Map; import org.nutz.ioc.loader.json.JsonLoader; import org.nutz.json.Json; import org.nutz.lang.Lang; import org.nutz.lang.Streams; public class QuartzIocLoader extends JsonLoader { public QuartzIocLoader() { super(new String[0]); this._load("quartz.js", "conf"); } public QuartzIocLoader(String... args) { super(new String[0]); String confName = args.length > 0 ? args[0] : "conf"; this._load("quartz.js", confName); } public void _load(String path, String confName) { InputStream ins = this.getClass().getClassLoader().getResourceAsStream("ioc/" + path); if (ins == null) { ins = this.getClass().getResourceAsStream(path); }

既然有, 怎么还是报找不到类呢? 是不是前后有空格之类的

@IocBy(type=ComboIocProvider.class, args={
        "*anno", "com.lx.demo",
        "*tx",
        "*org.nutz.integration.quartz.QuartzIocLoader"})
@SetupBy(MainSetupBy.class)
@ChainBy(type = MyActionChainMaker.class, args = {})
@Filters(@By(type = MyFilter.class, args = {}))
public class MainModule {

}

org.apache.catalina.core.StandardContext.startInternal One or more Filters failed to start. Full details will be found in the appropriate container log file

你的环境有问题吧,重启吧

编译的时候不知道quartz 没有在lib里

pom.xml没update??

不知道为什么将各种配置什么的移到另一个项目就ok

maven 没有构建

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