Hi, I am having problems with Seam Email running off a cron schedule, and the 
behavior is rather erratic..., I am running on JBoss 4.2.1, Seam 2.0.0Beta

This is my quartz service bean
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = 
"cronTrigger", propertyValue = "0 0/1 * * * ?") })
  | @ResourceAdapter("quartz-ra.rar")
  | @Depends("jboss.ha:service=HASingletonDeployer,type=Barrier")
  | public class QuartzMDBBean implements Job {
  | 
  |     @EJB
  |     SendSettlementEmail email;
  | 
  |     public void execute(JobExecutionContext jobExecutionContext)
  |                     throws JobExecutionException {
  |             email.sendEmails();
  |     }
  | }
  | 

and this is my EJB that sends the email
@Stateless
  | @Name("sendEmailsBean")
  | public class SendSettlementEmailBean implements SendSettlementEmail {
  |     @In(create = true)
  |     HbclientList hbclientList;
  | 
  |     @In(create = true)
  |     HbclientHome hbclientHome;
  | 
  |     @In(create = true)
  |     SettlementList settlementList;
  | 
  |     @Logger
  |     Log log;
  | 
  |     public void sendEmails() {
  |             hbclientList.setNoLimit(true);
  |             List<Hbclient> clientList = hbclientList.getResultList();
  |             for (Hbclient hbclient : clientList) {
  |                     hbclientHome.setInstance(hbclient);
  |                     settlementList.setClientPk(hbclient.getClientPk());
  |                     settlementList.setMinDate(getMinDate());
  |                     settlementList.setMaxDate(getMaxDate());
  |                     sendEmail();
  |             }
  |     }
  | 
  |     private void sendEmail() {
  |             try {
  |                     
Renderer.instance().render("/emails/settlementReport.xhtml");
  |                     log.debug("Email Sent");
  |             } catch (Exception e) {
  |                     log.error("could not EMAIL:", e);
  |             }
  |     }
  | ...
  | }


and my actual email 

<m:message xmlns="http://www.w3.org/1999/xhtml";
  |     xmlns:m="http://jboss.com/products/seam/mail";
  |     xmlns:p="http://jboss.com/products/seam/pdf";
  |     xmlns:ui="http://java.sun.com/jsf/facelets";
  |     xmlns:f="http://java.sun.com/jsf/core";
  |     xmlns:h="http://java.sun.com/jsf/html";>
  |     <m:from name="Me" address="[EMAIL PROTECTED]" />
  |     <m:to>#{hbclientHome.instance.email}</m:to>
  |     <m:subject>test</m:subject>
  | 
  |     <m:body>
  | .
  | .
  | .
  | 

Now every minute the cron fires... and about 1/2 - 1/3 of the time I will get 
this exception

anonymous wrote : INFO: Added Library from: 
jar:file:/D:/jboss-4.2.1.GA/server/all/tmp/deploy/tmp1802JustSwipe.ear-contents/JustSwipe-exp.war/WEB-INF/lib/aja
  | /META-INF/a4j.taglib.xml
  | 09:14:01,536 ERROR [SendSettlementEmailBean] could not EMAIL:
  | com.sun.facelets.tag.TagAttributeException: 
/D:/jboss-4.2.1.GA/server/all/tmp/deploy/tmp1802JustSwipe.ear-contents/JustSwipe-exp.war/emails
  | t.xhtml @7,82 address="[EMAIL PROTECTED]" object is not an instance of 
declaring class
  |         at 
com.sun.facelets.tag.BeanPropertyTagRule$LiteralPropertyMetadata.applyMetadata(BeanPropertyTagRule.java:53)
  |         at 
com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
  |         at 
com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
  |         at 
com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:144)
  |         at 
com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
  |         at 
com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
  |         at 
com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
  |         at 
com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
  |         at 
com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
  |         at 
com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
  |         at 
org.jboss.seam.ui.facelet.FaceletsRenderer.renderFacelet(FaceletsRenderer.java:146)
  |         at 
org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:111)
  |         at 
coza.healthbridge.justswipe.beans.session.SendSettlementEmailBean.sendEmail(SendSettlementEmailBean.java:55)
  |         at 
coza.healthbridge.justswipe.beans.session.SendSettlementEmailBean.sendEmails(SendSettlementEmailBean.java:48)
  |         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:585)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
  |         at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
  |         at 
org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
  |         at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
  |         at 
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
  |         at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
  |         at 
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
  |         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.intercept.RootInterceptor.invoke(RootInterceptor.java:116)
  |         at 
org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
  |         at sun.reflect.GeneratedMethodAccessor353.invoke(Unknown Source)
  |         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
  |         at 
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
  |         at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
  |         at 
org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:106)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:214)
  |         at 
org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:184)
  |         at 
org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:81)
  |         at $Proxy236.sendEmails(Unknown Source)
  |         at 
coza.healthbridge.justswipe.beans.services.QuartzMDBBean.execute(QuartzMDBBean.java:25)
  |         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:585)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
  |         at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
  |         at 
org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:44)
  |         at 
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:101)
  |         at 
org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:53)
  |         at sun.reflect.GeneratedMethodAccessor353.invoke(Unknown Source)
  |         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  |         at java.lang.reflect.Method.invoke(Method.java:585)
  |         at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
  |         at 
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
  |         at 
org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:195)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
  |         at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
  |         at 
org.jboss.ejb3.mdb.MessagingContainer.localInvoke(MessagingContainer.java:245)
  |         at 
org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.delivery(MessageInflowLocalProxy.java:268)
  |         at 
org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy.invoke(MessageInflowLocalProxy.java:138)
  |         at $Proxy240.execute(Unknown Source)
  |         at 
org.jboss.resource.adapter.quartz.inflow.QuartzJob.execute(QuartzJob.java:57)
  |         at org.quartz.core.JobRunShell.run(JobRunShell.java:203)
  |         at 
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)
  | Caused by: java.lang.IllegalArgumentException: object is not an instance of 
declaring class
  |         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:585)
  |         at 
com.sun.facelets.tag.BeanPropertyTagRule$LiteralPropertyMetadata.applyMetadata(BeanPropertyTagRule.java:49)
  |         ... 89 more

and the other times it will send the mail.

Am I missing some fundemental seam configuration? 
Must I post this in the EJB forum?
This exception and the fact that it is erratic has me dumbfounded.

Thanks for any help,
Sean.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069942#4069942

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069942
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to