4 Replies Latest reply on Sep 17, 2007 9:36 AM by goku2

    Seam PDF issue

    nemya

      Hi,
      I'm using Jboss Seam 1.2.1.GA + Jboss Server 4.0.5.GA. I'm trying to generate PDFs. I added the "jboss-seam-pdf.jar" and the "itext-2.0.1.jar" to my project. And I created a simple page (token from a tuto):

      <p:document xmlns:p="http://jboss.com/products/seam/pdf">
       <p:image alignment="right" wrap="true" resource="/logo.jpg" />
       <p:font size="24">
       <p:paragraph spacingAfter="50">My First Document</p:paragraph>
       </p:font>
      
       <p:paragraph alignment="justify">
       This is a simple document. It isn't very fancy.
       </p:paragraph>
      </p:document>


      When I call this page I have the following exception:

      09:36:07,187 ERROR [ExceptionFilter] uncaught exception
      javax.servlet.ServletException: com/lowagie/text/DocumentException
      


      Please some help. I have to make this work today otherwise my boss will kill me.
      Thank you

        • 1. Re: Seam PDF issue
          goku2

          Thsi problem is beacuse the itext-2.0.x.jar is not on the classpath.

          Place this file(is inside your project´s lib) inside your JBoss AS sever/default/lib folder (if your using the default).
          That wil solve the problem.

          But the thing is.. is this a simple bug in the build.xml? It should include this file in the deployed .war o .ear

          :D

          • 2. Re: Seam PDF issue
            nemya

            Thanks
            the problem was the text-2.0.x.jar missing in the JBoss AS sever/default/lib folder.

            • 3. Re: Seam PDF issue

              You would normally put the JAR in your WAR, but putting it in JBoss lib dir is fine.

              • 4. Re: Seam PDF issue
                goku2

                Yes, thats the normal thing to do but the deploy task in build.xml provided by seam setup doesn't add this jar.
                For example
                $ ant deploy
                Creates a .war in the dist folder and copies the data source xml and this .war inside the deploy folder of your jboss as.
                The thing is that the .war doesn't contains itext-2.0.x.jar in the lib folder.

                You can solve this adding

                inside the war task in your build.xml

                Like this

                 <copy todir="${war.dir}/WEB-INF/lib">
                 <fileset dir="${lib.dir}">
                 <include name="ajax4jsf*.jar" />
                 <include name="richfaces*.jar" />
                 <include name="oscache*.jar" />
                 <include name="jsf-facelets.jar" />
                 <include name="jboss-seam-*.jar" />
                 <exclude name="jboss-seam-gen.jar" />
                 <include name="drools-*.jar"/>
                 <include name="janino-*.jar"/>
                
                 <include name="itext-*.jar"/>
                
                 <include name="antlr-*.jar"/>
                 <include name="commons-jci-*.jar"/>
                 <include name="stringtemplate-*.jar"/>
                 </fileset>
                 </copy>