Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: 2 Major 2 Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 1.8.5, 2.0.2, 2.1
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None
    • Terracotta Target:
      Unknown
    • Fixed In Revision:
      2290

      Description

      A soon as I enable JMX exposition (org.quartz.scheduler.jmx.export=true) in Quartz properties, jobs are not triggered anymore and an exception is raised by transaction manager (Bitronix) when job wakes up because a query is executed on an XADataSource without any declared transaction :

        Activity

        Hide
        Gerald Quintana added a comment -

        Stack trace

         
        2011-07-19 02:00:00,208 [etd-QuartzScheduler_Worker-2] ERROR org.quartz.core.ErrorLogger - Unable to notify JobListener(s) of Job to be executed: (Job will NOT be executed!). trigger= DEFAULT.myTrigger job= DEFAULT.myJob
        org.quartz.SchedulerException: JobListener 'QuartzSchedulerMBeanImpl.listener' threw exception: null [See nested exception: java.lang.reflect.UndeclaredThrowableException]
        	at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1932)
        	at org.quartz.core.JobRunShell.notifyListenersBeginning(JobRunShell.java:357)
        	at org.quartz.core.JobRunShell.run(JobRunShell.java:190)
        	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
        Caused by: java.lang.reflect.UndeclaredThrowableException
        	at $Proxy58.prepareStatement(Unknown Source)
        	at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectCalendars(StdJDBCDelegate.java:2803)
        	at org.quartz.impl.jdbcjobstore.JobStoreSupport.getCalendarNames(JobStoreSupport.java:2076)
        	at org.quartz.impl.jdbcjobstore.JobStoreSupport$22.execute(JobStoreSupport.java:2068)
        	at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:242)
        	at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeWithoutLock(JobStoreSupport.java:3673)
        	at org.quartz.impl.jdbcjobstore.JobStoreSupport.getCalendarNames(JobStoreSupport.java:2065)
        	at org.quartz.core.QuartzScheduler.getCalendarNames(QuartzScheduler.java:1509)
        	at org.quartz.impl.StdScheduler.getCalendarNames(StdScheduler.java:608)
        	at org.quartz.core.jmx.JobExecutionContextSupport.determineCalendarName(JobExecutionContextSupport.java:87)
        	at org.quartz.core.jmx.JobExecutionContextSupport.toCompositeData(JobExecutionContextSupport.java:66)
        	at org.quartz.core.QuartzSchedulerMBeanImpl.jobToBeExecuted(QuartzSchedulerMBeanImpl.java:431)
        	at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1930)
        	... 3 more
        Caused by: java.lang.reflect.InvocationTargetException
        	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:71)
        	... 16 more
        Caused by: java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/XADataSource in state ACCESSIBLE with usage count 1 wrapping oracle.jdbc.driver.T4CXAConnection@4bcee4c7 on oracle.jdbc.driver.LogicalConnection@7c0debb2
        	at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:86)
        	at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:243)
        	at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        	at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63)
        	at $Proxy58.prepareStatement(Unknown Source)
        	... 20 more
        Caused by: bitronix.tm.internal.BitronixSystemException: resource 'jdbc/XADataSource' cannot be used outside XA transaction scope. Set allowLocalTransactions to true if you want to allow this and you know your resource supports this.
        	at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:79)
        	at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:84)
        	... 26 more
        
        
        Show
        Gerald Quintana added a comment - Stack trace 2011-07-19 02:00:00,208 [etd-QuartzScheduler_Worker-2] ERROR org.quartz.core.ErrorLogger - Unable to notify JobListener(s) of Job to be executed: (Job will NOT be executed!). trigger= DEFAULT.myTrigger job= DEFAULT.myJob org.quartz.SchedulerException: JobListener 'QuartzSchedulerMBeanImpl.listener' threw exception: null [See nested exception: java.lang.reflect.UndeclaredThrowableException] at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1932) at org.quartz.core.JobRunShell.notifyListenersBeginning(JobRunShell.java:357) at org.quartz.core.JobRunShell.run(JobRunShell.java:190) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549) Caused by: java.lang.reflect.UndeclaredThrowableException at $Proxy58.prepareStatement(Unknown Source) at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectCalendars(StdJDBCDelegate.java:2803) at org.quartz.impl.jdbcjobstore.JobStoreSupport.getCalendarNames(JobStoreSupport.java:2076) at org.quartz.impl.jdbcjobstore.JobStoreSupport$22.execute(JobStoreSupport.java:2068) at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:242) at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeWithoutLock(JobStoreSupport.java:3673) at org.quartz.impl.jdbcjobstore.JobStoreSupport.getCalendarNames(JobStoreSupport.java:2065) at org.quartz.core.QuartzScheduler.getCalendarNames(QuartzScheduler.java:1509) at org.quartz.impl.StdScheduler.getCalendarNames(StdScheduler.java:608) at org.quartz.core.jmx.JobExecutionContextSupport.determineCalendarName(JobExecutionContextSupport.java:87) at org.quartz.core.jmx.JobExecutionContextSupport.toCompositeData(JobExecutionContextSupport.java:66) at org.quartz.core.QuartzSchedulerMBeanImpl.jobToBeExecuted(QuartzSchedulerMBeanImpl.java:431) at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1930) ... 3 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:71) ... 16 more Caused by: java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/XADataSource in state ACCESSIBLE with usage count 1 wrapping oracle.jdbc.driver.T4CXAConnection@4bcee4c7 on oracle.jdbc.driver.LogicalConnection@7c0debb2 at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:86) at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:243) at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63) at $Proxy58.prepareStatement(Unknown Source) ... 20 more Caused by: bitronix.tm.internal.BitronixSystemException: resource 'jdbc/XADataSource' cannot be used outside XA transaction scope. Set allowLocalTransactions to true if you want to allow this and you know your resource supports this. at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:79) at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:84) ... 26 more
        Hide
        Gerald Quintana added a comment -

        Quartz has an XA and a non-XA datasource access to the same database. Either the wrong datasource (XA instead of non-XA) is used or a transaction should be opened before getting calendar names in the JMX job listener

        Show
        Gerald Quintana added a comment - Quartz has an XA and a non-XA datasource access to the same database. Either the wrong datasource (XA instead of non-XA) is used or a transaction should be opened before getting calendar names in the JMX job listener
        Hide
        James House added a comment -

        Looks like Gary's re-work of the JMX layer (some time ago now) didn't account for the fact that calls to the scheduler must be within a jta tx if the scheduler is configured to participate in them.

        Show
        James House added a comment - Looks like Gary's re-work of the JMX layer (some time ago now) didn't account for the fact that calls to the scheduler must be within a jta tx if the scheduler is configured to participate in them.

          People

          • Assignee:
            Chris Dennis
            Reporter:
            Gerald Quintana
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: