0 Replies Latest reply on Apr 27, 2011 2:20 AM by praveen sule

    org.hibernate.exception.GenericJDBCException: could not execute query

    praveen sule Newbie

      Hi ,


          I have a problem while executing a quartz,
      I am using seam 2.1 and quartz default configuration.


      while quartz triggers for the first time I am getting an error


      javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query


      and when the quartz triggers 2nd time it works fine


      how can i solve this problem. thanks in advance



      11:31:36,468 INFO  [STDOUT] ******   QUARTZ FUNCTIONALITY  STARTED ********** 
      11:31:36,484 INFO  [STDOUT] *****this is my quartz praveen********
      11:31:36,515 INFO  [Initialization] done initializing Seam
      11:31:36,515 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.loggingFilter
      11:31:36,515 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.ajax4jsfFilter
      11:31:36,640 INFO  [CacheManager] Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
      11:31:36,640 INFO  [LRUMapCacheFactory] Creating LRUMap cache instance using parameters: {facelets.DEVELOPMENT=false, javax.faces.CONFIG_FILES=/WEB-INF/navigation.xml,/WEB-INF/faces-config.xml, org.richfaces.SKIN=classic, com.sun.faces.injectionProvider=org.jboss.web.jsf.integration.injection.JBossInjectionProvider, webAppRootKey=seam-excel, facelets.REFRESH_PERIOD=-1, javax.faces.DEFAULT_SUFFIX=.jsp}
      11:31:36,640 INFO  [LRUMapCacheFactory] Creating LRUMap cache instance of default capacity
      11:31:36,671 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
      11:31:36,671 ERROR [JDBCExceptionReporter] Connection handle has been closed and is unusable
      11:31:36,671 INFO  [CacheManager] Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
      11:31:36,671 INFO  [LRUMapCacheFactory] Creating LRUMap cache instance using parameters: {facelets.DEVELOPMENT=false, javax.faces.CONFIG_FILES=/WEB-INF/navigation.xml,/WEB-INF/faces-config.xml, org.richfaces.SKIN=classic, com.sun.faces.injectionProvider=org.jboss.web.jsf.integration.injection.JBossInjectionProvider, webAppRootKey=seam-excel, facelets.REFRESH_PERIOD=-1, javax.faces.DEFAULT_SUFFIX=.jsp}
      11:31:36,671 INFO  [LRUMapCacheFactory] Creating LRUMap cache instance of default capacity
      11:31:36,671 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.contextFilter
      11:31:36,671 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.redirectFilter
      11:31:36,671 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.exceptionFilter
      11:31:36,671 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.multipartFilter
      11:31:36,671 INFO  [SeamFilter] Initializing filter: org.jboss.seam.web.identityFilter
      11:31:36,703 ERROR [AsynchronousExceptionHandler] Exeception thrown whilst executing asynchronous call
      javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
           at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
           at com.sec.ezeeDesk.QuartzUtils.processPosSales(QuartzUtils.java:74)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:95)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:89)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at com.sec.ezeeDesk.QuartzUtils_$$_javassist_1.processPosSales(QuartzUtils_$$_javassist_1.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:62)
           at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
           at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
           at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
           at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
           at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
           at org.hibernate.loader.Loader.doList(Loader.java:2231)
           at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
           at org.hibernate.loader.Loader.list(Loader.java:2120)
           at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
           at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
           at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
           ... 38 more
      Caused by: java.sql.SQLException: Connection handle has been closed and is unusable
           at org.jboss.resource.adapter.jdbc.WrappedConnection.checkStatus(WrappedConnection.java:845)
           at org.jboss.resource.adapter.jdbc.WrappedConnection.checkTransaction(WrappedConnection.java:825)
           at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:240)
           at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
           at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
           at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
           at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
           at org.hibernate.loader.Loader.doQuery(Loader.java:696)
           at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
           at org.hibernate.loader.Loader.doList(Loader.java:2228)
           ... 46 more
      11:31:36,718 ERROR [AsynchronousExceptionHandler] Exeception thrown whilst executing asynchronous call
      javax.persistence.PersistenceException: org.hibernate.SessionException: Session is closed!
           at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
           at com.sec.ezeeDesk.QuartzUtils.retriveBirthdayMessage(QuartzUtils.java:298)
           at com.sec.ezeeDesk.QuartzUtils.crmBirthdayMsgAlert(QuartzUtils.java:226)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:95)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:89)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at com.sec.ezeeDesk.QuartzUtils_$$_javassist_1.crmBirthdayMsgAlert(QuartzUtils_$$_javassist_1.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:62)
           at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
           at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      Caused by: org.hibernate.SessionException: Session is closed!
           at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:72)
           at org.hibernate.impl.SessionImpl.getPersistenceContext(SessionImpl.java:1850)
           at org.hibernate.type.CollectionType.getKeyOfOwner(CollectionType.java:348)
           at org.hibernate.type.CollectionType.resolve(CollectionType.java:424)
           at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:139)
           at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)
           at org.hibernate.loader.Loader.doQuery(Loader.java:752)
           at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
           at org.hibernate.loader.Loader.doList(Loader.java:2228)
           at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
           at org.hibernate.loader.Loader.list(Loader.java:2120)
           at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
           at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
           at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
           ... 39 more
      11:31:36,718 INFO  [EARDeployer] Started J2EE application: file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/
      11:31:36,781 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-localhost%2F127.0.0.1-8080
      11:31:36,781 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-localhost%2F127.0.0.1-8009
      11:31:36,796 INFO  [Server] JBoss (MX MicroKernel) [4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)] Started in 1m:3s:187ms
      11:33:36,500 INFO  [STDOUT] size--->>>3
      11:33:36,500 INFO  [STDOUT] crmMessage namedfdfd
      11:33:36,531 INFO  [STDOUT] contemtList size0
      11:33:36,546 INFO  [STDOUT] historyList size0
      11:33:36,546 INFO  [STDOUT] crmMessage namesdfdsf
      11:33:36,546 INFO  [STDOUT] contemtList size4
      11:33:36,546 INFO  [STDOUT] historyList size0
      11:33:36,546 INFO  [STDOUT] in content
      11:33:36,562 INFO  [STDOUT] today my birthday
      11:33:36,562 INFO  [STDOUT] in content
      11:33:36,562 INFO  [STDOUT] today my birthday
      11:33:36,562 INFO  [STDOUT] content added
      11:33:36,562 INFO  [STDOUT] in content
      11:33:36,562 INFO  [STDOUT] today my birthday
      11:33:36,562 INFO  [STDOUT] content added
      11:33:36,562 INFO  [STDOUT] in content
      11:33:36,562 INFO  [STDOUT] sel size--->>2
      11:33:36,562 INFO  [STDOUT] in mail method
      11:33:36,750 INFO  [STDOUT] at last
      11:33:36,750 INFO  [STDOUT] birth day msg called
      11:33:36,750 INFO  [STDOUT] crmMessage namesdfsdf
      11:33:36,781 INFO  [STDOUT] contemtList size4
      11:33:36,812 INFO  [STDOUT] historyList size0
      11:33:36,812 INFO  [STDOUT] in content
      11:33:36,812 INFO  [STDOUT] today my birthday
      11:33:36,812 INFO  [STDOUT] in content
      11:33:36,812 INFO  [STDOUT] today my birthday
      11:33:36,812 INFO  [STDOUT] content added
      11:33:36,812 INFO  [STDOUT] in content
      11:33:36,812 INFO  [STDOUT] today my birthday
      11:33:36,812 INFO  [STDOUT] content added
      11:33:36,812 INFO  [STDOUT] in content
      11:33:36,812 INFO  [STDOUT] sel size--->>2
      11:33:36,812 INFO  [STDOUT] in mail method
      11:33:36,875 INFO  [STDOUT] at last
      11:33:36,875 INFO  [STDOUT] birth day msg called
      11:33:37,171 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/lib/primefaces-1.0.0.jar!/META-INF/primefaces-i.taglib.xml
      11:33:37,171 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/primefaces-1.0.0.jar!/META-INF/primefaces-i.taglib.xml
      11:33:37,187 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/lib/primefaces-1.0.0.jar!/META-INF/primefaces-p.taglib.xml
      11:33:37,203 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/primefaces-1.0.0.jar!/META-INF/primefaces-p.taglib.xml
      11:33:37,203 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jboss-seam-excel.jar!/META-INF/seam-excel.taglib.xml
      11:33:37,203 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jboss-seam-mail.jar!/META-INF/seam-mail.taglib.xml
      11:33:37,203 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jboss-seam-pdf.jar!/META-INF/seam-pdf.taglib.xml
      11:33:37,203 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jboss-seam-rss.jar!/META-INF/seam-rss.taglib.xml
      11:33:37,218 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/s.taglib.xml
      11:33:37,234 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
      11:33:37,234 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
      11:33:37,250 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
      11:33:37,265 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
      11:33:37,265 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
      11:33:37,281 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/a4j.taglib.xml
      11:33:37,281 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/jsp.taglib.xml
      11:33:37,281 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/ajax4jsf.taglib.xml
      11:33:37,343 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/rich.taglib.xml
      11:33:37,343 INFO  [compiler] Added Library from: jar:file:/C:/office/server/jboss-4.2.3.GA/server/default/deploy/ezeeDesk.ear/ezeeDesk.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/richfaces.taglib.xml
      11:33:37,593 INFO  [MailSession] Creating JavaMail Session (smtp.gmail.com:587)
      11:33:37,593 INFO  [MailSession] Creating JavaMail Session (smtp.gmail.com:587)
      11:33:37,609 INFO  [MailSession] connected to mail server
      11:33:37,609 INFO  [MailSession] connected to mail server
      11:35:36,500 INFO  [STDOUT] size--->>>3
      11:35:36,500 INFO  [STDOUT] crmMessage namedfdfd
      11:35:36,500 INFO  [STDOUT] contemtList size0
      11:35:36,515 INFO  [STDOUT] historyList size0
      11:35:36,515 INFO  [STDOUT] crmMessage namesdfdsf
      11:35:36,515 INFO  [STDOUT] contemtList size4
      11:35:36,515 INFO  [STDOUT] historyList size2
      11:35:36,515 INFO  [STDOUT] in content
      11:35:36,515 INFO  [STDOUT] today my birthday
      11:35:36,515 INFO  [STDOUT] in content
      11:35:36,515 INFO  [STDOUT] today my birthday
      11:35:36,515 INFO  [STDOUT] already sent
      11:35:36,515 INFO  [STDOUT] in content
      11:35:36,515 INFO  [STDOUT] today my birthday
      11:35:36,515 INFO  [STDOUT] already sent
      11:35:36,515 INFO  [STDOUT] in content
      11:35:36,531 INFO  [STDOUT] crmMessage namesdfsdf
      11:35:36,531 INFO  [STDOUT] contemtList size4
      11:35:36,546 INFO  [STDOUT] historyList size2
      11:35:36,546 INFO  [STDOUT] in content
      11:35:36,546 INFO  [STDOUT] today my birthday
      11:35:36,546 INFO  [STDOUT] in content
      11:35:36,546 INFO  [STDOUT] today my birthday
      11:35:36,546 INFO  [STDOUT] already sent
      11:35:36,546 INFO  [STDOUT] in content
      11:35:36,546 INFO  [STDOUT] today my birthday
      11:35:36,546 INFO  [STDOUT] already sent
      11:35:36,546 INFO  [STDOUT] in content
      11:37:36,515 INFO  [ConnectionManager] forcing batcher resource cleanup on transaction completion; forgot to close ScrollableResults/Iterator?
      11:37:36,515 INFO  [TimestampType] could not read column value from result set: created4_534_; The result set is closed.
      11:37:36,515 WARN  [JDBCExceptionReporter] SQL Error: 0, SQLState: null
      11:37:36,515 ERROR [JDBCExceptionReporter] The result set is closed.
      11:37:36,531 ERROR [AsynchronousExceptionHandler] Exeception thrown whilst executing asynchronous call
      javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query
           at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
           at com.sec.ezeeDesk.QuartzUtils.retriveBirthdayMessage(QuartzUtils.java:298)
           at com.sec.ezeeDesk.QuartzUtils.crmBirthdayMsgAlert(QuartzUtils.java:226)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:95)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:89)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:52)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at com.sec.ezeeDesk.QuartzUtils_$$_javassist_1.crmBirthdayMsgAlert(QuartzUtils_$$_javassist_1.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
           at java.lang.reflect.Method.invoke(Unknown Source)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.async.AsynchronousInvocation$1.process(AsynchronousInvocation.java:62)
           at org.jboss.seam.async.Asynchronous$ContextualAsynchronousRequest.run(Asynchronous.java:80)
           at org.jboss.seam.async.AsynchronousInvocation.execute(AsynchronousInvocation.java:44)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:243)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
           at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
           at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
           at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
           at org.hibernate.loader.Loader.doList(Loader.java:2231)
           at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
           at org.hibernate.loader.Loader.list(Loader.java:2120)
           at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
           at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
           at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
           at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
           at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
           at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
           ... 39 more
      Caused by: java.sql.SQLException: The result set is closed.
           at org.jboss.resource.adapter.jdbc.WrappedResultSet.checkState(WrappedResultSet.java:1959)
           at org.jboss.resource.adapter.jdbc.WrappedResultSet.wasNull(WrappedResultSet.java:1929)
           at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:185)
           at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173)
           at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
           at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2124)
           at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
           at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
           at org.hibernate.loader.Loader.getRow(Loader.java:1230)
           at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
           at org.hibernate.loader.Loader.doQuery(Loader.java:724)
           at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
           at org.hibernate.loader.Loader.doList(Loader.java:2228)
           ... 47 more
      




           @SuppressWarnings("unchecked")
           @Asynchronous
           @Transactional
           @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
           public QuartzTriggerHandle crmBirthdayMsgAlert(@Expiration Date when, @IntervalDuration Long interval, @FinalExpiration Date endDate) {
                QuartzTriggerHandle handle = new QuartzTriggerHandle("AFSTrigger");
                List<CrmCustomerListContent> contentList;
                List<CrmCustomerListContent> selectedContent;
                List<CrmMessage> crmMessageList = retriveBirthdayMessage();
                System.out.println("size--->>>" + crmMessageList.size());
                for (CrmMessage crmMessage : crmMessageList) {
                     System.out.println("crmMessage name" + crmMessage.getMessageTopic());
                     selectedContent = new ArrayList<CrmCustomerListContent>();
                     contentList = em.createQuery(" select distinct content from CrmMessage cm left join cm.customerList customerList  left join customerList.customerListContent content where cm.id=:messageId and content.reservationPassenger.birthdayDate is not null and content.reservationPassenger.birthdayMonth is not null")
                                         .setParameter("messageId", crmMessage.getId())
                                         .getResultList();
                     System.out.println("contemtList size" + contentList.size());
                     List<CrmMessageSentHistory> historyList = em.createQuery(" select distinct cmsh from CrmMessageSentHistory cmsh where cmsh.messageId=:messageId")
                                                                            .setParameter("messageId", crmMessage)
                                                                            .getResultList();
                     System.out.println("historyList size" + historyList.size());
                     if (contentList.size() > 0) {
                          /*
                           * Iterator<CrmCustomerListContent> iter =
                           * contentList.iterator(); while (iter.hasNext()) {
                           * CrmCustomerListContent content = iter.next();
                           */
                          for (CrmCustomerListContent content : contentList) {
                               System.out.println("in content");
                               if (content.getBirthday()) {
                                    System.out.println("today my birthday");
                                    if (historyList.size() > 0) {
                                         boolean result = true;
                                         for (CrmMessageSentHistory his : historyList) {
                                              if (his.getContentId().equals(content)) {
                                                   Date today = new Date();
                                                   today.setHours(0);
                                                   today.setMinutes(0);
                                                   today.setSeconds(0);
                                                   Date sent = his.getSentOn();
                                                   sent.setHours(0);
                                                   sent.setMinutes(0);
                                                   sent.setSeconds(0);
                                                   if (sent.toGMTString().equals(today.toGMTString())) {
                                                        System.out.println("already sent");
                                                        result = false;
                                                   }
                                              }
                                         }
                                         if (result) {                         
                                                   if(content.getReservationPassenger().getEmail() !=null && content.getReservationPassenger().getEmail().trim().length()>0){
                                                        System.out.println("content added");
                                                        selectedContent.add(content);
                                                   }                                                                                     
                                         }
                                    } else {
                                         if(content.getReservationPassenger().getEmail() !=null && content.getReservationPassenger().getEmail().trim().length()>0){
                                              System.out.println("content added");
                                              selectedContent.add(content);
                                         }     }
                               }
                          }
                     }
                     if (selectedContent.size() > 0) {
                          System.out.println("sel size--->>" + selectedContent.size());
                          /* sendmessage(crmMessage, selectedContent); */
                          sendBirthdayAnniversaryMail(crmMessage, selectedContent);
                          System.out.println("birth day msg called");
                     }
                }
                return handle;
           }
      
           public List<CrmMessage> retriveBirthdayMessage() {
                return em.createQuery("  from CrmMessage cm where 1=1 ")
                          .getResultList();
           }






      quartz triggers for every  2 min