Payara 5.xxx Uploading Files - fileUploadListener never triggered

259 views
Skip to first unread message

Ondro Mihályi

unread,
Jul 16, 2018, 6:54:45 AM7/16/18
to ChungHuan Chang, Payara Forum
Hi,

If your listener isn't triggered at all, you're facing a completely different issue. Angel's issue was that the listener was called but received a null value.

In your case, I think a problem is in your application. Can you give more details? Does it work on Payara 4.181 or older?

Ondro

2018-07-16 10:57 GMT+02:00 ChungHuan Chang <holybi...@gmail.com>:
Hi Ondro and Angel Avila,

  I am facing the same problem as Angel before, fileUploadListener just never be triggered.
  Now I've turned HTTP/2 off on my Payara 5.182, also aligned my PrimeFaces from 5.2 to 6.1, but the issue is still there.
  Could you please suggest anything that I shall look into?

  Thank you in advance


Angel Avila於 2018年7月6日星期五 UTC+8上午12時30分04秒寫道:
Yes !! That's the solution ! Disabling HTTP/2 Works like a charm. Thank you very much.

El jueves, 5 de julio de 2018, 2:14:33 (UTC-5), Ondro Mihályi escribió:
Maybe it's because of HTTP/2? Try disabling it in the http listener.

Ondro

Dňa st 4. 7. 2018, 20:33 Angel Avila <angel.r.a...@gmail.com> napísal(a):

Hi !

My application uses PrimeFaces 6.1, when I try to upload a file, the backing bean is getting a null value, this issue occurs with versions 181 and 182 of Payara 5. However, if I downgrade to Payara 4.1.2.181, files are uploaded correctly? Is there any trick to make this work?

The backing bean is set as SessionScope, the PrimeFaces component is declared in the xhtml as follows:

The get method for the value attribute:


And this is the method for the fileUploadListener attribute:




The previous code Works ok, on Payara 4.1.2.181. Any clue?


--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/3e8ee5be-b31f-4073-80ac-a2d42b2a91d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum+unsubscribe@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/57f7ee96-ca38-4caf-b7b4-e834aa042625%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

ChungHuan Chang

unread,
Jul 16, 2018, 8:05:58 AM7/16/18
to ondrej....@gmail.com, payara...@googlegroups.com
Hi Ondro,

Thank you for your prompt reply.
My application worked well with Payara 4.1.171_1 and 162, but haven't had a chance to try 4.1.181 yet.
We deployed 5.182 just a few days ago for our migration evaluation and noticed this issue today.

I can post you the codes of my pages when I get into office on tomorrow.

Ondro Mihályi <ondrej....@gmail.com> 於 2018年7月16日 週一 下午6:54寫道:

ChungHuan Chang

unread,
Jul 16, 2018, 11:38:54 PM7/16/18
to Payara Forum
Hi Ondro,

  Update: I tried the same code with Payara 4.1.2.181, it works correctly as other previous builds like 171_1 or 162.

here is my div in XHTML

====
                <div>
                    <p:fileUpload fileUploadListener="#{myBean.handleFileUpload}"
                                  mode="advanced"
                                  dragDropSupport="false"
                                  multiple="true"
                                  update="messages"
                                  sizeLimit="100000"
                                  fileLimit="50"
                                  allowTypes="/(pc|sp)(-)([0-9]+)(-)(body|header)(\.|\/)(html)$/"
                                  invalidFileMessage="Invalid. Verify that the filename matches the required format"
                                  />
                </div>
====

And here is the code of handleFileUpload, although I think it is not related as this function was never called in Payara 5.182
====
    public void handleFileUpload(FileUploadEvent event) throws IOException {
        FacesMessage message = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
        FacesContext.getCurrentInstance().addMessage(null, message);
        UploadedFile uploadedFile = event.getFile();
        String[] properties = uploadedFile.getFileName().split("-");
        String uploadPath = "";
        if (properties.length == MAX_PROPERTIES) {
            String devicePrefix = properties[0];
            String cpnCode = properties[1];
            String fileName = properties[2];
            uploadPath = StringUtility.concatenate(this.getUploadRootPath(), devicePrefix, this.path, cpnCode);
            super.uploadFile(uploadPath, fileName, uploadedFile.getInputstream());
        }
    }
====

  Now I am reading https://stackoverflow.com/questions/8875818/how-to-use-primefaces-pfileupload-listener-method-is-never-invoked-or-uploaded to see any clue.

ChungHuan Chang於 2018年7月16日星期一 UTC+8下午8時05分58秒寫道:
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages