NutzCN Logo
问答 定时任务多war包打包问题出错
发布于 3210天前 作者 william-xian 2340 次浏览 复制 上一个帖子 下一个帖子
标签:

2016-03-09 18:11:28,452 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.ScopeContext - Remove object 'quartzCronJobFactory' from [app]
2016-03-09 18:11:28,453 [localhost-startStop-1] ERROR org.nutz.mvc.impl.NutLoading - Error happend during start serivce!
org.nutz.ioc.IocException: Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature FAIL to create Ioc Bean name=[schedulerFactory]
beacase [Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature] FAIL to create Ioc Bean name=[scheduler]
beacase [Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature FAIL to create Ioc Bean name=[schedulerFactory]
beacase [Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature]] FAIL to create Ioc Bean name=[quartzCronJobFactory]
beacase [Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature FAIL to create Ioc Bean name=[schedulerFactory]
beacase [Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature] FAIL to create Ioc Bean name=[scheduler]
beacase [Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature FAIL to create Ioc Bean name=[schedulerFactory]
beacase [Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature]]]
at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:141)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:196)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:221)
at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:140)
at cn.travelman.shiyu.module.extra.MainSetup.initCronJob(MainSetup.java:45)
at cn.travelman.shiyu.module.extra.MainSetup.init(MainSetup.java:30)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:270)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:119)
at org.nutz.mvc.ActionHandler.(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:77)
at cn.travelman.shiyu.mvc.ShiyuFilter.init(ShiyuFilter.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:4574)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5193)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
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.deployWAR(HostConfig.java:945)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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:745)
Caused by: org.nutz.ioc.IocException: Fail to born 'org.quartz.impl.StdSchedulerFactory'
by args: [
@(shiyucnf/quartz.properties)] becasue:
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/apache/catalina/loader/WebappClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of java/net/URLClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature FAIL to create Ioc Bean name=[schedulerFactory]
beacase [Fail to born 'org.quartz.impl.StdSchedulerFactory'

4 回复

多次引用slf4j?

有多个war包都会用到定时任务。quartz-2.2.1.jar依赖收录放j并有多份。这个问题的根源是多个war共享导致tomcat无法shutdown,在解决该问题时衍生出来的。通过裁剪发现是定时任务造成的。

定时任务中使用到了数据库连接,nutz提供的dao

这报错是slf4j的jar同时存在于webapp和tomcat lib吧??

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