java.lang.NoSuchMethodError during invoking quartz job declared inside jboss mbean
Asked Answered
S

2

9

I've two ears deployed on one jboss instance. I'm using quartz configured inside mbean. Both of the ears are using StatefulJobs. Unfortunately one is using library antlr-runtime-3.0, but the second one antlr-runtime-3.2. When JBoss is invoking the job it takes the wrong library. I don't know how to force him to use library from the ear. My quartz version is upgraded to 1.8.6. JBoss is 4.2.2 GA

My first ear structure:

  • META-INF

  • antlr-runtime-3.0.jar

  • ejb.jar
  • app.war

My second ear structure:

  • META-INF
    • application.xml
    • jboss-app.xml
  • antlr-runtime-3.2.jar
  • ejb2.jar
  • app2.war

Application.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC
    "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
    "http://java.sun.com/dtd/application_1_3.dtd">
    <application>
    <display-name>ear</display-name>
    <module>
        <web>
            <web-uri>app.war</web-uri>
            <context-root>/</context-root>
        </web>
    </module>
    <module>
        <ejb>app.jar</ejb>
    </module>
</application>

jboss-app.xml

<?xml version='1.0' encoding='UTF-8' ?>
<jboss-app>
        <loader-repository>
            pck.class:app.war=unique-app.war
            <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
        </loader-repository>
</jboss-app>

Stack:

org.quartz.SchedulerException: Problem instantiating class 'package.quartz.WsclFailureJob' -  [See nested exception: java.lang.NoSuchMethodError: org.antlr.runtime.Lexer.<init>(Lorg/antlr/runtime/CharStream;Lorg/antlr/runtime/RecognizerSha
redState;)V]
        at org.quartz.core.JobRunShell.initialize(JobRunShell.java:147)
        at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:364)
Caused by: java.lang.NoSuchMethodError: org.antlr.runtime.Lexer.<init>(Lorg/antlr/runtime/CharStream;Lorg/antlr/runtime/RecognizerSharedState;)V
        at package.cond.antlr.CondLexer.<init>(CondLexer.java:55)
        at package.cond.antlr.CondLexer.<init>(CondLexer.java:52)
        at package.cond.ExpressionFactory.getValue(ExpressionFactory.java:58)
        at packagee.Configuration$ConfigInternal.loadParsableParams(Configuration.java:204)
        at packagee.Configuration$ConfigInternal.reload(Configuration.java:172)
        at packagee.Configuration$ConfigInternal.<init>(Configuration.java:161)
        at packagee.Configuration.reload(Configuration.java:56)
        at packagee.Configuration.<init>(Configuration.java:47)
        at packagee.Configuration.<clinit>(Configuration.java:38)
        at packagee.ScenarioProcessor.<init>(ScenarioProcessor.java:71)
        at packagee.ScenarioProcessor.<clinit>(ScenarioProcessor.java:58)
        at package.quartz.WsclFailureJob.<init>(WsclFailureJob.java:22)
        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:494)
        at java.lang.Class.newInstance0(Class.java:350)
        at java.lang.Class.newInstance(Class.java:303)
        at org.quartz.simpl.SimpleJobFactory.newJob(SimpleJobFactory.java:55)
        at org.quartz.core.JobRunShell.initialize(JobRunShell.java:140)
        ... 1 more

I was trying also with java2ParentDelegation set to true, but it doesn't work. When i'm adding this file to project my quartz invoking by jboss is giving mi ClassNotFoundError during retrieving job from quartz_table. Without this file everything is working well but when there is only one application deployed on jboss.

Stack with jboss-app.xml:

    15-04-15 17:49:00,010 TRACE [RepositoryClassLoader]  attempt(1) was: true for :org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25}
    2015-04-15 17:49:00,010 TRACE [LoadMgr3]  registerLoaderThread, ucl=org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25}, t=Thread[MySystemClusteredScheduler_QuartzSchedulerThread,5,QuartzScheduler:MySystemClusteredScheduler], prevT=null
    2015-04-15 17:49:00,010 TRACE [LoadMgr3]  Begin beginLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@f31cdb{classname: package.quartz.WsclFailureJob, requestingThread: Thread[MySystemClusteredScheduler_QuartzSchedulerThread,5,QuartzScheduler:MySystemClusteredScheduler], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25}, loadedClass: nullnull, loadOrder: 2147483647, loadException: null, threadTaskCount: 0, state: 0, #CCE: 0}
    2015-04-15 17:49:00,010 TRACE [RepositoryClassLoader]  loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25} name=package.quartz.WsclFailureJob
    2015-04-15 17:49:00,010 TRACE [RepositoryClassLoader]  Class in blacklist, name=package.quartz.WsclFailureJob
    2015-04-15 17:49:00,010 TRACE [RepositoryClassLoader]  loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25} name=package.quartz.WsclFailureJob not found
    2015-04-15 17:49:00,010 TRACE [LoadMgr3]  End beginLoadTask, ClassNotFoundException
    2015-04-15 17:49:00,010 TRACE [LoadMgr3]  Begin endLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@f31cdb{classname: package.quartz.WsclFailureJob, requestingThread: Thread[MySystemClusteredScheduler_QuartzSchedulerThread,5,QuartzScheduler:MySystemClusteredScheduler], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25}, loadedClass: nullnull, loadOrder: 2147483647, loadException: null, threadTaskCount: 0, state: 0, #CCE: 0}
    2015-04-15 17:49:00,010 TRACE [RepositoryClassLoader]  release(1) for :org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25}
    2015-04-15 17:49:00,010 TRACE [RepositoryClassLoader]  released, holds: 0
    2015-04-15 17:49:00,010 TRACE [RepositoryClassLoader]  loadClass org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25} name=package.quartz.WsclFailureJob not found
    2015-04-15 17:49:00,011 ERROR [JobStoreTX]  Error retrieving job, setting trigger state to ERROR.
    org.quartz.JobPersistenceException: Couldn't retrieve job because a required class was not found: No ClassLoaders found for: package.quartz.WsclFailureJob [See nested exception: java.lang.ClassNotFoundException: No ClassLoaders found for: package.quartz.WsclFailureJob]
            at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveJob(JobStoreSupport.java:1416)
            at org.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2903)
            at org.quartz.impl.jdbcjobstore.JobStoreSupport$38.execute(JobStoreSupport.java:2871)
            at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3788)
            at org.quartz.impl.jdbcjobstore.JobStoreSupport.triggerFired(JobStoreSupport.java:2

865)
        at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:319)
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: package.quartz.WsclFailureJob
        at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)
        at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
        at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.quartz.simpl.InitThreadContextClassLoadHelper.loadClass(InitThreadContextClassLoadHelper.java:72)
        at org.quartz.simpl.CascadingClassLoadHelper.loadClass(CascadingClassLoadHelper.java:116)
    at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectJobDetail(StdJDBCDelegate.java:894)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport.retrieveJob(JobStoreSupport.java:1404)

Log without jboss-app.xml. Application is working well when there is only one deployed on jboss:

2015-04-15 17:53:40,370 TRACE [org.jboss.mx.loading.RepositoryClassLoader] loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44} name=package.quartz.WsclFailureJob class=class package.quartz.WsclFailureJob cl=org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44}
2015-04-15 17:53:40,370 TRACE [org.jboss.mx.loading.ClassLoadingTask] setLoadedClass, theClass=class package.quartz.WsclFailureJob, order=44
2015-04-15 17:53:40,370 TRACE [org.jboss.mx.loading.UnifiedLoaderRepository3] cacheLoadedClass, classname: package.quartz.WsclFailureJob, class: class package.quartz.WsclFailureJob, ucl: org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44}, prevClass: null
2015-04-15 17:53:40,370 TRACE [org.jboss.mx.loading.LoadMgr3] Notifying task of thread completion, loadTask:org.jboss.mx.loading.ClassLoadingTask@136e2ea3{classname: package.quartz.WsclFailureJob, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44}, loadedClass: class package.quartz.WsclFailureJobpackage.quartz.WsclFailureJob@3eeec5b4<CodeSource: (file:/jboss/server/default/tmp/deploy/tmp34768system.ear-contents/system.jar <no signer certificates>)>, loadOrder: 44, loadException: null, threadTaskCount: 0, state: 1, #CCE: 0}
2015-04-15 17:53:40,370 TRACE [org.jboss.mx.loading.LoadMgr3] End nextTask(0), loadTask=org.jboss.mx.loading.ClassLoadingTask@136e2ea3{classname: package.quartz.WsclFailureJob, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44}, loadedClass: class package.quartz.WsclFailureJobpackage.quartz.WsclFailureJob@3eeec5b4<CodeSource: (file:/jboss/server/default/tmp/deploy/tmp34768system.ear-contents/system.jar <no signer certificates>)>, loadOrder: 44, loadException: null, threadTaskCount: 0, state: 4, #CCE: 0}
2015-04-15 17:53:40,370 TRACE [org.jboss.mx.loading.LoadMgr3] Begin endLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@136e2ea3{classname: package.quartz.WsclFailureJob, requestingThread: Thread[main,5,jboss], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44}, loadedClass: class package.quartz.WsclFailureJobpackage.quartz.WsclFailureJob@3eeec5b4<CodeSource: (file:/jboss/server/default/tmp/deploy/tmp34768system.ear-contents/system.jar <no signer certificates>)>, loadOrder: 44, loadException: null, threadTaskCount: 0, state: 4, #CCE: 0}
2015-04-15 17:53:40,370 TRACE [org.jboss.mx.loading.RepositoryClassLoader] release(1) for :org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44}
2015-04-15 17:53:40,370 TRACE [org.jboss.mx.loading.RepositoryClassLoader] released, holds: 0
2015-04-15 17:53:40,371 TRACE [org.jboss.mx.loading.RepositoryClassLoader] loadClass org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44} name=package.quartz.WsclFailureJob class=class package.quartz.WsclFailureJob cl=org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44}
2015-04-15 17:53:40,371 TRACE [org.jboss.mx.loading.RepositoryClassLoader] loadClass org.jboss.mx.loading.UnifiedClassLoader3@7c067f03{ url=file:/jboss/server/default/tmp/deploy/tmp34768system.ear ,addedOrder=44} name=package.quartz.VerifyTimeoutJob, loadClassDepth=0

Stack without jboss-app.xml, but in case of 2 deployed applications with different versions of library antlr-runtime:

2015-04-15 19:01:11,307 TRACE [RepositoryClassLoader]  loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48} name=org.antlr.runtime.Recognize
rSharedState class=class org.antlr.runtime.RecognizerSharedState cl=org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48}
2015-04-15 19:01:11,307 TRACE [ClassLoadingTask]  setLoadedClass, theClass=class org.antlr.runtime.RecognizerSharedState, order=48
2015-04-15 19:01:11,307 TRACE [UnifiedLoaderRepository3]  cacheLoadedClass, classname: org.antlr.runtime.RecognizerSharedState, class: class org.antlr.runtime.RecognizerSharedState, ucl: org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ ur
l=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48}, prevClass: null
2015-04-15 19:01:11,307 TRACE [LoadMgr3]  Notifying task of thread completion, loadTask:org.jboss.mx.loading.ClassLoadingTask@61b7dc{classname: org.antlr.runtime.RecognizerSharedState, requestingThread: Thread[MySystemClusteredScheduler_QuartzS
chedulerThread,5,QuartzScheduler:MySystemClusteredScheduler], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48}, loadedClass: class org.a
ntlr.runtime.RecognizerSharedStateorg.antlr.runtime.RecognizerSharedState@196b1a5<CodeSource: (file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear-contents/antlr-runtime-3.2.jar <no signer certificates>)>, loadOrder: 48, loadEx
ception: null, threadTaskCount: 0, state: 1, #CCE: 0}
2015-04-15 19:01:11,307 TRACE [LoadMgr3]  End nextTask(0), loadTask=org.jboss.mx.loading.ClassLoadingTask@61b7dc{classname: org.antlr.runtime.RecognizerSharedState, requestingThread: Thread[MySystemClusteredScheduler_QuartzSchedulerThread,5,Qua
rtzScheduler:MySystemClusteredScheduler], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48}, loadedClass: class org.antlr.runtime.Recogni
zerSharedStateorg.antlr.runtime.RecognizerSharedState@196b1a5<CodeSource: (file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear-contents/antlr-runtime-3.2.jar <no signer certificates>)>, loadOrder: 48, loadException: null, threa
dTaskCount: 0, state: 4, #CCE: 0}
2015-04-15 19:01:11,307 TRACE [LoadMgr3]  Begin endLoadTask, task=org.jboss.mx.loading.ClassLoadingTask@61b7dc{classname: org.antlr.runtime.RecognizerSharedState, requestingThread: Thread[MySystemClusteredScheduler_QuartzSchedulerThread,5,Quart
zScheduler:MySystemClusteredScheduler], requestingClassLoader: org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48}, loadedClass: class org.antlr.runtime.Recognize
rSharedStateorg.antlr.runtime.RecognizerSharedState@196b1a5<CodeSource: (file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear-contents/antlr-runtime-3.2.jar <no signer certificates>)>, loadOrder: 48, loadException: null, threadT
askCount: 0, state: 4, #CCE: 0}
2015-04-15 19:01:11,307 TRACE [RepositoryClassLoader]  release(1) for :org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48}
2015-04-15 19:01:11,307 TRACE [RepositoryClassLoader]  released, holds: 0
2015-04-15 19:01:11,307 TRACE [RepositoryClassLoader]  loadClass org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48} name=org.antlr.runtime.RecognizerSharedState class=class org.antlr.runtime.RecognizerSharedState cl=org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48}
2015-04-15 19:01:11,307 TRACE [RepositoryClassLoader]  loadClass org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48} name=org.antlr.runtime.BitSet, loadClassDepth=0
2015-04-15 19:01:11,307 TRACE [RepositoryClassLoader]  Loaded class from cache, org.antlr.runtime.BitSet@15b3baf<CodeSource: (file:/home/name/jboss/server/default/tmp/deploy/tmp34122OTHER_SYSTEM.ear-contents/antlr-runtime-3.0.jar <no signer certificates>)>
2015-04-15 19:01:11,307 TRACE [RepositoryClassLoader]  loadClass org.jboss.mx.loading.UnifiedClassLoader3@1ab0a47{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34140system.ear ,addedOrder=48} name=org.antlr.runtime.BitSet class=class org.antlr.runtime.BitSet cl=org.jboss.mx.loading.UnifiedClassLoader3@45f0ed{ url=file:/home/name/jboss/server/default/tmp/deploy/tmp34122OTHER_SYSTEM.ear ,addedOrder=45}
2015-04-15 19:01:11,309 ERROR [ErrorLogger]  An error occured instantiating job to be executed. job= 'DEFAULT.package.quartz.WsclFailureJob'
org.quartz.SchedulerException: Problem instantiating class 'package.quartz.WsclFailureJob' -  [See nested exception: java.lang.NoSuchMethodError: org.antlr.runtime.Lexer.<init>(Lorg/antlr/runtime/CharStream;Lorg/antlr/runtime/RecognizerSharedState;)V]
        at org.quartz.core.JobRunShell.initialize(JobRunShell.java:147)
        at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:364)
Caused by: java.lang.NoSuchMethodError: org.antlr.runtime.Lexer.<init>(Lorg/antlr/runtime/CharStream;Lorg/antlr/runtime/RecognizerSharedState;)V
        at package.cond.antlr.CondLexer.<init>(CondLexer.java:55)
        at package.cond.antlr.CondLexer.<init>(CondLexer.java:52)
        at package.cond.ExpressionFactory.getValue(ExpressionFactory.java:58)
        at package.core.Configuration$ConfigInternal.loadParsableParams(Configuration.java:204)
        at package.core.Configuration$ConfigInternal.reload(Configuration.java:172)
        at package.core.Configuration$ConfigInternal.<init>(Configuration.java:161)
        at package.core.Configuration.reload(Configuration.java:56)
        at package.core.Configuration.<init>(Configuration.java:47)
        at package.core.Configuration.<clinit>(Configuration.java:38)
        at package.core.ScenarioProcessor.<init>(ScenarioProcessor.java:71)
        at package.core.ScenarioProcessor.<clinit>(ScenarioProcessor.java:58)
        at package.quartz.WsclFailureJob.<init>(WsclFailureJob.java:22)
        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:494)
        at java.lang.Class.newInstance0(Class.java:350)
        at java.lang.Class.newInstance(Class.java:303)
        at org.quartz.simpl.SimpleJobFactory.newJob(SimpleJobFactory.java:55)
        at org.quartz.core.JobRunShell.initialize(JobRunShell.java:140)

I was also trying quartz properties like:

org.quartz.scheduler.classLoadHelper.class=org.quartz.simpl.CascadingClassLoadHelper
org.quartz.scheduler.threadsInheritContextClassLoaderOfInitializer=true
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
Sloshy answered 15/4, 2015 at 15:47 Comment(2)
You can find a way to introduce your own classloader in code. Depending on how much control you have, you could create a factory that manually loads the class from the desired directoryHarl
I was thinking about it, but I thought that exists any better idea... It looks like a workaround...Sloshy
C
3

When you have two separate ears that have conflicting dependencies, it may help to isolate them in terms of classloaders. JBoss 4 is considered pretty old these days, but the required features were available ever since 3.0.2 apparently:

http://www.mastertheboss.com/jboss-server/jboss-configuration/jboss-classloader-issues

Cycle answered 19/4, 2015 at 15:30 Comment(4)
On the same JBoss, other than this two ear applications i've also deployed other applications : war & ear. So it's 4 applications. What is more I was trying to separete classLoaders by xml configuration, but it doesn't work. I post my xml configuration fo ear app. I cannot set isolated ears for all of the apps because they're using quartz mbeans and after that quartz won't be able to see job classes (I was trying to do that and I had NoClassLoadersFound Exception).Sloshy
I think Quartz not seeing classes may be actually a side effect of isolation working. There are docs and discussions about that (e.g. goo.gl/zn8v3U ) , people suggest defining Quartz config property org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=trueCycle
I've updated problem description about my quartz configuration. Unfortunately it doesn't help me. With isolated class loader quartz guided by JBoss doesn't see my classes. You can read that from second stack: " 2015-04-15 17:49:00,010 TRACE [RepositoryClassLoader] loadClassLocally, org.jboss.mx.loading.UnifiedClassLoader3@13b310f2{ url=null ,addedOrder=25} name=package.quartz.WsclFailureJob 2015-04-15 17:49:00,010 TRACE [RepositoryClassLoader] Class in blacklist, name=package.quartz.WsclFailureJob"Sloshy
I'm afraid my knowledge of JBoss 4 classloader doesn't go that deep, sorry. But my bet would be still on forcing the order of classloaders rather than other routes: the two libraries must be loaded first, overriding higher level classloaders. It's just logic of the situation as I see it. It may create big problems with Quartz, but otherwise I just don't see how that would work at all.Cycle
H
2

This is because of latest compiled class and dependent jar available in the application are of different version. For example: Let Class A compiled with dependent jar X in place then later same Class A compiled in different environment withe dependent jar X1 which consist new method called Y in that. now the class will be compiled because new method Y is available in jar X1 when the same Class A is used in the environment with jar X in place then it leads to the NoSuchMethod Exception when trying to load the class in the class memory. Classloader does the verification of the dependent classes before loading the class in the class memory before invoking real exceution.

Hexarchy answered 24/4, 2015 at 12:57 Comment(3)
Ok, but I've no idea how to fix it and to keep two ears? I've decided to change ear project into war one, but in this way I've less posibilities to use EJB endpoints and I had to use quartz manually through my application (not through Jboss Container)Sloshy
Two ears talking above here are different version of same application?Hexarchy
No, they are different applications using different versions of the same library, but their jobs are invoked by quartz which is controlled by the same container (JBoss) and that's the problem.Sloshy

© 2022 - 2024 — McMap. All rights reserved.