5 Replies Latest reply on Aug 24, 2007 2:47 PM by Norman Richards

    Seam PDF errors

    Edem Morny Novice

      Hi,

      I'm using Seam 1.2.1.GA and JBoss 4.0.5.GA . I have 2 issues with my use of the Seam PDF functionalities that i'll like some solutions on.

      First.
      I've configured the Document Store Servlet and everything else pertaining to PDF in the web.xml file. I'm able to generate PDF's alright, but i find that there is an error message on the JBoss console anytime i click a link that renders a PDF as follows:

      
      java.lang.IllegalStateException: No active event context
       at org.jboss.seam.core.Manager.instance(Manager.java:267)
       at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:58)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:619)
      09:41:36,900 ERROR [[Document Store Servlet]] Servlet.service() for servlet Document Store Servlet threw exception
      java.lang.IllegalStateException: No active event context
       at org.jboss.seam.core.Manager.instance(Manager.java:267)
       at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:58)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:619)
      
      



      Secondly

      I have a facelet that sends a PDF attachment. However, when i send the email to myself and open the attached PDF i get an error in Adobe Reader that the file cannot be opened "Because it it either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly coded?.

      This is the facelet file

      <ui:composition 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:p="http://jboss.com/products/seam/pdf"
       xmlns:rich="http://richfaces.ajax4jsf.org/rich"
       template="htmlAttachment.xhtml">
      
       <ui:param name="subject" value="Fair registration" />
       <ui:param name="email" value="#{registration.customer.email}" />
       <ui:param name="name" value="#{registration.customer.fullname}" />
       <ui:param name="file" value="registration_invoice.pdf"/>
       <ui:define name="attach">
       <p:document>
       <p:font size="16" style="bold" ><p:paragraph spacingAfter="10" alignment="left"><p:text value="#{setup.company}"/></p:paragraph></p:font>
       <p:font size="12"><p:paragraph spacingAfter="30" alignment="left">&#160;</p:paragraph>
       <p:paragraph spacingAfter="10" alignment="left"><p:text value="Exhibitor: #{registration.customer.fullname}"/></p:paragraph>
       <p:paragraph spacingAfter="10" alignment="right"><p:text value="Date: #{registration.regdate}"/></p:paragraph>
       <p:paragraph spacingAfter="10" alignment="left"><p:text value="Fair: #{registration.fair.title}"/></p:paragraph>
      
      ... and more
      


      Any help on these. Thanx

        • 1. Re: Seam PDF errors
          Norman Richards Master

          You'll need to provide more details. Can you reproduce the problem with itext example app?

          • 2. Re: Seam PDF errors
            Scott Bader Newbie

            I too, met this error, today. I am also using Seam 1.2.1GA and JBOSS Server 4.0.5GA.
            It began to happen after I added the Document Store Servlet to my configuration.
            Once I removed Document Store Servlet from my configuration, it went away.

            java.lang.IllegalStateException: No active event context
            at org.jboss.seam.core.Manager.instance(Manager.java:267)
            at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:58)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
            at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
            at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
            at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
            at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
            at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
            at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
            at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
            at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
            at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)

            • 3. Re: Seam PDF errors
              Norman Richards Master

              Again, you'll need to provide some details, preferably something derived from the itext example.

              • 4. Re: Seam PDF errors
                Herman Chung Newbie

                I don't know if I am right... I kept getting IllegalStateException, when I check the itext example's web.xml, it doesn't have these two configurations that are in the documentation.

                <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>*.pdf</url-pattern>
                 </filter-mapping>


                I tried removing those two configs and I don't get the exception anymore.

                • 5. Re: Seam PDF errors
                  Norman Richards Master

                  You should map *.pdf to the document store servlet, not to the seam servlet filter.