Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSF Fileupload not working in Payara Micro #1456

Closed
jplette opened this issue Mar 13, 2017 · 3 comments
Closed

JSF Fileupload not working in Payara Micro #1456

jplette opened this issue Mar 13, 2017 · 3 comments
Assignees
Labels
Type: Bug Label issue as a bug defect
Milestone

Comments

@jplette
Copy link

jplette commented Mar 13, 2017

Description


JSF File-Upload not working in payara-micro-4.1.1.171.0.1. Tested with Primefaces 6.0 or Omnifaces 2.6.1

Expected Outcome

When using the Primefaces file-upload, the FileUploadEvent should be fired.
Using the Omnifaces inputFile should not result in a javascript error in jsf.js
After uploading a file with these components should make the uploaded byte[] available in jsf managed bean.

Current Outcome

The file upload components not working in payara-micro-4.1.1.171.0.1. The same application works on Payara Server 171 Full with no problems.

Steps to reproduce (Only for bug reports)

Run the uploaded sample app. (Maven)

Samples

See the demo from primefaces:
https://www.primefaces.org/showcase/ui/file/upload/single.xhtml

or omnifaces demo:
http://showcase.omnifaces.org/components/inputFile

Demo application (Maven)
testapp.zip

Context (Optional)

Environment

  • Payara Version: payara-micro-4.1.1.171.0.1
  • Edition: Micro
  • JDK Version:
  • Operating System: Windows
@michaelranaldo michaelranaldo added 1:Investigating Type: Bug Label issue as a bug defect Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev and removed 1:Investigating labels Mar 22, 2017
@michaelranaldo
Copy link
Contributor

Created internal issue PAYARA-1537

@michaelranaldo michaelranaldo added 3:DevInProgress and removed Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev labels Apr 26, 2017
@arjantijms
Copy link
Contributor

The problem was caused by Payara Full using the org.jvnet.hk2.osgiadapter.OSGiModuleImpl$4 class loader (the inner class returned by OSGiModuleImpl#getClassLoader) while Payara Micro was using fish.payara.micro.boot.loader.ExplodedURLClassloader to load classes.

WarScanner adds classes to be scanned from annotations that are found in web.xml (e.g. for a Servlet declaration), but first checks if the class is loadable. It does this latter check by constructing the .class resource name and calling ClassLoader#getResource.

The problem now was that it prepended a slash ('/') to this resource name, which is invalided as per the contract for ClassLoader#getResource (it's typically used for Class#getResource though).

Seemingly the OSGi class loader accepted the initial slash anyway, while the URL class loader fails to find the class (it checks if an entry with that exact name appears in a jar file, but the names in a jar file seemingly don't have the slash prepended).

@lprimak
Copy link
Contributor

lprimak commented May 1, 2017

Fixed by #1568

@lprimak lprimak closed this as completed May 1, 2017
@mikecroft mikecroft added this to the Payara 172 milestone Jul 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Label issue as a bug defect
Projects
None yet
Development

No branches or pull requests

6 participants