5 Replies Latest reply on Aug 7, 2007 8:41 AM by Pete Muir

    h:datatable/el not displaying data

    Sean Burns Newbie

      Hi again,

      I am using Seam 2.0.0 beta and Jboss 4.2.1,

      I am having lots of problems using Seam from a quartz MDB bean (instead of from the web end where everything works perfectly)

      This is an example of my xhtml file that is included in the email and in the web page... (It works from the web page)

      includeData.xhtml

       <h:dataTable value="#{settlementList.resultList}" var="settlement">
       <h:column>
       #{settlement.testString}
       </h:column>
       <h:column>
       hello
       </h:column>
       </h:dataTable>
      


      where the resultList returns a List of 5 entity beans, and the value of testString is "bob"

      I include this code using the standard
      <ui:include src="/includeData.xhtml" />


      now from the website, this displays a table with 5 rows and 2 columns, first column contains "bob" and second one contains "hello".

      The email also has a 5 row table but the first column is empty and second column contains "bob"...

      after lots of testing and debugging it looks like the el is not even parsing
      #{settlement.testString} because if I change it to #{settlement.testasdegtqarString} the website gives an error where as the email still sends with same results, I also tried to use rich:dataTable instead of h:dataTable hoping it was JSF-RI that was the problem and got this exception
      13:12:05,809 ERROR [SendSettlementEmailBean] could not EMAIL:
      javax.faces.FacesException: Resources framework is not initialised, check web.xml for Filter configuration
      at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getWebXml(ResourceBuilderImpl.java:109)
      at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getUri(ResourceBuilderImpl.java:297)
      at org.ajax4jsf.framework.resource.InternetResourceBase.getUri(InternetResourceBase.java:211)
      at org.ajax4jsf.framework.resource.BaseResourceRenderer.encodeBegin(BaseResourceRenderer.java:62)
      at org.ajax4jsf.framework.resource.OneTimeRenderer.encodeBegin(OneTimeRenderer.java:48)
      at org.ajax4jsf.framework.resource.BaseResourceRenderer.encode(BaseResourceRenderer.java:45)
      at org.ajax4jsf.framework.resource.InternetResourceBase.encode(InternetResourceBase.java:306)
      at org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.encodeResourcesArray(HeaderResourcesRendererBase.java:131)
      at org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.preEncodeBegin(HeaderResourcesRendererBase.java:118)
      at org.ajax4jsf.framework.renderer.RendererBase.encodeBegin(RendererBase.java:98)
      at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
      at javax.faces.component.UIData.encodeBegin(UIData.java:879)
      at org.ajax4jsf.ajax.repeat.UIDataAdaptor.encodeBegin(UIDataAdaptor.java:989)
      at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:269)
      at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:117)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
      at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175)
      at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
      at org.jboss.seam.mail.ui.MailComponent.encode(MailComponent.java:80)
      at org.jboss.seam.mail.ui.MailComponent.encode(MailComponent.java:54)
      at org.jboss.seam.mail.ui.UIBody.encodeChildren(UIBody.java:44)
      at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175)
      at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
      at org.jboss.seam.mail.ui.UIMessage.encodeChildren(UIMessage.java:155)
      at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175)
      at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163)
      at org.jboss.seam.ui.facelet.FaceletsRenderer.renderFacelet(FaceletsRenderer.java:147)
      at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:111)
      at coza.healthbridge.justswipe.beans.session.SendSettlementEmailBean.sendEmail(SendSettlementEmailBean.java:63)
      at coza.healthbridge.justswipe.beans.session.SendSettlementEmailBean.sendEmails(SendSettlementEmailBean.java:56)
      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.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.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.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
      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.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
      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.stateful.StatefulContainer.localInvoke(StatefulContainer.java:204)
      at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:100)
      at $Proxy158.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.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.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 $Proxy161.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)



      I am not sure if changing to rich faces would solve the problem...


      The rest of my code is
      @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 the actual bean that is emailing



      @Stateless
      @Name("sendEmailsBean")
      public class SendSettlementEmailBean implements SendSettlementEmail {
      
       @Logger
       Log log;
      
       @In(create = true)
       private Renderer renderer;
      
       private void sendEmails() {
       try {
       renderer.render("/emails/settlementReport.xhtml");
       log.debug("Email Sent");
       } catch (Exception e) {
       log.error("could not EMAIL:", e);
       }
       }
      }
      


      any ideas? please?, if you need any more info, just ask... because I am having trouble just understanding what the real problem is...

      Sean.

      ps. This used to work with JBoss 4.0.5 and Seam 1.2.1

        • 1. Re: h:datatable/el not displaying data
          Pete Muir Master

          Agh. Post the whole template.

          • 2. Re: h:datatable/el not displaying data
            Sean Burns Newbie

            Ok, this is everything... going to be long...

            most of it was generated by seam-gen


            Web.xml

            <?xml version="1.0" ?>
            <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
             version="2.4">
            
             <!-- Ajax4jsf -->
            
             <context-param>
             <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
             <param-value>com.sun.facelets.FaceletViewHandler</param-value>
             </context-param>
            
             <context-param>
             <param-name>org.ajax4jsf.SKIN</param-name>
             <param-value>blueSky</param-value>
             </context-param>
            
             <context-param>
             <param-name>facelets.LIBRARIES</param-name>
             <param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
             </context-param>
            
             <!-- Seam -->
            
             <listener>
             <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
             </listener>
            
             <filter>
             <filter-name>Seam Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Filter</filter-name>
             <url-pattern>/*</url-pattern>
             </filter-mapping>
            
             <servlet>
             <servlet-name>Seam Resource Servlet</servlet-name>
             <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>Seam Resource Servlet</servlet-name>
             <url-pattern>/seam/resource/*</url-pattern>
             </servlet-mapping>
            
             <!-- Facelets development mode (disable in production) -->
            
             <context-param>
             <param-name>facelets.DEVELOPMENT</param-name>
             <param-value>true</param-value>
             </context-param>
            
             <!-- JSF -->
            
             <context-param>
             <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
             <param-value>.xhtml</param-value>
             </context-param>
            
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.seam</url-pattern>
             </servlet-mapping>
            
             <servlet>
             <servlet-name>JustSwipeService</servlet-name>
             <servlet-class>
             coza.healthbridge.justswipe.beans.webservices.JustSwipeService
             </servlet-class>
             </servlet>
            
             <servlet-mapping>
             <servlet-name>JustSwipeService</servlet-name>
             <url-pattern>/JustSwipeService</url-pattern>
             </servlet-mapping>
            
             <filter>
             <filter-name>Seam Servlet Filter</filter-name>
             <filter-class>
             org.jboss.seam.servlet.SeamServletFilter
             </filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Servlet Filter</filter-name>
             <url-pattern>/JustSwipeService</url-pattern>
             </filter-mapping>
            
             <security-constraint>
             <display-name>Restrict raw XHTML Documents</display-name>
             <web-resource-collection>
             <web-resource-name>XHTML</web-resource-name>
             <url-pattern>*.xhtml</url-pattern>
             </web-resource-collection>
             <auth-constraint>
             <role-name>NONE</role-name>
             </auth-constraint>
             </security-constraint>
            
             <!-- MyFaces : Tomahawk extension -->
            
             <filter>
             <filter-name>MyFacesExtensionsFilter</filter-name>
             <filter-class>
             org.apache.myfaces.webapp.filter.ExtensionsFilter
             </filter-class>
             <init-param>
             <param-name>maxFileSize</param-name>
             <param-value>20m</param-value>
             </init-param>
             </filter>
            
             <filter-mapping>
             <filter-name>MyFacesExtensionsFilter</filter-name>
             <url-pattern>*.seam</url-pattern>
             </filter-mapping>
            
            </web-app>
            


            components.xml
            <?xml version="1.0" encoding="UTF-8"?>
            <components xmlns="http://jboss.com/products/seam/components"
             xmlns:core="http://jboss.com/products/seam/core"
             xmlns:persistence="http://jboss.com/products/seam/persistence"
             xmlns:drools="http://jboss.com/products/seam/drools"
             xmlns:security="http://jboss.com/products/seam/security"
             xmlns:mail="http://jboss.com/products/seam/mail"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=
             "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
             http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
             http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
             http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
             http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
             http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
            
             <core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
            
             <core:manager concurrent-request-timeout="500"
             conversation-timeout="120000"
             conversation-id-parameter="cid"/>
            
             <persistence:managed-persistence-context name="entityManager"
             auto-create="true"
             persistence-unit-jndi-name="java:/JustSwipeEntityManagerFactory"/>
            
             <drools:rule-base name="securityRules">
             <drools:rule-files>
             <value>/security.drl</value>
             </drools:rule-files>
             </drools:rule-base>
            
             <security:identity authenticate-method="#{authenticator.authenticate}"
             security-rules="#{securityRules}"/>
            
             <event type="org.jboss.seam.notLoggedIn">
             <action expression="#{redirect.captureCurrentView}"/>
             </event>
             <event type="org.jboss.seam.postAuthenticate">
             <action expression="#{redirect.returnToCapturedView}"/>
             </event>
            
             <mail:mail-session host="hbmisdb1" port="25" username="test" password="test" />
            
             <!-- For use with jBPM pageflow or process management -->
             <!--
             <bpm:jbpm>
             <bpm:process-definitions></bpm:process-definitions>
             <bpm:pageflow-definitions></bpm:pageflow-definitions>
             </bpm:jbpm>
             -->
            
            </components>
            


            QuartzMDBBean.java





            package coza.healthbridge.justswipe.beans.services;
            
            import javax.ejb.ActivationConfigProperty;
            import javax.ejb.EJB;
            import javax.ejb.MessageDriven;
            
            import org.jboss.annotation.ejb.Depends;
            import org.jboss.annotation.ejb.ResourceAdapter;
            import org.quartz.Job;
            import org.quartz.JobExecutionContext;
            import org.quartz.JobExecutionException;
            
            import coza.healthbridge.justswipe.beans.session.SendSettlementEmail;
            
            @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();
             }
            }
            


            Interface
            package coza.healthbridge.justswipe.beans.session;
            
            import javax.ejb.Local;
            
            @Local
            public interface SendSettlementEmail {
             public void sendEmails();
            
            }


            The Bean
            package coza.healthbridge.justswipe.beans.session;
            
            import java.util.Calendar;
            import java.util.Date;
            import java.util.GregorianCalendar;
            import java.util.List;
            
            import javax.ejb.Stateless;
            
            import org.jboss.seam.annotations.In;
            import org.jboss.seam.annotations.Logger;
            import org.jboss.seam.annotations.Name;
            import org.jboss.seam.faces.Renderer;
            import org.jboss.seam.log.Log;
            
            import coza.healthbridge.justswipe.beans.entity.Hbclient;
            import coza.healthbridge.justswipe.beans.entity.HbclientHome;
            import coza.healthbridge.justswipe.beans.entity.HbclientList;
            import coza.healthbridge.justswipe.beans.entity.SettlementList;
            
            @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;
            
             @In(create = true)
             private Renderer renderer;
            
             public void sendEmails() {
             hbclientList.setNoLimit(true);
             List<Hbclient> clientList = hbclientList.getResultList();
             for (Hbclient hbclient : clientList) {
             if (hbclient.getSendSettlementEmail() != null
             && hbclient.getSendSettlementEmail()) {
             hbclientHome.setInstance(hbclient);
             settlementList.setClientPk(hbclient.getClientPk());
             settlementList.setMinDate(getMinDate());
             settlementList.setMaxDate(getMaxDate());
             sendEmail();
             }
             }
             }
            
             private void sendEmail() {
             try {
             renderer.render("/emails/settlementReport.xhtml");
             log.debug("Email Sent");
             } catch (Exception e) {
             log.error("could not EMAIL:", e);
             }
             }
            
             private Date getMinDate() {
             Calendar cal = new GregorianCalendar();
             cal.set(Calendar.DATE, 1);
             cal.set(Calendar.HOUR, 0);
             cal.set(Calendar.MINUTE, 0);
             cal.set(Calendar.SECOND, 0);
             cal.set(Calendar.MILLISECOND, 0);
             return cal.getTime();
             }
            
             private Date getMaxDate() {
             Calendar cal = new GregorianCalendar();
             cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
             cal.set(Calendar.HOUR, 0);
             cal.set(Calendar.MINUTE, 0);
             cal.set(Calendar.SECOND, 0);
             cal.set(Calendar.MILLISECOND, 0);
             return cal.getTime();
             }
            }
            


            The 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="Test"
             address="test@healthbridge.co.za" />
             <m:to>#{hbclientHome.instance.email}</m:to>
             <m:subject>Test: #{settlementList.month}</m:subject>
            
             <m:body>
            
             <ui:include src="/pages/reports/SettlementData.xhtml" />
            
             </m:body>
            </m:message>
            


            the Data
            <h:panelGroup xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:s="http://jboss.com/products/seam/taglib"
             xmlns:rich="http://richfaces.ajax4jsf.org/rich" id="ajaxDropDownArea">
             <h:outputText value="No settlement Data for this month"
             rendered="#{empty settlementList.resultList}" />
             <h:dataTable id="settlementList" var="settlement"
             value="#{settlementList.resultList}"
             rendered="#{not empty settlementList.resultList}" cellpadding="5"
             cellspacing="0" border="1" width="100%"
             style="border-collapse:collapse;border-color=#B2B2B2"
             headerClass="table_header" rowClasses="row1,row2"
             footerClass="boldFont txt_black_12 columnRight hiLight">
            
             <h:column rendered="#{merchantNoDropDown.totalBranches > 1}">
             <h:outputText styleClass="txt_black_11"
             value="#{settlement.merchant.friendlyName}" />
             <h:outputText styleClass="txt_black_11"
             value="#{settlement.merchant.merchantNum}"
             rendered="#{settlement.merchant.friendlyName == null}" />
             </h:column>
             <h:column>
             <s:link view="/#{empty from ? '/pages/reports/Swipes' : from}.xhtml"
             id="settlement" propagation="nest" styleClass="link_orange_11">
             <f:param name="settlementSettlementPk"
             value="#{settlement.settlementPk}" />
             <h:outputText value="#{settlement.paymentDate}">
             <f:convertDateTime pattern="dd MMMMM yyyy" timeZone="CAT" />
             </h:outputText>
             </s:link>
             </h:column>
             <h:column>
             <h:outputText styleClass="txt_black_11" value="#{settlement.eftnum}" />
             </h:column>
             <h:column>
             <h:outputText styleClass="txt_black_11"
             value="#{settlement.totalPaymentAmt/100}">
             <f:convertNumber type="currency" currencySymbol="R " />
             </h:outputText>
             </h:column>
             <h:column>
             <h:outputText styleClass="txt_black_11 columnRight"
             value="#{settlement.totalDebitCardAmt/100}">
             <f:convertNumber type="currency" currencySymbol="R " />
             </h:outputText>
             </h:column>
             <h:column>
             <h:outputText styleClass="txt_black_11"
             value="#{settlement.totalCreditCardAmt/100}">
             <f:convertNumber type="currency" currencySymbol="R " />
             </h:outputText>
             </h:column>
             </h:dataTable>
            </h:panelGroup>
            
            



            The settlementsList


            package coza.healthbridge.justswipe.beans.entity;
            
            import org.jboss.seam.ScopeType;
            import org.jboss.seam.annotations.In;
            import org.jboss.seam.annotations.Name;
            import org.jboss.seam.annotations.Out;
            import org.jboss.seam.framework.EntityQuery;
            
            import coza.healthbridge.justswipe.beans.session.InfoSelected;
            import coza.healthbridge.justswipe.beans.session.InfoSelectedBean;
            
            import java.util.Calendar;
            import java.util.Date;
            import java.util.GregorianCalendar;
            import java.util.List;
            import java.util.Arrays;
            
            @Name("settlementList")
            public class SettlementList extends EntityQuery {
            
             @In(create = true)
             InfoSelected infoSelected;
            
             private static final String[] RESTRICTIONS = {
             "lower(settlement.originalMessageId) like concat(lower(#{settlementList.settlement.originalMessageId}),'%')",
             "lower(settlement.merchant.merchantPk) = #{selectedMerchant.merchantPk}",
             "lower(settlement.merchant.hbclient.clientPk) = #{loggedInClient.clientPk}",
             "lower(settlement.settlementDate) >= #{infoSelected.minDate}",
             "lower(settlement.settlementDate) <= #{infoSelected.maxDate}",
             "lower(settlement.merchant.hbclient.clientPk) = #{settlementList.clientPk}",
             "lower(settlement.settlementDate) >= #{settlementList.minDate}",
             "lower(settlement.settlementDate) <= #{settlementList.maxDate}",
             "lower(settlement.settlementPk) < #{settlementList.lessThanPk}",
             "lower(settlement.settlementPk) > #{settlementList.greaterThanPk}",
             "lower(settlement.eftnum) like concat(lower(#{settlementList.settlement.eftnum}),'%')", };
            
             private Settlement settlement = new Settlement();
            
             private Integer lessThanPk;
            
             private Integer greaterThanPk;
            
             private Date minDate;
            
             private Date maxDate;
            
             private Integer clientPk;
            
             private boolean overrideMaxResults;
            
             @Override
             public String getEjbql() {
             return "select settlement from Settlement settlement";
             }
            
             @Override
             public Integer getMaxResults() {
             if (overrideMaxResults) {
             return super.getMaxResults();
             }
             return 200;
             }
            
             public Settlement getSettlement() {
             return settlement;
             }
            
             @Override
             public List<String> getRestrictions() {
             return Arrays.asList(RESTRICTIONS);
             }
            
             public int getTotalsTotalPaymentAmount() {
             List<Settlement> results = getResultList();
             int totalSum = 0;
             for (Settlement settlement : results) {
             totalSum += settlement.getTotalPaymentAmt();
             }
             return totalSum;
             }
            
             public int getTotalsTotalCreditAmount() {
             List<Settlement> results = getResultList();
             int totalSum = 0;
             for (Settlement settlement : results) {
             totalSum += settlement.getTotalCreditCardAmt();
             }
             return totalSum;
             }
            
             public int getTotalsTotalDebitAmount() {
             List<Settlement> results = getResultList();
             int totalSum = 0;
             for (Settlement settlement : results) {
             totalSum += settlement.getTotalDebitCardAmt();
             }
             return totalSum;
             }
            
             public Date getLatestSettlementDate() {
             infoSelected.resetDates();
             overrideMaxResults = true;
             setMaxResults(1);
             setOrder("settlement.settlementDate desc");
             List<Settlement> list = getResultList();
             overrideMaxResults = false;
             if (list != null && list.size() == 1) {
             Settlement set = list.get(0);
             return set.getPaymentDate();
             }
             return null;
             }
            
             public Date getMonth() {
             List<Settlement> list = getResultList();
             if (list != null && list.size() >= 1) {
             Settlement set = list.get(0);
             return set.getPaymentDate();
             }
             return null;
             }
            
             public Date getLastDayOfMonth() {
             overrideMaxResults = true;
             setMaxResults(1);
             setOrder("settlement.settlementDate desc");
             List<Settlement> list = getResultList();
             overrideMaxResults = false;
             if (list != null && list.size() >= 1) {
             Settlement set = list.get(0);
             Date s = set.getPaymentDate();
             Calendar cal = Calendar.getInstance();
             cal.setTimeInMillis(s.getTime());
             cal.set(Calendar.DAY_OF_MONTH, cal
             .getActualMaximum(Calendar.DAY_OF_MONTH));
             return cal.getTime();
             }
             return null;
             }
            
             /**
             * @return the greaterThanPk
             */
             public Integer getGreaterThanPk() {
             return greaterThanPk;
             }
            
             /**
             * @param greaterThanPk
             * the greaterThanPk to set
             */
             public void setGreaterThanPk(Integer greaterThanPk) {
             this.greaterThanPk = greaterThanPk;
             }
            
             /**
             * @return the lessThanPk
             */
             public Integer getLessThanPk() {
             return lessThanPk;
             }
            
             /**
             * @param lessThanPk
             * the lessThanPk to set
             */
             public void setLessThanPk(Integer lessThanPk) {
             this.lessThanPk = lessThanPk;
             }
            
             /**
             * @return the clientPk
             */
             public Integer getClientPk() {
             return clientPk;
             }
            
             /**
             * @param clientPk
             * the clientPk to set
             */
             public void setClientPk(Integer clientPk) {
             this.clientPk = clientPk;
             }
            
             /**
             * @return the maxDate
             */
             public Date getMaxDate() {
             return maxDate;
             }
            
             /**
             * @param maxDate
             * the maxDate to set
             */
             public void setMaxDate(Date maxDate) {
             this.maxDate = maxDate;
             }
            
             /**
             * @return the minDate
             */
             public Date getMinDate() {
             return minDate;
             }
            
             /**
             * @param minDate
             * the minDate to set
             */
             public void setMinDate(Date minDate) {
             this.minDate = minDate;
             }
            
            }
            



            and finally... the entity
            package coza.healthbridge.justswipe.beans.entity;
            // Generated 2007/05/31 10:15:13 by Hibernate Tools 3.2.0.b9
            
            import java.util.Date;
            import java.util.HashSet;
            import java.util.Set;
            
            import javax.persistence.Basic;
            import javax.persistence.CascadeType;
            import javax.persistence.Column;
            import javax.persistence.Entity;
            import javax.persistence.FetchType;
            import javax.persistence.GeneratedValue;
            import javax.persistence.Id;
            import javax.persistence.JoinColumn;
            import javax.persistence.ManyToOne;
            import javax.persistence.OneToMany;
            import javax.persistence.Table;
            import javax.persistence.Temporal;
            import javax.persistence.TemporalType;
            import javax.persistence.UniqueConstraint;
            import org.hibernate.validator.Length;
            import org.hibernate.validator.NotNull;
            
            /**
             * Settlement generated by hbm2java
             */
            @Entity
            @Table(name = "settlement", catalog = "justswipe", uniqueConstraints = @UniqueConstraint(columnNames = "OriginalMessageID"))
            public class Settlement implements java.io.Serializable {
            
             private int settlementPk;
             private Settlementtype settlementtype;
             private Merchantbranch merchantbranch;
             private Bank bank;
             private Merchant merchant;
             private String originalMessageId;
             private Date settlementDate;
             private Date paymentDate;
             private int accNum;
             private String eftnum;
             private int totalPaymentAmt;
             private int totalDebitCardAmt;
             private int totalCreditCardAmt;
             private Set<Transaction> transactions = new HashSet<Transaction>(0);
            
             public Settlement() {
             }
            
             public Settlement(int settlementPk, Settlementtype settlementtype,
             Merchant merchant, String originalMessageId, Date settlementDate,
             int accNum, int totalPaymentAmt, int totalDebitCardAmt,
             int totalCreditCardAmt) {
             this.settlementPk = settlementPk;
             this.settlementtype = settlementtype;
             this.merchant = merchant;
             this.originalMessageId = originalMessageId;
             this.settlementDate = settlementDate;
             this.accNum = accNum;
             this.totalPaymentAmt = totalPaymentAmt;
             this.totalDebitCardAmt = totalDebitCardAmt;
             this.totalCreditCardAmt = totalCreditCardAmt;
             }
             public Settlement(int settlementPk, Settlementtype settlementtype,
             Merchantbranch merchantbranch, Bank bank, Merchant merchant,
             String originalMessageId, Date settlementDate, Date paymentDate,
             int accNum, String eftnum, int totalPaymentAmt,
             int totalDebitCardAmt, int totalCreditCardAmt,
             Set<Transaction> transactions) {
             this.settlementPk = settlementPk;
             this.settlementtype = settlementtype;
             this.merchantbranch = merchantbranch;
             this.bank = bank;
             this.merchant = merchant;
             this.originalMessageId = originalMessageId;
             this.settlementDate = settlementDate;
             this.paymentDate = paymentDate;
             this.accNum = accNum;
             this.eftnum = eftnum;
             this.totalPaymentAmt = totalPaymentAmt;
             this.totalDebitCardAmt = totalDebitCardAmt;
             this.totalCreditCardAmt = totalCreditCardAmt;
             this.transactions = transactions;
             }
            
             @Id
             @Column(name = "SettlementPk", unique = true, nullable = false)
             @NotNull
             @GeneratedValue
             public int getSettlementPk() {
             return this.settlementPk;
             }
            
             public void setSettlementPk(int settlementPk) {
             this.settlementPk = settlementPk;
             }
             @ManyToOne(fetch = FetchType.LAZY)
             @JoinColumn(name = "SettlementTypeFk", nullable = false)
             @NotNull
             public Settlementtype getSettlementtype() {
             return this.settlementtype;
             }
            
             public void setSettlementtype(Settlementtype settlementtype) {
             this.settlementtype = settlementtype;
             }
             @ManyToOne(fetch = FetchType.LAZY)
             @JoinColumn(name = "MerchantBranchFk")
             public Merchantbranch getMerchantbranch() {
             return this.merchantbranch;
             }
            
             public void setMerchantbranch(Merchantbranch merchantbranch) {
             this.merchantbranch = merchantbranch;
             }
             @ManyToOne(fetch = FetchType.LAZY)
             @JoinColumn(name = "BankFk")
             public Bank getBank() {
             return this.bank;
             }
            
             public void setBank(Bank bank) {
             this.bank = bank;
             }
             @ManyToOne(fetch = FetchType.LAZY)
             @JoinColumn(name = "MerchantFk", nullable = false)
             @NotNull
             public Merchant getMerchant() {
             return this.merchant;
             }
            
             public void setMerchant(Merchant merchant) {
             this.merchant = merchant;
             }
            
             @Basic
             @Column(name = "OriginalMessageID", unique = true, nullable = false, length = 22,columnDefinition="char")
             @NotNull
             @Length(max = 22)
             public String getOriginalMessageId() {
             return this.originalMessageId;
             }
            
             public void setOriginalMessageId(String originalMessageId) {
             this.originalMessageId = originalMessageId;
             }
             @Temporal(TemporalType.TIMESTAMP)
             @Column(name = "SettlementDate", nullable = false, length = 0)
             @NotNull
             public Date getSettlementDate() {
             return this.settlementDate;
             }
            
             public void setSettlementDate(Date settlementDate) {
             this.settlementDate = settlementDate;
             }
             @Temporal(TemporalType.TIMESTAMP)
             @Column(name = "PaymentDate", length = 0)
             public Date getPaymentDate() {
             return this.paymentDate;
             }
            
             public void setPaymentDate(Date paymentDate) {
             this.paymentDate = paymentDate;
             }
            
             @Column(name = "AccNum", nullable = false)
             @NotNull
             public int getAccNum() {
             return this.accNum;
             }
            
             public void setAccNum(int accNum) {
             this.accNum = accNum;
             }
            
             @Column(name = "EFTNum", length = 40)
             @Length(max = 40)
             public String getEftnum() {
             return this.eftnum;
             }
            
             public void setEftnum(String eftnum) {
             this.eftnum = eftnum;
             }
            
             @Column(name = "TotalPaymentAmt", nullable = false)
             @NotNull
             public int getTotalPaymentAmt() {
             return this.totalPaymentAmt;
             }
            
             public void setTotalPaymentAmt(int totalPaymentAmt) {
             this.totalPaymentAmt = totalPaymentAmt;
             }
            
             @Column(name = "TotalDebitCardAmt", nullable = false)
             @NotNull
             public int getTotalDebitCardAmt() {
             return this.totalDebitCardAmt;
             }
            
             public void setTotalDebitCardAmt(int totalDebitCardAmt) {
             this.totalDebitCardAmt = totalDebitCardAmt;
             }
            
             @Column(name = "TotalCreditCardAmt", nullable = false)
             @NotNull
             public int getTotalCreditCardAmt() {
             return this.totalCreditCardAmt;
             }
            
             public void setTotalCreditCardAmt(int totalCreditCardAmt) {
             this.totalCreditCardAmt = totalCreditCardAmt;
             }
             @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "settlement")
             public Set<Transaction> getTransactions() {
             return this.transactions;
             }
            
             public void setTransactions(Set<Transaction> transactions) {
             this.transactions = transactions;
             }
            
            }
            



            What is confusing me... is that all this code is working perfectly via the front end... it only goes wrong when the Cronjob sends the email.

            Thanks.

            • 3. Re: h:datatable/el not displaying data
              Pete Muir Master

              Try not including any refs to ajax4jsf/richfaces in your email template. If this still persists then please post back.

              • 4. Re: h:datatable/el not displaying data
                Sean Burns Newbie

                I removed the

                xmlns:rich="http://richfaces.ajax4jsf.org/rich" id="ajaxDropDownArea"

                and the result is the same... no luck.

                • 5. Re: h:datatable/el not displaying data
                  Pete Muir Master

                  Please file an issue in JIRA for this.