Hi Sunil,
First of all, I don't think your implementation of the
PortletResourceURLFactoryImpl is going to work.
Right now, you simply (and only) return a Portlet RenderURL.
The purpose of the PortletResourceURLFactory though is to (somehow) return a *specific* type of RenderURL which allows
direct access to the (Wicket) portlet *and* allow full control over the response when invoked.
For each portal container this will be somewhat different (if properly supported) and proprietary until they support
JSR_286/Portlet 2.0 which will provide this functionality out-of-the-box.
Anyway, to get this working on Websphere 6.1, you'll need to dive into the Websphere specific api's and see how to do
this (and/or ask help on Websphere specific forums for instance). I can't help you out with that as I'm not using
Websphere Portal myself.
Concerning the error message your encounter: I notice you're using
WicketServlet, not WicketFilter in web.xml.
I didn't realize people still use/depend on WicketServlet (for 1.3.x and higher) and I didn't really test against that
for the Portlet support!
Not sure if that's part of this particular problem here, but (right now) you do need to use the WicketFilter. Using the
WicketServlet to invoke the WicketFilter bypasses the WicketFilter.doFilter method and that one *is* required to be
called for the Wicket Portlet support to be able to work.
Finally, it looks like you are encountering a *bug* in Websphere Portal indeed.
Portlet API 1.0, section PLT.16.3.3 explicitly says that for included Servlets/JSP's the
HttpServletRequest.setCharacterEncoding() method call "must do no operation". Throwing an exception is definitely not a
"no operation".
Note: the stack trace shows the exception is thrown from within Websphere PortletRequestImpl, not a HttpServletRequest
object, but the call made from within WicketFilter *is* against the provided (wrapped HttpServletRequest which seems to
be delegating directly to PortletRequestImpl.setCharacterEncoding().
Regards,
Ate
suneeelu wrote:
Hi all,
Iam devleoping a Spring wicket portlet application on Websphere 6.1 server.
I have followed the steps you mentioned in the wiki as given in the below
url.
http://cwiki.apache.org/WICKET/portal-howto.html portla how to
I have created a simple ServletContextProviderImpl and
PortletResourceURLFactoryImpl classes which Iam attaching here. not sure
whether the implementation classes work fine.
Iam attaching the web.xml and portlet.xml, applicationContext.xml files and
also the implementation classes of my application.
when I start the server all the spring beans are getting created and also
the wicket listeners are started.
but when I try to access the portlet Iam getting the below error message.
Iam not sure whether this is wicket portlet issue or IBM websphere related
issue.
[12-6-08 10:24:01:210 CEST] 0000002a ServletWrappe E SRVE0068E: Uncaught
exception thrown in one of the service methods of the servlet:
SpringExample. Exception thrown : java.lang.IllegalStateException: This
method must not be called after the HTTP-Body was accessed !
at
com.ibm.ws.portletcontainer.core.impl.PortletRequestImpl.setCharacterEncoding(PortletRequestImpl.java:914)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:294)
at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:766)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:674)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:639)
at
com.ibm.ws.portletcontainer.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:79)
at
org.apache.wicket.protocol.http.portlet.WicketPortlet.processRequest(WicketPortlet.java:519)
at
org.apache.wicket.protocol.http.portlet.WicketPortlet.doView(WicketPortlet.java:416)
at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:235)
at javax.portlet.GenericPortlet.render(GenericPortlet.java:163)
at
com.ibm.ws.portletcontainer.core.PortletServlet.doDispatch(PortletServlet.java:344)
at
com.ibm.ws.portletcontainer.core.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:114)
at
com.ibm.isclite.container.collaborator.PortletServletCollaborator.doRender(PortletServletCollaborator.java:68)
at
com.ibm.ws.portletcontainer.core.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:105)
at
com.ibm.ws.portletcontainer.rrd.RRDServerPortletServletCollaborator.doRender(RRDServerPortletServletCollaborator.java:123)
at
com.ibm.ws.portletcontainer.core.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:105)
at
com.ibm.ws.portletcontainer.cache.CacheCollaborator.doRender(CacheCollaborator.java:84)
at
com.ibm.ws.portletcontainer.core.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:105)
at
com.ibm.ws.portletcontainer.core.PortletServlet.doDispatch(PortletServlet.java:240)
at
com.ibm.ws.portletcontainer.core.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:82)
at
com.ibm.isclite.container.collaborator.PortletServletCollaborator.doDispatch(PortletServletCollaborator.java:122)
at
com.ibm.ws.portletcontainer.core.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)
at
com.ibm.ws.portletcontainer.rrd.RRDServerPortletServletCollaborator.doDispatch(RRDServerPortletServletCollaborator.java:60)
at
com.ibm.ws.portletcontainer.core.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)
at
com.ibm.ws.portletcontainer.cache.CacheCollaborator.doDispatch(CacheCollaborator.java:66)
at
com.ibm.ws.portletcontainer.core.PortletServletCollaboratorChainImpl.doCollaborator(PortletServletCollaboratorChainImpl.java:74)
at
com.ibm.ws.portletcontainer.core.PortletServlet.dispatch(PortletServlet.java:183)
at
com.ibm.ws.portletcontainer.core.PortletServlet.doGet(PortletServlet.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:118)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:766)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:674)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:639)
at
com.ibm.ws.portletcontainer.invoker.impl.PortletInvokerImpl.invoke(PortletInvokerImpl.java:146)
at
com.ibm.ws.portletcontainer.invoker.impl.PortletInvokerCollaboratorChainImpl.doCollaborator(PortletInvokerCollaboratorChainImpl.java:70)
at
com.ibm.ws.portletcontainer.ext.PortletInvokerPerformanceCollaborator.invoke(PortletInvokerPerformanceCollaborator.java:247)
at
com.ibm.ws.portletcontainer.ext.PortletInvokerPerformanceCollaborator.doInvoke(PortletInvokerPerformanceCollaborator.java:93)
at
com.ibm.ws.portletcontainer.ext.PortletInvokerPerformanceCollaborator.invokePMI(PortletInvokerPerformanceCollaborator.java:137)
at
com.ibm.ws.portletcontainer.ext.PortletInvokerPerformanceCollaborator.doInvoke(PortletInvokerPerformanceCollaborator.java:83)
at
com.ibm.ws.portletcontainer.ext.PortletInvokerPerformanceCollaborator.doRender(PortletInvokerPerformanceCollaborator.java:68)
at
com.ibm.ws.portletcontainer.invoker.impl.PortletInvokerCollaboratorChainImpl.doCollaborator(PortletInvokerCollaboratorChainImpl.java:57)
at
com.ibm.ws.portletcontainer.invoker.impl.PortletInvokerImpl.render(PortletInvokerImpl.java:83)
at
com.ibm.ws.portletcontainer.PortletContainerImpl.doRender(PortletContainerImpl.java:115)
at
com.ibm.ws.portletcontainer.PortletContainerInvokerCollaboratorChainImpl.doCollaborator(PortletContainerInvokerCollaboratorChainImpl.java:79)
at
com.ibm.ws.portletcontainer.ext.ExtCollaborator.doRender(ExtCollaborator.java:70)
at
com.ibm.ws.portletcontainer.PortletContainerInvokerCollaboratorChainImpl.doCollaborator(PortletContainerInvokerCollaboratorChainImpl.java:67)
at
com.ibm.ws.portletcontainer.PortletContainerImpl.renderPortlet(PortletContainerImpl.java:87)
at
com.ibm.ws.portletcontainer.pcinvoker.PortletInvokerImpl$2.run(PortletInvokerImpl.java:81)
at
java.security.AccessController.doPrivileged(AccessController.java:242)
at
com.ibm.ws.portletcontainer.pcinvoker.PortletInvokerImpl.invokeRender(PortletInvokerImpl.java:79)
at
com.ibm.ws.portletcontainer.portletserving.PortletServingServlet.invokePortletRender(PortletServingServlet.java:254)
at
com.ibm.ws.portletcontainer.portletserving.PortletServingServlet.service(PortletServingServlet.java:131)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
at
com.ibm.ws.portletcontainer.portletserving.filter.PortletDocumentFilterContainer.doFilterEnd(PortletDocumentFilterContainer.java:60)
at
com.ibm.ws.portletcontainer.portletserving.filter.PortletDocumentFilterChain.doFilter(PortletDocumentFilterChain.java:55)
at
com.ibm.ws.portletcontainer.portletserving.filter.DefaultFilter.doFilter(DefaultFilter.java:58)
at
com.ibm.ws.portletcontainer.portletserving.filter.PortletDocumentFilterChain.doFilter(PortletDocumentFilterChain.java:49)
at sample.PortletCssFilter.doFilter(PortletCssFilter.java:85)
at
com.ibm.ws.portletcontainer.portletserving.filter.PortletDocumentFilterChain.doFilter(PortletDocumentFilterChain.java:49)
at
com.ibm.ws.portletcontainer.portletserving.filter.PortletDocumentFilterContainer.doFilter(PortletDocumentFilterContainer.java:51)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:766)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:674)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
at
com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:122)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
So, can any one please let me konw how to resolve this issue.
http://www.nabble.com/file/p17795510/web.xml web.xml
http://www.nabble.com/file/p17795510/portlet.xml portlet.xml
http://www.nabble.com/file/p17795510/applicationContext.xml
applicationContext.xml
http://www.nabble.com/file/p17795510/ServletContextProviderImpl.java
ServletContextProviderImpl.java
http://www.nabble.com/file/p17795510/PortalBridgePortletResourceURLFactoryImpl.java
PortalBridgePortletResourceURLFactoryImpl.java