fileupload + WebLogic Portal
njanken Jul 13, 2009 8:21 PMWe are using richfaces with WebLogic Portal, and have been mostly successful. However, we are trying to use the richfaces fileupload component and are getting an error.
The relevant part of the stacktrace is:
Caused by: java.lang.IllegalAccessException: Class org.richfaces.renderkit.FileUploadRendererBase can not access a member of class com.bea.portlet.container.PortletSessionImpl with modifiers "public" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65) at java.lang.reflect.Method.invoke(Method.java:588) at org.richfaces.renderkit.FileUploadRendererBase.getSessionId(FileUploadRendererBase.java:731) at org.richfaces.renderkit.html.FileUploadRenderer.doEncodeEnd(FileUploadRenderer.java:379) at org.richfaces.renderkit.html.FileUploadRenderer.doEncodeEnd(FileUploadRenderer.java:391) at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:829) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:894) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:890) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592) at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100) at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
I've looked at the RichFaces code where this exception is being thrown and it looks approximatly like the following:
Object session = context.getExternalContext().getSession(false); Class sessionClass = session.getClass(); Method getIdMethod = sesssionClass.getMethod("getId", new Class[0]);
The type of the class being retrieved from "context.getExternalContext().getSession(false)" is "com.bea.portlet.container.PortletSessionImpl" which does not have a default constructor. Therefore, I believe when "new Class[0]" is called, the object cannot be constructed and the "getId" cannot be retrieved, thus resulting in the exception
Is there a way around this?