Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 4.1
-
Fix Version/s: 4.1.1
-
Component/s: ACE-Components
-
Labels:None
-
Environment:Liferay Portal 7 / Tomcat 8
-
Assignee Priority:P1
Description
- Download and install [Liferay Portal 7.0.0-B7|http://sourceforge.net/projects/lportal/files/Liferay%20Portal/7.0.0%20B7/] (scheduled to be released this week -- B7 includes Tomcat 8 whereas B6 includes Tomcat 7)
- Copy the icefaces4-portlet-4.0.0-SNAPSHOT.war attachment from
- Add a new portal page named ICE4
- Click on the "Menu" icon in the UPPER LEFT corner
- Click on the "+" icon that has title "Add Page"
- Type "ICE4" for the name and press enter/return
- Add the ICEfaces4 portlet to a portal page
- Click on the "+" icon in the UPPER RIGHT conrer
- Click on "Applications" in the accordion menu
- Click on "Sample"
- Click the "Add" link to the right of "ICEfaces4"
- Reload the ICE4 page
- Attempt to upload a file and click Submit
If the bug is fixed, then the file will upload properly.
Otherwise, if the bug still exists, then this error message will be rendered above the portlet: "The server request has failed because there was a problem reading the multi-part request"
In the debugger, I found that the try/catch block at line#151 of FileEntryUpload.afterPhase(PhaseEvent) was getting hit:
{code}
FacesMessage ajaxResponse = FileEntryStatuses.PROBLEM_READING_MULTIPART.getFacesMessage(facesContext, (UIComponent)null, (FileInfo)null);
facesContext.addMessage((String)null, ajaxResponse);
if(facesContext.isProjectStage(ProjectStage.Development)) {
log.log(Level.WARNING, "Problem reading multi-part form upload, likely due to a file upload being cut off from the client losing their network connection or closing their browser tab or window.", var30);
}
And the exception in the debugger is:
{noformat}
java.lang.ClassCastException: com.liferay.faces.bridge.filter.liferay.internal.ResourceRequestBridgeLiferayImpl cannot be cast to javax.servlet.http.HttpServletRequest
{noformat}
It is my best guess that this is happening in Liferay 7 (but not Liferay 6.2) because Liferay 7 is bundled with Tomcat 8, and this section of code in FileEntryUpload.java is executing because Class.forName("javax.servlet.http.Part") returned a non-null value, indicating Servlet 3.x (Tomcat 8) instead of Servlet 2.5 (Tomcat 7).
-
Hide
- icefaces4-portlet-4.0.0-SNAPSHOT.war
- 11.00 MB
- Neil Griffin
-
- META-INF/MANIFEST.MF 0.3 kB
- META-INF/context.xml 0.1 kB
- WEB-INF/.../ApplicantBackingBean.class 9 kB
- WEB-INF/classes/.../ApplicantModelBean.class 4 kB
- WEB-INF/classes/.../ApplicantViewBean.class 1 kB
- WEB-INF/classes/.../bean/ListModelBean.class 5 kB
- WEB-INF/.../PortletPreferencesBackingBean.class 4 kB
- WEB-INF/classes/com/.../demos/dto/City.class 1 kB
- WEB-INF/classes/com/.../dto/Province.class 0.9 kB
- WEB-INF/.../UploadedFileWrapper.class 5 kB
- WEB-INF/classes/i18n.properties 1 kB
- WEB-INF/classes/i18nFaces.properties 0.1 kB
- WEB-INF/classes/log4j.properties 2 kB
- WEB-INF/classes/META-INF/apache-2.0.txt 11 kB
- WEB-INF/classes/.../cddl-1.0-gpl-2.0-cp.txt 44 kB
- WEB-INF/classes/META-INF/cddl-1.0.txt 16 kB
- WEB-INF/classes/META-INF/NOTICE.txt 0.6 kB
- WEB-INF/classes/META-INF/THIRD-PARTY.txt 0.7 kB
- WEB-INF/faces-config.xml 1 kB
- WEB-INF/lib/icefaces-4.0.0.jar 676 kB
- WEB-INF/lib/icefaces-ace-4.0.0.jar 5.82 MB
- WEB-INF/lib/jsf-api-2.2.13.jar 680 kB
- WEB-INF/lib/jsf-impl-2.2.13.jar 2.30 MB
- WEB-INF/.../liferay-faces-alloy-3.0.0-SNAPSHOT.jar 573 kB
- WEB-INF/.../liferay-faces-bridge-api-4.0.0-SNAPSHOT.jar 94 kB
- WEB-INF/.../liferay-faces-bridge-ext-5.0.0-SNAPSHOT.jar 125 kB
- WEB-INF/.../liferay-faces-bridge-impl-4.0.0-SNAPSHOT.jar 451 kB
- WEB-INF/.../liferay-faces-util-3.0.0-SNAPSHOT.jar 276 kB
- WEB-INF/liferay-display.xml 0.2 kB
- WEB-INF/liferay-plugin-package.properties 0.4 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Hi Mircea, 7.0.0-B7 is scheduled to be released this week. Hopefully you will see the link working by Friday. If not then early next week. Thanks, Neil
The problem you're seeing in Tomcat 8 might be caused by the misconfiguration of the web.xml file. The file upload needs to have the servlet container run in Servlet 3.0 mode which is triggered by specifying the correct version and namespace:
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> ......
Also the FacesServlet will need to have the multipart configuration specified:
<servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <!-- Add the multi-part entry below to enable Servlet 3 servers to support ace:fileEntry --> <multipart-config> <max-file-size>52428800</max-file-size> <max-request-size>52428800</max-request-size> <file-size-threshold>0</file-size-threshold> </multipart-config> </servlet>
Hopefully this will help.
The icefaces4-portlet-4.0.0-SNAPSHOT.war attachment from ICE-10951 already had <web-app version="3.0" ... etc ... >
However it did not have the <multipart-config> on the FacesServlet.
When I added the <multipart-config> and re-deployed, I got a new exception:
Cannot add the same component twice: _1_WAR_icefaces4portlet_INSTANCE_JRmpyc6WyFKT_:javascript_runner
FYI, Liferay Portal 7.0.0-B7 has been released.
I just noticed that Liferay Portal 7.0.0-B7 was released with Tomcat 7 rather than Tomcat 8. I'll look into this and report back.
I confirmed that it was indeed released with Tomcat 8. Please give it a try when you can. Thanks.
I cannot run icefaces4-portlet-4.0.0-SNAPSHOT.war on Liferay Portal 7.0.0-B7. I get this exception:
13:11:45,699 ERROR [http-nio-8080-exec-19][render_portlet_jsp:131] null
java.lang.NoClassDefFoundError: com/liferay/portal/theme/ThemeDisplay
at com.liferay.faces.bridge.context.liferay.internal.BridgePortalContextLiferayCompatImpl.isLiferayNamespacingParameters(BridgePortalContextLiferayCompatImpl.java:47)
at com.liferay.faces.bridge.context.liferay.internal.BridgePortalContextLiferayImpl.<init>(BridgePortalContextLiferayImpl.java:91)
at com.liferay.faces.bridge.filter.liferay.internal.BridgePortletRequestFactoryLiferayImpl.getRenderRequest(BridgePortletRequestFactoryLiferayImpl.java:73)
at com.liferay.faces.bridge.internal.BridgePhaseRenderImpl.<init>(BridgePhaseRenderImpl.java:75)
at com.liferay.faces.bridge.internal.BridgePhaseFactoryImpl.getBridgeRenderPhase(BridgePhaseFactoryImpl.java:54)
at com.liferay.faces.bridge.internal.BridgeImpl.doFacesRequest(BridgeImpl.java:129)
at javax.portlet.faces.GenericFacesPortlet.doView(GenericFacesPortlet.java:263)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:359)
at javax.portlet.faces.GenericFacesPortlet.doDispatch(GenericFacesPortlet.java:212)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
at com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:57)
at com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:113)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:115)
Attached is an updated version of icefaces4-portlet-4.0.0-SNAPSHOT.war that contains the <multipart-config> in web.xml and the correct liferay-faces-bridge-ext.jar for Liferay 7.
The issue is caused by the refactoring in Liferay code base. com.liferay.portal.util.PortalUtil and com.liferay.portal.theme.ThemeDisplay classes that EnvUtils loos up are located at com.liferay.portal.kernel.util.PortalUtil and com.liferay.portal.kernel.theme.ThemeDisplay.
The lookup code in org.icefaces.util.EnvUtils will now fallback into using com.liferay.portal.kernel package as root package when running in Liferay 7.*.
Successfully tested on Liferay Portal 7.0-B7, Liferay Portal 6.2.5, and Pluto 2.0.2 using Liferay Faces Bridge 4.0.0-SNAPSHOT (new version scheme).
Verified ICEfaces 4.1.1 Jenkins Build #6, showcase > fileEntry demos on Tomcat8.0.21/ IE11.
I am not able to download Liferay Portal 7.0.0-B7. When accessing the provided link the browser is redirected to https://sourceforge.net/projects/lportal/files/ .