You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Todd Nist <To...@gi.leica-geosystems.com> on 2007/07/06 19:50:49 UTC
BundleContextImpl - not serializable ?
Is there a reason that org.apache.felix.framework.BundleContextImpl does
not implement serializable? I understand that the context should be
private to the activator, but other then that is there some other reason
for it not being serializable?
I have the following scenario:
I am embedding Felix inside of several J2EE Containers, JBoss, OC4J and
WebLogic. I am attempting to use the services provided by Felix from
within the context of the J2EE container, specifically an EJB calling a
service. I planed on achieving this by binding the HostBundleActivator
(BundleActivator) created during the startup of Felix to the JNDI tree
and gaining access to it from there. The reason for using Felix is to
allow for the extensibility of services by third parties in case anyone
is wondering why I am trying this.
Anyways the problem I am encountering is that when I bind the
HostBundleActivator to JBoss version 4.0.5, I get a serialization
exception on the org.apache.felix.framework.BundleContextImpl since it
does not implement serializable.
Any insight on why the BundleContextImpl is not serializable would be
appreciated.
Regards,
Todd
RE: BundleContextImpl - not serializable ?
Posted by Todd Nist <To...@gi.leica-geosystems.com>.
Felix,
Thanks for the follow up. The BundleContextImpl is in fact an instance
field in my HostBundleActivator as you gathered. I did make it
transient, but the problem with that was that if the object did get
serialized, then when I reference it again causing it to be
de-serialized, the value of the BundleContextImpl was null. This
needless to say resulted in a null pointer exception.
It makes sense why it is not serializable now based on BJ Hargrave
earlier reply to this message.
Again, thanks for the follow up and suggestion; much appreciated.
Regards,
Todd
-----Original Message-----
From: Felix Meschberger [mailto:fmeschbe@gmail.com]
Sent: Monday, July 09, 2007 1:58 AM
To: dev@felix.apache.org
Subject: Re: BundleContextImpl - not serializable ?
Hi Todd,
I assume the BundleContextImpl instance is a field in your
HostBundleActivator, which sounds like the reason for it to have to be
serializable. Have you tried declaring the field "transient" ? My
understanding is, that in this case the field should be exempted from
serialization.
Regards
Felix
Am Freitag, den 06.07.2007, 13:50 -0400 schrieb Todd Nist:
> Is there a reason that org.apache.felix.framework.BundleContextImpl
does
> not implement serializable? I understand that the context should be
> private to the activator, but other then that is there some other
reason
> for it not being serializable?
>
> I have the following scenario:
>
> I am embedding Felix inside of several J2EE Containers, JBoss, OC4J
and
> WebLogic. I am attempting to use the services provided by Felix from
> within the context of the J2EE container, specifically an EJB calling
a
> service. I planed on achieving this by binding the
HostBundleActivator
> (BundleActivator) created during the startup of Felix to the JNDI tree
> and gaining access to it from there. The reason for using Felix is to
> allow for the extensibility of services by third parties in case
anyone
> is wondering why I am trying this.
>
> Anyways the problem I am encountering is that when I bind the
> HostBundleActivator to JBoss version 4.0.5, I get a serialization
> exception on the org.apache.felix.framework.BundleContextImpl since it
> does not implement serializable.
>
> Any insight on why the BundleContextImpl is not serializable would be
> appreciated.
>
> Regards,
> Todd
Re: BundleContextImpl - not serializable ?
Posted by Felix Meschberger <fm...@gmail.com>.
Hi Todd,
I assume the BundleContextImpl instance is a field in your
HostBundleActivator, which sounds like the reason for it to have to be
serializable. Have you tried declaring the field "transient" ? My
understanding is, that in this case the field should be exempted from
serialization.
Regards
Felix
Am Freitag, den 06.07.2007, 13:50 -0400 schrieb Todd Nist:
> Is there a reason that org.apache.felix.framework.BundleContextImpl does
> not implement serializable? I understand that the context should be
> private to the activator, but other then that is there some other reason
> for it not being serializable?
>
> I have the following scenario:
>
> I am embedding Felix inside of several J2EE Containers, JBoss, OC4J and
> WebLogic. I am attempting to use the services provided by Felix from
> within the context of the J2EE container, specifically an EJB calling a
> service. I planed on achieving this by binding the HostBundleActivator
> (BundleActivator) created during the startup of Felix to the JNDI tree
> and gaining access to it from there. The reason for using Felix is to
> allow for the extensibility of services by third parties in case anyone
> is wondering why I am trying this.
>
> Anyways the problem I am encountering is that when I bind the
> HostBundleActivator to JBoss version 4.0.5, I get a serialization
> exception on the org.apache.felix.framework.BundleContextImpl since it
> does not implement serializable.
>
> Any insight on why the BundleContextImpl is not serializable would be
> appreciated.
>
> Regards,
> Todd
Re: BundleContextImpl - not serializable ?
Posted by BJ Hargrave <ha...@us.ibm.com>.
Probably because you cannot abitrarily deserialize a BundleContext object.
A BundleContext maintains a bundle's context within a running OSGi
framework instance. Since that context is stateful and includes things
like the set of services registered and used by a bundle, there is no way
to arbitrarily deserialize that information in future execution context.
--
BJ Hargrave
Senior Technical Staff Member, IBM
OSGi Fellow and CTO of the OSGi Alliance
hargrave@us.ibm.com
office: +1 386 848 1781
mobile: +1 386 848 3788
"Todd Nist" <To...@gi.leica-geosystems.com>
2007-07-06 13:50
Please respond to
dev@felix.apache.org
To
<fe...@incubator.apache.org>
cc
Subject
BundleContextImpl - not serializable ?
Is there a reason that org.apache.felix.framework.BundleContextImpl does
not implement serializable? I understand that the context should be
private to the activator, but other then that is there some other reason
for it not being serializable?
I have the following scenario:
I am embedding Felix inside of several J2EE Containers, JBoss, OC4J and
WebLogic. I am attempting to use the services provided by Felix from
within the context of the J2EE container, specifically an EJB calling a
service. I planed on achieving this by binding the HostBundleActivator
(BundleActivator) created during the startup of Felix to the JNDI tree
and gaining access to it from there. The reason for using Felix is to
allow for the extensibility of services by third parties in case anyone
is wondering why I am trying this.
Anyways the problem I am encountering is that when I bind the
HostBundleActivator to JBoss version 4.0.5, I get a serialization
exception on the org.apache.felix.framework.BundleContextImpl since it
does not implement serializable.
Any insight on why the BundleContextImpl is not serializable would be
appreciated.
Regards,
Todd