[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Can a Job Fire now ?  XML
Forum Index -> Quartz
Author Message
sita_ram

neo

Joined: 01/10/2010 22:44:38
Messages: 2
Offline

Hi,

I have a quartz job which I configured using jobs.xml file to execute every 3 minutes.Apart from this I want to execute to same job in a particular situation to fire immediately after a set of transcation. I am using jboss-3.2.7 app server to deploy my EAR file and put quartz-1.6.6 jar in its lib folder.

The above mentioned job is executing every 3 minute successfully. But to fire now i created a Simple Trigger and scheduled that job from my EJB method.It throws an exception "Caused by: java.sql.SQLException: You cannot rollback during a managed transaction! "

5:12:41,744 INFO [STDOUT] java.lang.reflect.UndeclaredThrowableException
05:12:41,744 INFO [STDOUT] at $Proxy365.rollback(Unknown Source)
05:12:41,744 INFO [STDOUT] at org.quartz.impl.jdbcjobstore.JobStoreSupport.rollbackConnection(JobStoreSupport.java:3588)
05:12:41,744 INFO [STDOUT] at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3754)
05:12:41,744 INFO [STDOUT] at org.quartz.impl.jdbcjobstore.JobStoreTX.executeInLock(JobStoreTX.java:93)
05:12:41,744 INFO [STDOUT] at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInLock(JobStoreSupport.java:3671)
05:12:41,853 INFO [STDOUT] at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJobAndTrigger(JobStoreSupport.java:1035)
05:12:41,853 INFO [STDOUT] at org.quartz.core.QuartzScheduler.scheduleJob(QuartzScheduler.java:732)
05:12:41,853 INFO [STDOUT] at org.quartz.impl.StdScheduler.scheduleJob(StdScheduler.java:265)
05:12:41,853 INFO [STDOUT] at com.mypack.MyHelper.scheduleJobTrigger(MyHelper.java:106)
05:12:41,853 INFO [STDOUT] at com.mypack.myServices.sendMessage(myServices.java:37)
05:12:41,853 INFO [STDOUT] at org.mypack.MsgHelper.sendNewMsg(MsgHelper.java:1105)
05:12:41,853 INFO [STDOUT] at org.mypack.MsgFacadeEJB.sendNewMsg(MsgFacadeEJB.java:249)
05:12:41,853 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
05:12:41,853 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
05:12:41,916 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
05:12:41,916 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:597)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:683)
05:12:41,916 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:317)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:150)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
05:12:41,916 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:709)
05:12:41,916 INFO [STDOUT] at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)
05:12:41,916 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
05:12:41,916 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:597)
05:12:41,916 INFO [STDOUT] at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
05:12:41,916 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
05:12:41,916 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
05:12:41,916 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
05:12:41,916 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:198)
05:12:41,916 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
05:12:41,916 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:97)
05:12:41,916 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:115)
05:12:41,916 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:101)
05:12:41,916 INFO [STDOUT] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
05:12:41,916 INFO [STDOUT] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
05:12:41,916 INFO [STDOUT] at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
05:12:41,916 INFO [STDOUT] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
05:12:41,916 INFO [STDOUT] at $Proxy343.sendNewMsg(Unknown Source)
05:12:41,916 INFO [STDOUT] at org.mypack.controller.MyBrowserController.sendMsg(MyBrowserController.java:390)
05:12:41,916 INFO [STDOUT] at org.mypack.controller.MyBrowserController.doPageRequested(MyBrowserController.java:125)
05:12:41,916 INFO [STDOUT] at com.salmonllc.html.HtmlPage.notifyListeners(HtmlPage.java:1173)
05:12:41,916 INFO [STDOUT] at com.salmonllc.jsp.JspController.notifyListeners(JspController.java:1173)
05:12:41,916 INFO [STDOUT] at com.salmonllc.jsp.JspController.doGet(JspController.java:632)
05:12:41,916 INFO [STDOUT] at com.salmonllc.jsp.tags.PageTag.doStartTag(PageTag.java:225)
05:12:41,916 INFO [STDOUT] at org.apache.jsp.Jsp.MyBrowser_jsp._jspx_meth_jade_page_0(MyBrowser_jsp.java:561)
05:12:41,916 INFO [STDOUT] at org.apache.jsp.Jsp.MyBrowser_jsp._jspService(MyBrowser_jsp.java:112)
05:12:41,916 INFO [STDOUT] at com.salmonllc.jsp.JspServlet.service(JspServlet.java:328)
05:12:41,916 INFO [STDOUT] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
05:12:41,916 INFO [STDOUT] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
05:12:41,916 INFO [STDOUT] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
05:12:41,916 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
05:12:41,916 INFO [STDOUT] at clime.messadmin.filter.MessAdminFilter.doFilter(MessAdminFilter.java:104)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
05:12:41,916 INFO [STDOUT] at clime.messadmin.filter.MessAdminFilter.doFilter(MessAdminFilter.java:104)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
05:12:41,916 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
05:12:41,916 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
05:12:41,931 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
05:12:41,931 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:162)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
05:12:41,931 INFO [STDOUT] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
05:12:41,931 INFO [STDOUT] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
05:12:41,931 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
05:12:41,931 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
05:12:41,931 INFO [STDOUT] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
05:12:41,931 INFO [STDOUT] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
05:12:41,931 INFO [STDOUT] at java.lang.Thread.run(Thread.java:619)
05:12:41,947 INFO [STDOUT] Caused by: java.lang.reflect.InvocationTargetException
05:12:41,947 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
05:12:41,947 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
05:12:41,947 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
05:12:41,947 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:597)
05:12:41,947 INFO [STDOUT] at org.quartz.impl.jdbcjobstore.AttributeRestoringConnectionInvocationHandler.invoke(AttributeRestoringConnectionInvocationHandler.java:71)
05:12:41,947 INFO [STDOUT] ... 103 more
05:12:41,947 INFO [STDOUT] Caused by: java.sql.SQLException: You cannot rollback during a managed transaction!
05:12:41,947 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:537)
05:12:41,947 INFO [STDOUT] at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:483)
05:12:41,947 INFO [STDOUT] ... 108 more
05:15:30,963 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl [FormatId=257, GlobalId=ip-0AF247E2//1860, BranchQual=] timed out. status=STATUS_ACTIVE

My quartz.properties as given below

org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.dataSource = myDS
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.dataSource.myDS.jndiURL = java:/QuartzDS
org.quartz.dataSource.myDS.maxConnections = 5
jhouse

seraphim
[Avatar]
Joined: 11/06/2009 15:29:56
Messages: 1703
Offline


If you're invoking the scheduler from within an EJB you should probably be using JobStoreCMT instead of JobStoreTX.


 
Forum Index -> Quartz
Go to:   
Powered by JForum 2.1.7 © JForum Team