13 Replies Latest reply on Jun 15, 2018 6:58 AM by bizen12

    Allowflash is not working, Wildfly 9x

    bizen12

      Hello,

      I am using
      Wirefly 9x on my proyect. I use richfaces and am trying to enable multiple upload enabling flash but error ocurres when I do that. I tried to debug but the listener is not even called. When I disable flash I can upload files but not multiple.

      The XML code is

       

      <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:rich="http://richfaces.org/rich"

      xmlns:a4j="http://richfaces.org/a4j"

      xmlns:c="http://java.sun.com/jstl/core" template="template.xhtml">

       

      And:

       

       

      <rich:fileUpload style="width:500px;

       

      height:225px;"

       

      fileUploadListener="#{fileUpload.listener}" id="upload"

      listHeight="225" listWidth="500" addControlLabel="Examinar"

      uploadControlLabel="Cargar" clearControlLabel="" acceptedTypes="zip" allowFlash="true"

       

      maxFilesQuantity="20" onerror="Richfaces.showModalPanel('pnl');"

      onfileuploadcomplete="checkError();">


      <a4j:support event="onclear" reRender="upload"/>

       

      </rich:fileUpload>

       

       

       

       

      The libraries I am using are:

       

       

       

      Thanks a lot.

        • 1. Re: Allowflash is not working, Wildfly 9x
          michpetrov

          Well, what is the error? That's the most important part.

           

          Regardless Flash as a technology has been deprecated so that might be your browser doing it, also why are you mixing RichFaces 3.3.3 and 4.5.17?

          • 2. Re: Allowflash is not working, Wildfly 9x
            bizen12

            Hello

            The error is that I get a Windows called Exception that says the file can't be uploaded. Then the progress upload bar changes for a message that says "Transfer error occurred". The problema is that java classes are not called so I can't debug in Eclipse or get any extra information.

             

            About 2 question. I am using flash as I want to use multiple file upload, wich is the alternative?. I am migrating from JBoss v5.0 to Wildfly 9x and I am getting a lot of errors. Libraries are the same, maybe that's the error. What configuration do you recommend to me? I think this library you told me 4.5.17 is doing nothing, I added it as a test to solve this issue, but on JBoss v5.0 I don´t have it.

             

            Thanks un lot.

            • 3. Re: Allowflash is not working, Wildfly 9x
              michpetrov

              Have you checked the browser console for errors? Or try a different browser. I have no idea how the Flash module works so unfortunately I can't help you there.

               

              RichFaces 3 was released 8 years ago, so I'd recommend migrating to something newer but it's not going to be easy. Even migrating to RichFaces 4 is somewhat difficult and since it's no longer being developed you're better off switching to Primefaces or something.

              • 4. Re: Allowflash is not working, Wildfly 9x
                bizen12

                Yes, I have checked it. And I have tested in 3 browsers.

                Maybe posting this in Wildfly forum's section can find anybody who has same question.

                 

                Because isn't there any other option to enable multiple upload?

                 

                Thanks

                • 5. Re: Allowflash is not working, Wildfly 9x
                  michpetrov

                  If the upload isn't working in the browser it's probably not a Wildfly problem.

                  • 6. Re: Allowflash is not working, Wildfly 9x
                    bizen12

                    So where can the error be? I thought was in Wildfly as in Jboss v5.0 worked with the same code.

                    • 7. Re: Allowflash is not working, Wildfly 9x
                      michpetrov

                      Have you checked the server logs? There must be some error message somewhere, besides what you see on the page. I guess it might be servlet version in which case you can't do anything.

                      • 8. Re: Allowflash is not working, Wildfly 9x
                        bizen12

                        Hello

                        finally we found the error. There is a file inside a library called FileUpload.js that generates a URL when u do the post in the upload process. This URL contains first ; and then & provocating the error as Wildfly doesnt accept it. We have to change the first ; for & and the & for a ?  and it would work as this kind of URL wildfly accepts it. Other option is try to configure Wildfly to allow this kind of URL but I don't know how to do it. Do you recommend to modify the library or try to configure wildfly?

                         

                        Thanks

                        • 9. Re: Allowflash is not working, Wildfly 9x
                          michpetrov

                          I don't know enough about WildFly settings I'm afraid, modifying the JavaScript file shouldn't be difficult.

                          • 10. Re: Allowflash is not working, Wildfly 9x
                            bizen12

                            I modified the .js that is inside the .jar library but still doesnt work. In order to do that I opened it with winrar and use notepad++ to modify the .js. I don't know if I have to do anything else as its first time I do that.

                            People told me that when you have a .js inside a library and you compile it you have .class that have to modify too, but I dont find the FileUpload.class there. Dont't know how to make it work properly

                            • 11. Re: Allowflash is not working, Wildfly 9x
                              michpetrov

                              Have you rebuilt your app and checked if it uses the new code? JavaScript files are not compiled into .class, that's Java.

                              • 12. Re: Allowflash is not working, Wildfly 9x
                                bizen12

                                Yes, the problem is that if I open the .js in eclipse I see changes are done but when I launch it on local and I do the fileupload I see the error and the old URL again.

                                Also if I generate the war, I see the changes dones but when I deploy on a server and try to upload happens the same as in local.

                                • 13. Re: Allowflash is not working, Wildfly 9x
                                  bizen12

                                  Hi,

                                  finally found the solution.

                                  I modified fileupload.js inside the library Richfaces 3.3.3 ui as said in Modify a jar library in Wildfly 9 or configure WildFly . After that I had the problem the wildfly didn't take library despite I put it on the buildpath and on lib foder.

                                  The solution was in wildfly folder. There is a folder inside wildfly where there are all libraries and there was the old one. I changed it and worked.