1 Reply Latest reply on Apr 13, 2009 6:22 PM by Arbi Sookazian

    EntityManager null in Quartz job

    Fernando Hernandez Newbie

      Hello,
      I am trying to scheduling a job to perfom some operations inside my db.
      When I try to inject the Entity Manager to my component I receive the following error:


      12:10:23,167 INFO  [OperacionHome] Scheduling: EquiposInternetworking
      12:10:23,260 ERROR [JobRunShell] Job DEFAULT.38813741:1209ef3875c:-7f63 threw an unhandled Exception: 
      org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      12:10:23,276 ERROR [ErrorLogger] Job (DEFAULT.38813741:1209ef3875c:-7f63 threw an exception.
      org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em]
           at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           ... 1 more
      12:12:23,180 ERROR [JobRunShell] Job DEFAULT.38813741:1209ef3875c:-7f63 threw an unhandled Exception: 
      org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      12:12:23,180 ERROR [ErrorLogger] Job (DEFAULT.38813741:1209ef3875c:-7f63 threw an exception.
      org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em]
           at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           ... 1 more
      12:14:23,200 ERROR [JobRunShell] Job DEFAULT.38813741:1209ef3875c:-7f63 threw an unhandled Exception: 
      org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      12:14:23,200 ERROR [ErrorLogger] Job (DEFAULT.38813741:1209ef3875c:-7f63 threw an exception.
      org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em]
           at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           ... 1 more
      12:16:23,178 ERROR [JobRunShell] Job DEFAULT.38813741:1209ef3875c:-7f63 threw an unhandled Exception: 
      org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      12:16:23,178 ERROR [ErrorLogger] Job (DEFAULT.38813741:1209ef3875c:-7f63 threw an exception.
      org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em]
           at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           ... 1 more
      12:18:23,187 ERROR [JobRunShell] Job DEFAULT.38813741:1209ef3875c:-7f63 threw an unhandled Exception: 
      org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      12:18:23,187 ERROR [ErrorLogger] Job (DEFAULT.38813741:1209ef3875c:-7f63 threw an exception.
      org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em]
           at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
           at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)
      Caused by: org.jboss.seam.RequiredException: @In attribute requires non-null value: processor.em
           at org.jboss.seam.Component.getValueToInject(Component.java:2168)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:79)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.async.AsynchronousInterceptor.aroundInvoke(AsynchronousInterceptor.java:50)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:106)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.teldat.Teldages.ScheduleProcessor_$$_javassist_13.createQuartzAddTimer(ScheduleProcessor_$$_javassist_13.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.async.AsynchronousInvocation.call(AsynchronousInvocation.java:52)
           at org.jboss.seam.async.Asynchronous.executeInContexts(Asynchronous.java:76)
           at org.jboss.seam.async.Asynchronous.execute(Asynchronous.java:45)
           at org.jboss.seam.async.QuartzDispatcher$QuartzJob.execute(QuartzDispatcher.java:240)
           at org.quartz.core.JobRunShell.run(JobRunShell.java:202)



      Here the classes:
      ScheduleProcessor.java


      package com.teldat.Teldages;
      import java.text.SimpleDateFormat;
      
      import java.util.ArrayList;
      import java.util.Calendar;
      import java.util.Date;
      import java.util.List;
      import java.util.StringTokenizer;
      
      import javax.persistence.EntityManager;
      import javax.persistence.EntityManagerFactory;
      import javax.persistence.Persistence;
      import javax.persistence.PersistenceContext;
      import javax.persistence.PersistenceContextType;
      
      
      import org.jboss.seam.Component;
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.AutoCreate;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.Startup;
      import org.jboss.seam.annotations.TransactionPropagationType;
      import org.jboss.seam.annotations.Transactional;
      import org.jboss.seam.annotations.async.Asynchronous;
      import org.jboss.seam.annotations.async.Expiration;
      import org.jboss.seam.annotations.async.FinalExpiration;
      import org.jboss.seam.annotations.async.IntervalCron;
      import org.jboss.seam.annotations.async.IntervalDuration;
      import org.jboss.seam.async.QuartzTriggerHandle;
      import org.jboss.seam.faces.FacesMessages;
      import org.jboss.seam.log.Log;
      
      
      @Name("processor")
      @AutoCreate
      public class ScheduleProcessor { 
          
           @In
           EntityManager em;
                
           @In("#{messages['operationFailedNoGroup']}") private static String noGroupMessage;
      
           @In("#{messages['operationFailedNoMacro']}") private static String noMacroMessage;
      
           @In("#{messages['operationFailedNoQuery']}") private static String noQueryMessage;
      
           @In("#{messages['operationFailedNoScriptList']}") private static String noScriptListMessage;
      
           @In("#{messages['operationFailedBasicScriptFailed1']}") private static String basicScriptFailedMessage1;
      
           @In("#{messages['operationFailedBasicScriptFailed2']}") private static String basicScriptFailedMessage2;
      
           @In("#{messages['operationExecutionResult']}") private static String executionResultMessage;
      
           @In("#{messages['operationResultOk']}") private static String resultOk;
      
           @In("#{messages['operationResultWrong']}") private static String resultWrong;
           
           @Logger
           private Log log;
           
           
          @Asynchronous
          @Transactional
          public QuartzTriggerHandle createQuartzAddTimer(@Expiration Date when, @IntervalDuration Long interval,@FinalExpiration Date endDate,Operacion operacion, String operation_name){
               //logadd.info("Working hard");
               //em = ex_op.em;
                runOperation(operation_name);
               return null;
          }
          
          @Asynchronous 
          @Transactional
          public QuartzTriggerHandle createQuartzRoleTimer(@Expiration Date when, @IntervalCron String interval, String operation_name){
                String date = new Date().toString();
                try{
                     log.info(date + ": Executing " + operation_name);
      
                     runOperation(operation_name);
                } catch (Exception e){
                     log.error(date + ": Error processing role log file.");
                     e.printStackTrace();
                }
               return null;
          }


       
      OperationHome.java


      package com.teldat.Teldages;
      
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.faces.FacesMessages;
      import org.jboss.seam.framework.EntityHome;
      import org.jboss.seam.log.Log;
      
      import java.util.Calendar;
      import java.util.Date;
      import java.util.List;
      import java.util.ArrayList;
      import javax.faces.application.FacesMessage;
      import javax.faces.component.UIComponent;
      import javax.faces.context.FacesContext;
      import javax.faces.validator.ValidatorException;
      import org.jboss.seam.annotations.Logger;
      import org.jboss.seam.async.QuartzTriggerHandle;
      
      @Name("operacionHome")
      public class OperacionHome extends EntityHome<Operacion> {
      
           
           @In(create = true)
           UsuariosHome usuariosHome;
      
           @In(create = true)
           GrupoList grupoList;
      
           @In(create = true)
           MacroList macroList;
      
           // Usuario autenticado
           @In 
           Usuarios user;
           
           // Planificador de tareas
           @In
          ScheduleProcessor processor;
      
      
           @In("#{messages['createdOperation']}") private static String createdMessage;
      
           @In("#{messages['updatedOperation']}") private static String updatedMessage;
      
           @In("#{messages['deletedOperation']}") private static String deletedMessage;
      
           @In("#{messages['operationNameValidDetail']}") private static String validatorDetailMessage;
      
           @In("#{messages['operationNameValidSummary']}") private static String validatorSummaryMessage;
           
           @Logger Log log;
      
           private static final long serialVersionUID = 1L;
      
           private List<String> selectedWeekDays;
      
           private List<String> selectedDay1Items;
           private List<String> selectedDay2Items;
           private List<String> selectedDay3Items;
      
           private List<String> selectedMonthItems;
      
           private boolean stop;
      
           List<String> groupNameList = new ArrayList<String>(); 
           List<String> macroNameList = new ArrayList<String>();
      
           public void setOperacionName(String id) {
                setId(id);
           }
      
           public String getOperacionName() {
                return (String) getId();
           }
      .....
      public void saveAndScheduleCron(String operation_name)
          {
                Calendar cal = Calendar.getInstance ();
              cal.set (2010, Calendar.MAY, 10);
              log.info("Scheduling: " + operation_name);
              
              Operacion operacion = getInstance();
      
              //QuartzTriggerHandle handle = processor.createQuartzRoleTimer(new Date(), "0 50 11 * * ?", operation_name);
              QuartzTriggerHandle handle = processor.createQuartzAddTimer(new Date(), 2*60*1000L, cal.getTime(),operacion, operation_name);
          }



      Could you help me?
      Thanks

        • 1. Re: EntityManager null in Quartz job
          Arbi Sookazian Master

          in components.xml, name attribute's value must match in the EntityManager instance name.


          ex:


          components.xml


          <persistence:managed-persistence-context name="entityManager"
                                               auto-create="true"
                                persistence-unit-jndi-name="java:/boBETSEntityManagerFactory"/>



          foo.java


          @In EntityManager entityManager;