[jboss-remoting-issues] [JBoss JIRA] Issue Comment Edited: (JBREM-1145) HTTPUnMarshaller shouldn't use the value of content-type to determine the type of an object

Ron Sigal (JIRA) jira-events at lists.jboss.org
Mon Aug 17 23:33:26 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBREM-1145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12481304#action_12481304 ] 

Ron Sigal edited comment on JBREM-1145 at 8/17/09 11:32 PM:
------------------------------------------------------------

org.jboss.remoting.marshal.http.HTTPUnMarshaller, org.jboss.remoting.transport.http.CoyoteInvoker, and org.jboss.remoting.transport.http.HTTPClientInvoker use a new property, org.jboss.remoting.transport.http.HTTPMetadataConstants.REMOTING_CONTENT_TYPE (actual value "remotingContentType") to distinguish the special case of a String payload from other cases.  In particular, when writing, HTTPClientInvoker adds a request header to the HttpURLConnection, and CoyoteInvoker adds a response header to the org.apache.coyote.Response.  Then, when reading, they each put the headers they receive in a metadata map that gets passed to the HTTPUnMarshaller.

Changes applied to branch 2.2 and 2.x.

Unit tests: org.jboss.test.remoting.transport.http.marshal.ContentTypeTestCase .

Waiting for results from hudson.

Also, need to update ServletServerInvoker.

      was (Author: ron.sigal at jboss.com):
    org.jboss.remoting.marshal.http.HTTPUnMarshaller, org.jboss.remoting.transport.http.CoyoteInvoker, and org.jboss.remoting.transport.http.HTTPClientInvoker use a new property, org.jboss.remoting.transport.http.HTTPMetadataConstants.REMOTING_CONTENT_TYPE (actual value "remotingContentType") to distinguish the special case of a String payload from other cases.  In particular, when writing, HTTPClientInvoker adds a request header to the HttpURLConnection, and CoyoteInvoker adds a response header to the org.apache.coyote.Response.  Then, when reading, they each put the headers they receive in a metadata map that gets passed to the HTTPUnMarshaller.

Changes applied to branch 2.2 and 2.x.

Waiting for results from hudson.

Also, need to update ServletServerInvoker.
  
> HTTPUnMarshaller shouldn't use the value of content-type to determine the type of an object
> -------------------------------------------------------------------------------------------
>
>                 Key: JBREM-1145
>                 URL: https://jira.jboss.org/jira/browse/JBREM-1145
>             Project: JBoss Remoting
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 2.5.1 (Flounder), 2.2.3
>            Reporter: Ron Sigal
>            Assignee: Ron Sigal
>             Fix For: 2.5.2 (Flounder), 2.2.3.SP1
>
>
> org.jboss.remoting.marshal.http.HTTPMarshaller and HTTPUnMarshaller treat Strings as a special case, to avoid the expense of serialization.  However, HTTPUnMarshaller is using the metadata value of content-type to determine if an object is a string or not, and. as of  JBREM-653 "allow user to set content-type for http responses", that doesn't work.  The problem is that the ServerInvocationHandler can set the content-type to, say, text/html, but CoyoteInvoker wraps the result in and InvocationResponse, which gets serialized.  On the other side, HTTPUnMarshaller sees "text/html" and tries to read the serialized InvocationResponse as a string.
> One solution would be for Remoting to use its own metadata key, say "remoting-type" for the purposes of marshaling and unmarshaling.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-remoting-issues mailing list