You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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).
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
The text was updated successfully, but these errors were encountered: