Portlet functionality in Tapestry 4.1.x
---------------------------------------

                 Key: TAPESTRY-2548
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2548
             Project: Tapestry
          Issue Type: Bug
          Components: Portlet
    Affects Versions: 4.1.5, 4.1.3, 4.1.1, 4.1, 4.1.6
         Environment: Liferay 5.1 under Tomcat 6 
http://downloads.sourceforge.net/lportal/liferay-portal-tomcat-6.0-5.1.0.zip
Liferay 5.1 under Resin 
http://downloads.sourceforge.net/lportal/liferay-portal-resin-5.1.0.zip
            Reporter: Pieter Schoenmakers
         Attachments: patch-tapestry-portlet-tiggr-080801.diff

Portlet functionality seems to be somewhat broken in all Tapestry 4.1 versions 
up to and including trunk.  At least on Liferay it does not work, but 
inspection of the code suggests that the problem is not Liferay specific.

Issue 1: Both RenderRequestServicerToWebRequestServicerBridge and 
ActionRequestServicerToWebRequestServicerBridge create a WebRequest but forget 
to store it in the RequestGlobals, which triggers the following 
NullPointerException:

Caused by: java.lang.NullPointerException: Property 'webRequest' of <OuterProxy 
for 
tapestry.globals.RequestGlobals(org.apache.tapestry.services.RequestGlobals)> 
is null.
        at 
$WebRequest_11b7966c4ae._targetServiceProperty($WebRequest_11b7966c4ae.java)
        at $WebRequest_11b7966c4ae.getLocale($WebRequest_11b7966c4ae.java)
        at $WebRequest_11b7966c474.getLocale($WebRequest_11b7966c474.java)
        at $WebRequest_11b7966c473.getLocale($WebRequest_11b7966c473.java)
        at 
org.apache.tapestry.services.impl.RequestLocaleManagerImpl.extractLocaleForCurrentRequest(RequestLocaleManagerImpl.java:94)
        at 
$RequestLocaleManager_11b7966c431.extractLocaleForCurrentRequest($RequestLocaleManager_11b7966c431.java)
        at 
$RequestLocaleManager_11b7966c432.extractLocaleForCurrentRequest($RequestLocaleManager_11b7966c432.java)
        at 
org.apache.tapestry.services.impl.EngineManagerImpl.getEngineInstance(EngineManagerImpl.java:42)
        at 
$EngineManager_11b7966c490.getEngineInstance($EngineManager_11b7966c490.java)
        at 
$EngineManager_11b7966c48f.getEngineInstance($EngineManager_11b7966c48f.java)
        at 
org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:45)
        at 
$WebRequestServicer_11b7966c48e.service($WebRequestServicer_11b7966c48e.java)
        at 
$WebRequestServicer_11b7966c48d.service($WebRequestServicer_11b7966c48d.java)
        at 
$WebRequestServicer_11b7966c48c.service($WebRequestServicer_11b7966c48c.java)
        at 
$WebRequestServicer_11b7966c48b.service($WebRequestServicer_11b7966c48b.java)
        at 
org.apache.tapestry.portlet.RenderRequestServicerToWebRequestServicerBridge.service(RenderRequestServicerToWebRequestServicerBridge.java:50)

Issue 2: For some reason, the JSONResponseContributorImpl does a 
WebRequest.getHeader(), which the PortletWebRequest implements by throwing an 
UnsupportedOperationException.

Caused by: java.lang.UnsupportedOperationException: Method getHeader() is not 
supported for portlet requests.
        at 
org.apache.tapestry.portlet.PortletWebRequest.unsupported(PortletWebRequest.java:144)
        at 
org.apache.tapestry.portlet.PortletWebRequest.getHeader(PortletWebRequest.java:159)
        at $WebRequest_11b7dafe063.getHeader($WebRequest_11b7dafe063.java)
        at $WebRequest_11b7dafe028.getHeader($WebRequest_11b7dafe028.java)
        at 
org.apache.tapestry.services.impl.JSONResponseContributorImpl.handlesResponse(JSONResponseContributorImpl.java:67)
        at 
$ResponseContributor_11b7dafe071.handlesResponse($ResponseContributor_11b7dafe071.java)
        at 
$ResponseContributor_11b7dafe070.handlesResponse($ResponseContributor_11b7dafe070.java)
        at 
org.apache.tapestry.services.impl.ResponseDelegateFactoryImpl.getResponseBuilder(ResponseDelegateFactoryImpl.java:46)

I'll attach a patch to this issue to fix both issues for trunk.

Given the severity of the bugs, especially the second one, I am wondering why 
nobody else has encountered these...

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to