12 Replies Latest reply on Apr 26, 2008 10:51 PM by Piotr Porzucek

    seam and richfaces 3.2.0

    Ale Fred Newbie

      I've just installed richfaces 3.2.0 and everything seems to work fine except something rthat mightb be elated to an incorrect script/resource loading.


      the rich:effect coauses any effect and the add button on the rich:fileUpload does nothing when clicked. It sems that js events are not correctly handled.


      Does anybody have  suggestions?


      Thanks.



        • 1. Re: seam and richfaces 3.2.0
          Ale Fred Newbie

          I solved. Another script was breaking the richfaces event handling.
          But know it seems that the listener can't be invoked.
          This is what i get :


          |Caused by: javax.faces.el.MethodNotFoundException: /test.xhtml @17,112 fileUploadListener="#{uploadHandler.fil
          eUploadListener}": Method not found: mk.common.UploadHandler@1af0d15.fileUploadListener(org.richfaces.event.Up
          loadEvent)
                  at ||com.sun.facelets.el.LegacyMeth||odBinding.invoke(LegacyMethodBinding.java:71)
                  at org.richfaces.component.UIFileUpload.broadcast(UIFileUpload.java:160)
                  at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
                  at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:289)
                  at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
                  at org.ajax4jsf.component.AjaxViewRoot.processDecodes(AjaxViewRoot.java:404)
                  at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:101)
                  at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                  ... 41 more|



          this is my component's code :



          import java.io.File;
          import java.io.IOException;
          
          import org.jboss.seam.annotations.Logger;
          import org.jboss.seam.annotations.Name;
          import org.jboss.seam.log.Log;
          
          
          import org.richfaces.model.UploadItem;
          
          @Name("uploadHandler")
          public class UploadHandler {
               @Logger
               Log log;
               
               public void fileUploadListener(org.richfaces.event.UploadEvent event) {
                    if(event==null){
                         log.debug("null upload event");
                         return;
                    }
                  UploadItem item = event.getUploadItem();
          
                  String name = "unnamed_attachment";
                  byte[] data = item.getData();
                  
                  if (item.isFile()) {
                      name = item.getFileName();
                      data =  item.getData();
                      File file = item.getFile();
                      log.debug(
                                     "uploaded "+name+
                                     " - length= "+( (data==null)?0:data.length) +
                                     " tmpFile="+file.getAbsoluteFile()
                                     );
                  }
              }
          }
          



          and that's the page 



          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml"
               xmlns:s="http://jboss.com/products/seam/taglib"
               xmlns:ui="http://java.sun.com/jsf/facelets"
               xmlns:f="http://java.sun.com/jsf/core"
               xmlns:h="http://java.sun.com/jsf/html"
               xmlns:c="http://java.sun.com/jstl/core"
               xmlns:rich="http://richfaces.org/rich" >
               <HEAD>
               <title>test fileupload</title>
               </HEAD>
          
               <body>
                    <h:form>
                         <rich:fileUpload id="upload"  fileUploadListener="#{uploadHandler.fileUploadListener}" maxFilesQuantity="2">
                              <f:facet name="label">
                                   <h:outputText value="{_KB}KB from {KB}KB uploaded --- {mm}:{ss}" />
                              </f:facet>
                         </rich:fileUpload>
                    </h:form>
               </body>
               
          </html>



          If i remove the event parameter from the listener methd it gets recognized and the page works, but i obviously have no access to anything.


          Thanks.




          • 2. Re: seam and richfaces 3.2.0
            Ale Fred Newbie

            is anybody able to post a src/config example of rich:fileUpload working with seam?


            thanks

            • 3. Re: seam and richfaces 3.2.0
              mars1412 Apprentice

              look at seam_multipart_filter in this doc

              • 4. Re: seam and richfaces 3.2.0
                Ale Fred Newbie

                i added that :



                <web:multipart-filter url-pattern="*.seam" max-request-size="2097152" create-temp-files="true" disabled="true" />



                but the problem persists.

                • 6. Re: seam and richfaces 3.2.0
                  Ale Fred Newbie

                  the problem was caused by  duplicate richfaces jars.
                  now everything goes fine ,
                  Thanks.

                  • 7. Re: seam and richfaces 3.2.0
                    john hedden Newbie

                    Thanks for the heads up about the jars.  Had the same issue and your suggestion seemed to work.



                    Now I am getting an interesting error:



                    Servlet.service() for servlet default threw exception
                    java.lang.NullPointerException: Colors cannot be null
                         at java.awt.GradientPaint.<init>(GradientPaint.java:71)
                         at org.richfaces.renderkit.html.images.ProgressBarAnimatedBg.paint(ProgressBarAnimatedBg.java:92)
                         at org.ajax4jsf.resource.AnimationResource.send(AnimationResource.java:80)
                         at org.ajax4jsf.resource.ResourceLifecycle.sendResource(ResourceLifecycle.java:221)
                         at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:157)
                         at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceService.java:333)
                         at org.ajax4jsf.cache.LRUMapCache.load(LRUMapCache.java:116)
                         at org.ajax4jsf.cache.LRUMapCache.get(LRUMapCache.java:87)
                         at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:195)
                         at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
                         at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:260)
                         at org.ajax4jsf.Filter.doFilter(Filter.java:175)
                         at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
                         at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                         at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
                         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
                         at java.lang.Thread.run(Thread.java:613)
                    19:42:54,950 INFO  [OrderManagerAction] file uploaded 'Coley and Daddy.jpg' : 'Coley and Daddy.jpg'



                    This has something to do with the Progress Bar.  Ideas anyone?  Everything processes properly. I guess its a look/feel thing.  Not too concerned about it but Im curious.

                    • 8. Re: seam and richfaces 3.2.0
                      john hedden Newbie

                      Its in JIRA:



                      http://jira.jboss.org/jira/browse/RF-2751;jsessionid=D6C03D18C0FF5C31ACD751606ADD70AC?page=worklog


                      • 9. Re: seam and richfaces 3.2.0
                        Ale Fred Newbie

                        the issue results resolved.
                        Do i have to get the sources and do a build or is there a nightly build somewhere?


                        Thanks.

                        • 10. Re: seam and richfaces 3.2.0
                          scott duke Novice

                          I was having the same problems using richfaces-ui-3.2.0.GA and the error was a show stopper. After reading that it was fixed for 3.2.0, I then downloaded the richfaces-ui-3.2.0.SR1. It kept it from redirecting the page to debug, but I am still seeing the error in the server log.

                          • 11. Re: seam and richfaces 3.2.0
                            scott duke Novice

                            Ignore my last sentence about still receiving the error. It was due to having both versions of the jar file. Once I removed the GA version, it is works without and errors.

                            • 12. Re: seam and richfaces 3.2.0
                              Piotr Porzucek Newbie

                              Hi,


                              Could give explain a bit more precisely how you got rid of the Method not found problem? I've encountered it too... I'm using Seam 2.0.0 GA, RichFaces 3.2.0.SR1


                              Regards