[jboss-jira] [JBoss JIRA] Closed: (JBCACHE-883) VersionAwareMarshaller hides true cause of marshalling failures

Brian Stansberry (JIRA) jira-events at jboss.com
Tue Nov 28 23:18:55 EST 2006


     [ http://jira.jboss.com/jira/browse/JBCACHE-883?page=all ]

Brian Stansberry closed JBCACHE-883.
------------------------------------

    Resolution: Done

> VersionAwareMarshaller hides true cause of marshalling failures
> ---------------------------------------------------------------
>
>                 Key: JBCACHE-883
>                 URL: http://jira.jboss.com/jira/browse/JBCACHE-883
>             Project: JBoss Cache
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 1.4.0.GA, 1.4.0.SP1
>            Reporter: Brian Stansberry
>         Assigned To: Brian Stansberry
>            Priority: Minor
>             Fix For: 1.4.1.GA
>
>   Original Estimate: 10 minutes
>  Remaining Estimate: 10 minutes
>
> From objectFromByteBuffer:
>        try
>         {
>             return marshaller.objectFromStream(in);
>         }
>         catch (Exception e)
>         {
>             if (marshaller instanceof LegacyTreeCacheMarshaller)
>             {
>                 // the default marshaller IS the legacy marshaller!!
>                 throw e;
>             }
>             else
>             {
>                 // retry with legacy marshaller - this is probably because the version id was incorrectly read.
>                 if (log.isInfoEnabled())
>                 {
>                     log.info("Caught exception unmarshalling stream with specific versioned marshaller " + marshaller.getClass() + ".  Attempting to try again with legacy marshaller " + LegacyTreeCacheMarshaller.class);
>                 }
>                 // create a more 'compatible' ObjectInputStream.
>                 in = new MarshalledValueInputStream(new ByteArrayInputStream(buf));
>                 return getMarshaller(VERSION_LEGACY).objectFromStream(in);
>             }
>         }
> Problem is the else block in the catch block, which assumes the LegacyTreeCacheMarshaller will work.  There should be a try/catch there as well, and if the assumption is wrong and there is a failure with the LegacyTreeCacheMarshaller as well, the original exception should be thrown.

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

        



More information about the jboss-jira mailing list