4 Replies Latest reply on Aug 16, 2009 11:12 PM by mana.hotmana76.gmail.com

    Chart doesn't show up

    andre1001

      Hi,


      I'm a beginner with Seam and I'am trying to work out a chart POC using itext sample as basis under the following configuration


      I'm deploying as a .war module besides the example deploys as an .ear module


      Firefox 2
      JBoss 4.2.2
      and 
      
              <dependencies>
                      <dependency>
                              <groupId>org.testng</groupId>
                              <artifactId>testng</artifactId>
                              <classifier>jdk15</classifier>
                              <version>5.8</version>
                              <scope>test</scope>
                      </dependency>
                      
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam</artifactId>
                              <version>2.0.3.CR1</version>
                              <scope>compile</scope>
                              <exclusions>
                                      <exclusion>
                                              <groupId>javassist</groupId>
                                              <artifactId>javassist</artifactId>
                                      </exclusion>
                                      <exclusion>
                                              <groupId>dom4j</groupId>
                                              <artifactId>dom4j</artifactId>
                                      </exclusion>
                                      <exclusion>
                                              <groupId>javax.el</groupId>
                                              <artifactId>el-api</artifactId>
                                      </exclusion>
                              </exclusions>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-ui</artifactId>
                              <version>2.0.3.CR1</version>
                              <scope>compile</scope>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-debug</artifactId>
                              <version>2.0.3.CR1</version>
                              <scope>compile</scope>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-ioc</artifactId>
                              <version>2.0.3.CR1</version>
                              <scope>compile</scope>
                              <exclusions>
                                      <exclusion>
                                              <groupId>javassist</groupId>
                                              <artifactId>javassist</artifactId>
                                      </exclusion>
                              </exclusions>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-mail</artifactId>
                              <version>2.0.3.CR1</version>
                              <scope>compile</scope>
                              <exclusions>
                                      <exclusion>
                                              <groupId>javassist</groupId>
                                              <artifactId>javassist</artifactId>
                                      </exclusion>
                              </exclusions>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-pdf</artifactId>
                              <version>2.0.3.CR1</version>
                              <scope>compile</scope>
                      </dependency>
                      <dependency>
                              <groupId>org.jboss.seam</groupId>
                              <artifactId>jboss-seam-remoting</artifactId>
                              <version>2.0.3.CR1</version>
                              <scope>compile</scope>
                              <exclusions>
                                      <exclusion>
                                              <groupId>dom4j</groupId>
                                              <artifactId>dom4j</artifactId>
                                      </exclusion>
                              </exclusions>
                      </dependency>
                      <dependency>
                              <groupId>javax.faces</groupId>
                              <artifactId>jsf-api</artifactId>
                              <version>1.2_08</version>
                              <scope>provided</scope>
                      </dependency>
                      <dependency>
                              <groupId>jfree</groupId>
                              <artifactId>jcommon</artifactId>
                              <version>1.0.12</version>
                              <scope>compile</scope>
                      </dependency>
                      <dependency>
                              <groupId>jfree</groupId>
                              <artifactId>jfreechart</artifactId>
                              <version>1.0.9</version>
                              <scope>compile</scope>
                      </dependency>
                      <!-- dependency>
                              <groupId>org.richfaces.framework</groupId>
                              <artifactId>richfaces-api</artifactId>
                              <version>3.1.4.GA</version>
                              <scope>compile</scope>
                              <exclusions>
                                      <exclusion>
                                              <groupId>commons-collections</groupId>
                                              <artifactId>commons-collections</artifactId>
                                      </exclusion>
                              </exclusions>
                      </dependency -->
                      <dependency>
                              <groupId>org.richfaces.framework</groupId>
                              <artifactId>richfaces-impl</artifactId>
                              <version>3.2.1.GA</version>
                              <scope>compile</scope>
                      </dependency>
                      <dependency>
                              <groupId>org.richfaces.ui</groupId>
                              <artifactId>richfaces-ui</artifactId>
                              <version>3.2.1.GA</version>
                              <scope>compile</scope>
                      </dependency>
      
      



      1) Running the example I notice that if I comment


         <!-- filter> 
              <display-name>Ajax4jsf Filter</display-name> 
              <filter-name>ajax4jsf</filter-name> 
              <filter-class>org.ajax4jsf.Filter</filter-class> 
          </filter> 
          <filter-mapping> 
              <filter-name>ajax4jsf</filter-name> 
              <servlet-name>Faces Servlet</servlet-name>
              <dispatcher>REQUEST</dispatcher>
              <dispatcher>FORWARD</dispatcher>
              <dispatcher>INCLUDE</dispatcher>
          </filter-mapping  -->
      
      


      the components under rich:tabPanel start to work.


      Is it a bug?


      2) When I deploy my .war module with the same configurations (components.xml, faces-config.xml, pages-xml and web-xml) as the sample, the graph doesn't show up, but the tabs are showed and I can navigate over them. Console doesn't show any ERROR messages.


      FireBug shows me this:


      <body>
      <div id="j_id2" class="dr-pnl rich-panel">
      <div id="j_id2_header" class="dr-pnl-h rich-panel-header">HTML Chart Demo</div>
      <div id="j_id2_body" class="dr-pnl-b rich-panel-body">
      <span id="chart">
      <img width="400" height="300"   src="/notas/seam/resource/graphicImage/org.jboss.seam.ui.GraphicImageStore.3946e307-11b315f257a--6c0c.jpg"/>
      </span>
      </div>
      </div>
      <form id="j_id9" name="j_id9" method="post" action="/notas/chart.seam" enctype="application/x-www-form-urlencoded">
      </form>
      </body>
      


      When I change any chart properties, it generates another .jpg.


      Am I doing something wrong?


      Thanks

        • 1. Re: Chart doesn't show up
          mail.micke

          Hi


          I had a similar problem and posted about it a while ago ChartsNotShowingInIEAndRedishInFirefox3. (without replies).


          Just tried the same page in firefox2 and the charts aren't visible either. In IE I get missing-image icons and in FF3 the charts appear abut is all red...


          If you sort this out please post it :)


          Cheers,
          micke

          • 2. Re: Chart doesn't show up
            andre1001

            Now it's working fine...


            It was something due library versions hell...


            I've changed my .pom to get the Seam recommended versions...


                 <parent>
            
                      <groupId>org.jboss.seam</groupId>
                      <artifactId>root</artifactId>
                      <version>2.0.3.CR1</version>
            
                 </parent> 
            
            



            which gives...


            commons-beansutils-1.7.0
            commons-digester-1.8
            itext-2.0.7
            jboss-el-2.0.1.GA
            jboss-seam-2.0.3.CR1
            jboss-seam-debug-2.0.3.CR1
            jboss-seam-ioc-2.0.3.CR1
            jboss-seam-mail-2.0.3.CR1
            jboss-seam-pdf-2.0.3.CR1
            jboss-seam-remoting-2.0.3.CR1
            jboss-seam-ui-2.0.3.CR1
            jcommon-1.0.12
            jfreechart-1.0.8a
            jsf-facelets-1.1.15.B1
            richfaces-api-3.1.4.GA
            richfaces-impl-3.1.4.GA
            richfaces-ui-3.1.4.GA

            • 3. Re: Chart doesn't show up
              mail.micke

              Thanks,
              that solved my issue as well.


              More specifically I was using jfreechart 1.0.9, switching to 1.0.8a sorted out the problem.


              - micke

              • 4. Re: Chart doesn't show up
                mana.hotmana76.gmail.com

                Version 1.0.9 of jfreechart has a bug with setting the backgroung for JPG images. See My Link or My Link.


                If you upgrade to 1.0.10 or higher it should be fixed.