[JBoss JIRA] Commented: (NETTY-371) OSGi Manifest requires Bundle-BuddyPolicy for object deserialization

Brett Wooldridge (JIRA) jira-events at lists.jboss.org
Wed Jan 5 00:13:18 EST 2011


    [ https://issues.jboss.org/browse/NETTY-371?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12573365#comment-12573365 ] 

Brett Wooldridge commented on NETTY-371:
----------------------------------------

Bundle-RegisterBuddy and/or Eclipse-RegisterBuddy manifest headers are used by the end-user (developer) to link the classloader of their bundle to the 'registered' netty bundle -- allowing netty's ObjectDecoder to classload end-user classes during deserialization.  These headers need not appear in the netty MANIFEST.MF -- they are harmless, but also useless there.

Therefore, the netty OSGi bundle only needs these two headers:

Eclipse-BuddyPolicy: registered
Bundle-BuddyPolicy: registered

The Eclipse-BuddyPolicy header is for backward compatibility, and Bundle-BuddyPolicy is for forward compatibility (OSGi 4.1).  By using these headers, netty is telling OSGi to allow end-user bundles to 'friend' the netty bundle for classloading purposes.



> OSGi Manifest requires Bundle-BuddyPolicy for object deserialization
> --------------------------------------------------------------------
>
>                 Key: NETTY-371
>                 URL: https://issues.jboss.org/browse/NETTY-371
>             Project: Netty
>          Issue Type: Bug
>          Components: Core API
>    Affects Versions: 3.2.3.Final
>            Reporter: Brett Wooldridge
>            Assignee: Trustin Lee
>
> In order for object deserialization (by the ObjectDecoder) to work in an OSGi environment
> Netty's OSGi MANIFEST.MF needs to include a header like:
> DynamicImport-Package: *
> Without this header, when the ObjectDecoder attempts to load the class for a serialized
> object, it will be unable to find the bundle that exports that package.  The result is a
> ClassNotFoundException.
> With this header in the manifest, the OSGi container will search for any bundle that
> exports the package containing the requested class, and will use that bundle's classloader
> to load the class.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the netty-dev mailing list