0 Replies Latest reply on Dec 15, 2008 11:40 AM by Gregory Nikle

    Seam Quartz error!

    Gregory Nikle Apprentice

      I try to use seam 2.1 with quartz opensymphony, and follow step by step I added to:
      components.xml



             <async:quartz-dispatcher/>



      createt controler and procesor, same like quartz example.


      I want to start jobs after jboss starting, so I added quartz tables for postgres from opensymphony quartz zip file, and also changed quartz.properties file to:



      #============================================================================
      # Configure Main Scheduler Properties  
      #============================================================================
      org.quartz.scheduler.instanceName = DefaultQuartzScheduler
      org.quartz.scheduler.rmi.export = false
      org.quartz.scheduler.rmi.proxy = false
      org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
      org.quartz.scheduler.useClassLoaderOfInitializer = true
      #============================================================================
      # Configure ThreadPool  
      #============================================================================
      org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
      org.quartz.threadPool.threadCount = 10
      org.quartz.threadPool.threadPriority = 5
      org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
      org.quartz.jobStore.misfireThreshold = 10000
      #============================================================================
      # Configure JobStore  
      #============================================================================
      org.quartz.jobStore.misfireThreshold 60000
      #org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore
      org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
      org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
      #org.quartz.jobStore.driverDelegateClass =  org.quartz.impl.jdbcjobstore.StdJDBCDelegate
      #org.quartz.jobStore.dataSource = myDS
      org.quartz.jobStore.dataSource = quartzDS
      org.quartz.jobStore.tablePrefix = QRTZ_
      #============================================================================
      # Configure Datasources  
      #============================================================================
      org.quartz.dataSource.quartzDS.jndiURL = java:/SGUniOneDatasource



      so far so good.


      When I deploy my app and hit link to execute job, job i started, BUT not saved to db quartz tables. So i added quartz.jar to my ear file in lib directory when also is drools.jar etc.


      redeployed my app, AND when I hit again to execute job this stacktrace is thrown:



      11:39:49,156 ERROR [STDERR] java.lang.reflect.UndeclaredThrowableException
      11:39:49,156 ERROR [STDERR]      at $Proxy200.rollback(Unknown Source)
      11:39:49,156 ERROR [STDERR]      at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:3503)
      11:39:49,156 ERROR [STDERR]      at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3669)
      11:39:49,156 ERROR [STDERR]      at org.quartz.impl.jdbcjobstore.JobStoreTX.executeInLock(JobStoreTX.java:93)
      11:39:49,156 ERROR [STDERR]      at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInLock(JobStoreSupport.java:3586)
      11:39:49,156 ERROR [STDERR]      at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobAndTrigger(JobStoreSupport.java:971)
      11:39:49,156 ERROR [STDERR]      at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:703)
      11:39:49,156 ERROR [STDERR]      at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:255)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.async.QuartzDispatcher.scheduleWithQuartzService(QuartzDispatcher.java:233)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.async.QuartzDispatcher.scheduleInvocation(QuartzDispatcher.java:124)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.async.QuartzDispatcher.scheduleInvocation(QuartzDispatcher.java:44)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:38)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
      11:39:49,156 ERROR [STDERR]      at pl.sguni.scheduler.TasksProcessor_$$_javassist_3.scheduleTasks(TasksProcessor_$$_javassist_3.java)
      11:39:49,156 ERROR [STDERR]      at pl.sguni.scheduler.EngineControler.calcTasks(EngineControler.java:44)
      11:39:49,156 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:39:49,156 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      11:39:49,156 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      11:39:49,156 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:155)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:91)
      11:39:49,156 ERROR [STDERR]      at pl.sguni.scheduler.EngineControler_$$_javassist_2.calcTasks(EngineControler_$$_javassist_2.java)
      11:39:49,156 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:39:49,156 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      11:39:49,156 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      11:39:49,156 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
      11:39:49,156 ERROR [STDERR]      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
      11:39:49,156 ERROR [STDERR]      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
      11:39:49,156 ERROR [STDERR]      at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
      11:39:49,156 ERROR [STDERR]      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
      11:39:49,156 ERROR [STDERR]      at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:174)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.navigation.Pages.callAction(Pages.java:634)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.navigation.Pages.preRender(Pages.java:289)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:544)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:455)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:146)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:116)
      11:39:49,156 ERROR [STDERR]      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
      11:39:49,156 ERROR [STDERR]      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      11:39:49,156 ERROR [STDERR]      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      11:39:49,156 ERROR [STDERR]      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
      11:39:49,156 ERROR [STDERR]      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      11:39:49,156 ERROR [STDERR]      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      11:39:49,156 ERROR [STDERR]      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      11:39:49,156 ERROR [STDERR]      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      11:39:49,156 ERROR [STDERR]      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      11:39:49,156 ERROR [STDERR]      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      11:39:49,156 ERROR [STDERR]      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
      11:39:49,156 ERROR [STDERR]      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      11:39:49,156 ERROR [STDERR]      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
      11:39:49,156 ERROR [STDERR]      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      11:39:49,156 ERROR [STDERR]      at java.lang.Thread.run(Thread.java:595)
      11:39:49,156 ERROR [STDERR] Caused by: java.lang.reflect.InvocationTargetException
      11:39:49,156 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      11:39:49,156 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      11:39:49,156 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      11:39:49,156 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:585)
      11:39:49,156 ERROR [STDERR]      at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:71)
      11:39:49,156 ERROR [STDERR]      ... 89 more
      11:39:49,156 ERROR [STDERR] Caused by: java.sql.SQLException: You cannot rollback during a managed transaction!
      11:39:49,156 ERROR [STDERR]      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:577)
      11:39:49,156 ERROR [STDERR]      at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:340)
      11:39:49,156 ERROR [STDERR]      ... 94 more



      after about 1 minute, job is started and working fine, after redeploy job also is started, and job is saved to DB quartz tables, BUT this stack trace is very very strange!
      can anybody explain me what's wrong?