I am building JSF JSR168 portlet using RAD 7.0 and deploying it in Websphere Portal 6.0.1.
Read in blogs that ?hx:fileUpload? is not supported in Portal environments. Did anyone used this tag in Portlets? Suggestions are welcomed
Full stack trace is below. Note: I have icu4j_3_4_1.jar, jsf-ibm.jar, jsf-impl-messages.jar, jsf-portletbridge.jar bundled in the Portlet war.
EventQueueMan E com.ibm.wps.pe.pc.std.event.EventQueueManager processEventLoop EJPPG1122E: An error occurred during portlet event processing.
javax.portlet.PortletException: java.lang.ClassCastException: com.ibm.faces.portlet.httpbridge.ActionResponseWrapper
at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:251)
at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:168)
at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.action(PortletInvokerImpl.java:82)
at com.ibm.wps.pe.pc.std.event.ActionEvent.execute(ActionEvent.java:114)
at com.ibm.wps.pe.pc.std.event.EventQueueManager.processEventLoop(EventQueueManager.java:86)
at com.ibm.wps.pe.pc.std.PortletContainerImpl.performEvents(PortletContainerImpl.java:168)
at com.ibm.wps.pe.pc.PortletContainerImpl.performEvents(PortletContainerImpl.java:243)
at com.ibm.wps.engine.phases.WPActionPhase.processPortlets(WPActionPhase.java:1006)
at com.ibm.wps.engine.phases.WPActionPhase.execute(WPActionPhase.java:497)
at com.ibm.wps.state.phases.AbstractActionPhase.next(AbstractActionPhase.java:130)
at com.ibm.wps.engine.Servlet.callPortal(Servlet.java:768)
at com.ibm.wps.engine.Servlet.doGet(Servlet.java:609)
at com.ibm.wps.engine.Servlet.doPost(Servlet.java:794)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1572)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1521)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:136)
at com.ibm.wps.state.filter.StateCleanup.doFilter(StateCleanup.java:86)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
at com.ibm.wps.mappingurl.impl.URLAnalyzer.doFilter(URLAnalyzer.java:263)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:759)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3071)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:236)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:210)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1958)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:98)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Caused by: java.lang.ClassCastException: com.ibm.faces.portlet.httpbridge.ActionResponseWrapper
at com.ibm.faces.portlet.httpbridge.PortletExternalContextWrapper.encodeNamespace(PortletExternalContextWrapper.java:116)
at com.ibm.faces.portlet.UIPortletViewRoot.getClientId(UIPortletViewRoot.java:47)
at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:93)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
at com.ibm.faces.portlet.FacesPortlet.processAction(FacesPortlet.java:158)
at com.ibm.wps.pe.pc.std.cmpf.impl.PortletFilterChainImpl.processAction(PortletFilterChainImpl.java:104)
at com.ibm.wps.propertybroker.standard.filter.PropertyBrokerActionFilter.processAction(PropertyBrokerActionFilter.java:261)
at com.ibm.wps.pe.pc.std.cmpf.impl.PortletFilterChainImpl.processAction(PortletFilterChainImpl.java:95)
at com.ibm.wps.pe.pc.std.invoker.impl.PortletServlet.dispatch(PortletServlet.java:147)
at com.ibm.wps.pe.pc.std.invoker.impl.PortletServlet.doPost(PortletServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at com.ibm.wps.pe.pc.std.cache.CacheablePortlet.service(CacheablePortlet.java:393)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1572)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:762)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:633)
at com.ibm.wps.pe.om.definition.impl.ServletDefinitionImpl$RDWrapper.include(ServletDefinitionImpl.java:419)
at com.ibm.wps.pe.pc.std.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:204)
... 38 more
I got it working. Created separate project and built the Portlet again using hx: fileUpload. I am not sure what did I do wrong in the previous project. See below for the code which was giving the ClassCastException.
<f:view><hx:scriptCollector id="scriptCollector1">
<p>Place content here.</p>
<h:form id="form1" styleClass="form">
<hx:fileupload id="fileupload1" styleClass="fileupload" value="#{file.fileData}" accept="application/msword,application/pdf,text/plain,image/jpeg,image/gif" >
<hx:fileProp name="fileName" />
<hx:fileProp name="contentType" />
</hx:fileupload>
<hx:commandExButton type="submit" value="Submit" id="button1" action="#{file.upload}"
styleClass="commandExButton"></hx:commandExButton>
</h:form>
</hx:scriptCollector>
</f:view>
private byte[] fileData=null;
public byte[] getFileData() {
return fileData;
}
public void setFileData(byte[] fileData) {
this.fileData = fileData;
}
public void upload()
{
System.out.println("Inside upload");
if(fileData!=null)
{
System.out.println("file size "+fileData.length);
}
}
In RAD 7.0 help, it is mentioned that hx:graphicImageEx (for binary data download) not supported for Faces Portlets. Is there any plan to include in future RAD releases.
Cheers
Elan
I can't really comment on the future plans in the forum.