<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>users@felix.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/felix-users/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/felix-users/"/>
<id>http://mail-archives.apache.org/mod_mbox/felix-users/</id>
<updated>2009-12-06T00:26:14Z</updated>
<entry>
<title>Re: Default Felix web app launcher (was: Default web app integration behavior)</title>
<author><name>Justin Edelson &lt;justinedelson@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c980B656B-A763-4F7E-A72B-7C3F7A05C871@gmail.com%3e"/>
<id>urn:uuid:%3c980B656B-A763-4F7E-A72B-7C3F7A05C871@gmail-com%3e</id>
<updated>2009-12-05T15:00:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>

On Dec 5, 2009, at 9:55 AM, Felix Meschberger wrote:

&gt; Or go for the Sling launcher ;-) It is by no means locked into Sling. It
&gt; just happens to live there (in the launchpad folder).

+1

Best way to figure out if we need to make any further changes to the Sling launcher is to
have non-Sling projects using it.

Justin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Default Felix web app launcher (was: Default web app integration 	behavior)</title>
<author><name>Felix Meschberger &lt;fmeschbe@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B1A747E.2010802@gmail.com%3e"/>
<id>urn:uuid:%3c4B1A747E-2010802@gmail-com%3e</id>
<updated>2009-12-05T14:55:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi

Pavol Juhos schrieb:
&gt; Hi Felix,
&gt; 
&gt; that's good news. Meanwhile I assume that the recommended approach is
&gt; to customize code provided in
&gt; 
&gt; http://svn.apache.org/repos/asf/felix/trunk/http/samples/bridge/

Or go for the Sling launcher ;-) It is by no means locked into Sling. It
 just happens to live there (in the launchpad folder).

Regards
Felix

&gt; 
&gt; Best regards,
&gt; 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Default Felix web app launcher (was: Default web app integration	behavior)</title>
<author><name>Pavol Juhos &lt;pavol.juhos@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c2552bb260912050649i554e57a6wf3f425bbd39c28a5@mail.gmail.com%3e"/>
<id>urn:uuid:%3c2552bb260912050649i554e57a6wf3f425bbd39c28a5@mail-gmail-com%3e</id>
<updated>2009-12-05T14:49:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Felix,

that's good news. Meanwhile I assume that the recommended approach is
to customize code provided in

http://svn.apache.org/repos/asf/felix/trunk/http/samples/bridge/

Best regards,

-- 
PJ

On Sat, Dec 5, 2009 at 22:36, Felix Meschberger &lt;fmeschbe@gmail.com&gt; wrote:
&gt; Hi Pavol,
&gt;
&gt; We have just integrated the Felix Http Service bridge in the Sling
&gt; launcher contributed by Justin.
&gt;
&gt; Basically the Sling community is ok with contributing the launcher to
&gt; Felix but we wanted to convert to Felix Http Service first and check out
&gt; how exactly to convert.
&gt;
&gt; While it will probably still take some time to actually move the code
&gt; base, chances are that this will happen.
&gt;
&gt; Regards
&gt; Felix
&gt;
&gt; Pavol Juhos schrieb:
&gt;&gt; Hi,
&gt;&gt;
&gt;&gt; some time ago there was a discussion about adding a Felix web app
&gt;&gt; launcher as a default solution when using Apache Felix Http Service /
&gt;&gt; Servlet Bridge. Felix Meschberger mentioned a possibility of donating
&gt;&gt; Sling launcher to the Apache Felix project. Have the community reached
&gt;&gt; any kind of conclusion on these points?
&gt;&gt;
&gt;&gt; It would be nice to have a standard/default way of embedding Felix in
&gt;&gt; a web container as originally pointed out by Justin Edelson.
&gt;&gt;
&gt;&gt; Thanks!
&gt;&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;
&gt;

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Default Felix web app launcher (was: Default web app integration 	behavior)</title>
<author><name>Felix Meschberger &lt;fmeschbe@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B1A6FF6.1080006@gmail.com%3e"/>
<id>urn:uuid:%3c4B1A6FF6-1080006@gmail-com%3e</id>
<updated>2009-12-05T14:36:38Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Pavol,

We have just integrated the Felix Http Service bridge in the Sling
launcher contributed by Justin.

Basically the Sling community is ok with contributing the launcher to
Felix but we wanted to convert to Felix Http Service first and check out
how exactly to convert.

While it will probably still take some time to actually move the code
base, chances are that this will happen.

Regards
Felix

Pavol Juhos schrieb:
&gt; Hi,
&gt; 
&gt; some time ago there was a discussion about adding a Felix web app
&gt; launcher as a default solution when using Apache Felix Http Service /
&gt; Servlet Bridge. Felix Meschberger mentioned a possibility of donating
&gt; Sling launcher to the Apache Felix project. Have the community reached
&gt; any kind of conclusion on these points?
&gt; 
&gt; It would be nice to have a standard/default way of embedding Felix in
&gt; a web container as originally pointed out by Justin Edelson.
&gt; 
&gt; Thanks!
&gt; 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Default Felix web app launcher (was: Default web app integration	behavior)</title>
<author><name>Pavol Juhos &lt;pavol.juhos@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c2552bb260912050632u4c5d4848nfc78f1dccfab596a@mail.gmail.com%3e"/>
<id>urn:uuid:%3c2552bb260912050632u4c5d4848nfc78f1dccfab596a@mail-gmail-com%3e</id>
<updated>2009-12-05T14:32:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

some time ago there was a discussion about adding a Felix web app
launcher as a default solution when using Apache Felix Http Service /
Servlet Bridge. Felix Meschberger mentioned a possibility of donating
Sling launcher to the Apache Felix project. Have the community reached
any kind of conclusion on these points?

It would be nice to have a standard/default way of embedding Felix in
a web container as originally pointed out by Justin Edelson.

Thanks!

-- 
Pavol Juhos
[pavol.juhos@gmail.com]

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Apache Felix Karaf &amp; Equinox : ERROR / BUG</title>
<author><name>Charles Moulliard &lt;cmoulliard@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ca364c40b0912040632o786a005bp34a66472dc6727a2@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca364c40b0912040632o786a005bp34a66472dc6727a2@mail-gmail-com%3e</id>
<updated>2009-12-04T14:32:05Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
You are right

;-)

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm


On Fri, Dec 4, 2009 at 3:28 PM, Karl Pauls &lt;karlpauls@gmail.com&gt; wrote:

&gt; On Fri, Dec 4, 2009 at 3:24 PM, Charles Moulliard &lt;cmoulliard@gmail.com&gt;
&gt; wrote:
&gt; &gt; I try to deploy a camel-example-etl bundle configured to run with openjpa
&gt; on
&gt; &gt; apache Felix Karaf
&gt; &gt;
&gt; &gt; When I try to start the bundle, I receive the following errors
&gt; &gt;
&gt; &gt; The bundle could not be resolved. Reason: Missing Constraint:
&gt; &gt; Import-Package: org.apache.openjpa.jdbc.kernel; version="[1.2.0,2.0.0)"
&gt; &gt;
&gt; &gt; Here is the config of import
&gt; &gt;
&gt; &gt; org.apache.openjpa.jdbc.kernel;version="[1.2,2.0)";resolution=optional,
&gt;
&gt; This needs to be resolution:=optional no?
&gt;
&gt; regards,
&gt;
&gt; Karl
&gt;
&gt; &gt;
&gt; &gt; If I try without the resolution=optional, I get this error
&gt; &gt;
&gt; &gt; The bundle could not be resolved. Reason: Package uses conflict:
&gt; &gt; Import-Package: org.apache.openjpa.jdbc.kernel; version="[1.2.0,2.0.0)"
&gt; &gt;
&gt; &gt; Here is what export the bundle openjpa
&gt; &gt;
&gt; &gt; karaf@root&gt; packages:exports 62
&gt; &gt;
&gt; &gt; Apache ServiceMix Bundles: openjpa-1.2.1 (62):
&gt; &gt; org.apache.openjpa.jdbc.kernel; version="1.2.1"
&gt; &gt;
&gt; &gt; WHAT IS WRONG ? IS IT A BUG ?
&gt; &gt;
&gt; &gt; Charles Moulliard
&gt; &gt; Senior Enterprise Architect
&gt; &gt; Apache Camel Committer
&gt; &gt;
&gt; &gt; *****************************
&gt; &gt; blog : http://cmoulliard.blogspot.com
&gt; &gt; twitter : http://twitter.com/cmoulliard
&gt; &gt; Linkedlin : http://www.linkedin.com/in/charlesmoulliard
&gt; &gt;
&gt; &gt; Apache Camel Group :
&gt; &gt; http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm
&gt; &gt;
&gt;
&gt;
&gt;
&gt; --
&gt; Karl Pauls
&gt; karlpauls@gmail.com
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Apache Felix Karaf &amp; Equinox : ERROR / BUG</title>
<author><name>Karl Pauls &lt;karlpauls@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c487a994c0912040628g78228ac2rbf78f4a385f1cbf5@mail.gmail.com%3e"/>
<id>urn:uuid:%3c487a994c0912040628g78228ac2rbf78f4a385f1cbf5@mail-gmail-com%3e</id>
<updated>2009-12-04T14:28:58Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Fri, Dec 4, 2009 at 3:24 PM, Charles Moulliard &lt;cmoulliard@gmail.com&gt; wrote:
&gt; I try to deploy a camel-example-etl bundle configured to run with openjpa on
&gt; apache Felix Karaf
&gt;
&gt; When I try to start the bundle, I receive the following errors
&gt;
&gt; The bundle could not be resolved. Reason: Missing Constraint:
&gt; Import-Package: org.apache.openjpa.jdbc.kernel; version="[1.2.0,2.0.0)"
&gt;
&gt; Here is the config of import
&gt;
&gt; org.apache.openjpa.jdbc.kernel;version="[1.2,2.0)";resolution=optional,

This needs to be resolution:=optional no?

regards,

Karl

&gt;
&gt; If I try without the resolution=optional, I get this error
&gt;
&gt; The bundle could not be resolved. Reason: Package uses conflict:
&gt; Import-Package: org.apache.openjpa.jdbc.kernel; version="[1.2.0,2.0.0)"
&gt;
&gt; Here is what export the bundle openjpa
&gt;
&gt; karaf@root&gt; packages:exports 62
&gt;
&gt; Apache ServiceMix Bundles: openjpa-1.2.1 (62):
&gt; org.apache.openjpa.jdbc.kernel; version="1.2.1"
&gt;
&gt; WHAT IS WRONG ? IS IT A BUG ?
&gt;
&gt; Charles Moulliard
&gt; Senior Enterprise Architect
&gt; Apache Camel Committer
&gt;
&gt; *****************************
&gt; blog : http://cmoulliard.blogspot.com
&gt; twitter : http://twitter.com/cmoulliard
&gt; Linkedlin : http://www.linkedin.com/in/charlesmoulliard
&gt;
&gt; Apache Camel Group :
&gt; http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm
&gt;



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Apache Felix Karaf &amp; Equinox : ERROR / BUG</title>
<author><name>Charles Moulliard &lt;cmoulliard@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ca364c40b0912040624n7fec21acp28ec30933922917@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca364c40b0912040624n7fec21acp28ec30933922917@mail-gmail-com%3e</id>
<updated>2009-12-04T14:24:29Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I try to deploy a camel-example-etl bundle configured to run with openjpa on
apache Felix Karaf

When I try to start the bundle, I receive the following errors

The bundle could not be resolved. Reason: Missing Constraint:
Import-Package: org.apache.openjpa.jdbc.kernel; version="[1.2.0,2.0.0)"

Here is the config of import

org.apache.openjpa.jdbc.kernel;version="[1.2,2.0)";resolution=optional,

If I try without the resolution=optional, I get this error

The bundle could not be resolved. Reason: Package uses conflict:
Import-Package: org.apache.openjpa.jdbc.kernel; version="[1.2.0,2.0.0)"

Here is what export the bundle openjpa

karaf@root&gt; packages:exports 62

Apache ServiceMix Bundles: openjpa-1.2.1 (62):
org.apache.openjpa.jdbc.kernel; version="1.2.1"

WHAT IS WRONG ? IS IT A BUG ?

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Apache Felix 2.0.1 - Fragment-Host - The list of packages of the	fragment bundles are not at all exported.</title>
<author><name>Guo Du &lt;mrduguo@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ce2a35cbc0912040351g5eb1c0d6o799933e16d2a14bc@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce2a35cbc0912040351g5eb1c0d6o799933e16d2a14bc@mail-gmail-com%3e</id>
<updated>2009-12-04T11:51:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Fri, Dec 4, 2009 at 11:30 AM, Charles Moulliard &lt;cmoulliard@gmail.com&gt; wrote:
&gt; Why such info is not provided to the console's user !!!!
That's what I want as well :)

&gt; Surprisingly, using equinox as osgi platform on Apache Felix Karaf allow to
&gt; bind the same Hibernate bundles without any issues !!
equinox implemented fragment support in different way and doesn't
complain the conflict.

-Guo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Apache Felix 2.0.1 - Fragment-Host - The list of packages of the	fragment bundles are not at all exported.</title>
<author><name>Charles Moulliard &lt;cmoulliard@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ca364c40b0912040330x2f65178dg40107cd2c4d947fe@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca364c40b0912040330x2f65178dg40107cd2c4d947fe@mail-gmail-com%3e</id>
<updated>2009-12-04T11:30:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thx.

Adding the property : felix.log.level= 4 in config.properties file of Apache
Felix Karaf helps me

It should be interesting to add it by default as non commented property in
the file otherwise people have to dig Internet ???

Here is the result :

DEBUG: Excluding fragment com.springsource.org.hibernate.ejb from
com.springsource.org.hibernate due to conflict with imported package
javassist.bytecode from com.springsource.org.hibernate
DEBUG: Excluding fragment com.springsource.org.hibernate.annotations from
com.springsource.org.hibernate due to conflict with imported package
org.slf4j from com.springsource.org.hibernate

Why such info is not provided to the console's user !!!!

Surprisingly, using equinox as osgi platform on Apache Felix Karaf allow to
bind the same Hibernate bundles without any issues !!

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm


On Fri, Dec 4, 2009 at 11:59 AM, Guo Du &lt;mrduguo@gmail.com&gt; wrote:

&gt; On Fri, Dec 4, 2009 at 8:13 AM, Charles Moulliard &lt;cmoulliard@gmail.com&gt;
&gt; wrote:
&gt; &gt; I have tested with logging defined as DEBUG or TRACE but no particular
&gt; info
&gt; &gt; has been reported in the log.
&gt; &gt;
&gt; &gt; For me, that was working before.
&gt; I tried one of my fragment bundle and it works on 2.0.0 and 2.0.1.
&gt;
&gt; If you provide log information, it may helps to identify the problem.
&gt;
&gt; You should see "DEBUG: FRAGMENT WIRE: 86.0 -&gt; hosted by -&gt; 89.0" if it
&gt; works.
&gt;
&gt; Otherwise, you should see something like:
&gt; DEBUG: Excluding fragment XXX from YYY due to conflict with imported
&gt; package ZZZ
&gt;
&gt; A question for framework developer not related to this mail: do we
&gt; need log the conflict as ERROR level message instead of DEBUG level?
&gt; Because when there is conflict happens, it means there are something
&gt; wrong and user need attention immediately instead of start a debug
&gt; session. There are a few mail conversation asked about fragment, our
&gt; response are always turn on debug log and see what happens.
&gt;
&gt;
&gt; -Guo
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Apache Felix 2.0.1 - Fragment-Host - The list of packages of the	fragment bundles are not at all exported.</title>
<author><name>Guo Du &lt;mrduguo@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ce2a35cbc0912040259p18a0ab40xc3a2eb9e7dee9a37@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce2a35cbc0912040259p18a0ab40xc3a2eb9e7dee9a37@mail-gmail-com%3e</id>
<updated>2009-12-04T10:59:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Fri, Dec 4, 2009 at 8:13 AM, Charles Moulliard &lt;cmoulliard@gmail.com&gt; wrote:
&gt; I have tested with logging defined as DEBUG or TRACE but no particular info
&gt; has been reported in the log.
&gt;
&gt; For me, that was working before.
I tried one of my fragment bundle and it works on 2.0.0 and 2.0.1.

If you provide log information, it may helps to identify the problem.

You should see "DEBUG: FRAGMENT WIRE: 86.0 -&gt; hosted by -&gt; 89.0" if it works.

Otherwise, you should see something like:
DEBUG: Excluding fragment XXX from YYY due to conflict with imported package ZZZ

A question for framework developer not related to this mail: do we
need log the conflict as ERROR level message instead of DEBUG level?
Because when there is conflict happens, it means there are something
wrong and user need attention immediately instead of start a debug
session. There are a few mail conversation asked about fragment, our
response are always turn on debug log and see what happens.


-Guo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Build process</title>
<author><name>Jochen Mader &lt;pflanzenmoerder@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c5554db730912040129r6bb37f12r71f479551aa7d270@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5554db730912040129r6bb37f12r71f479551aa7d270@mail-gmail-com%3e</id>
<updated>2009-12-04T09:29:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks for all the suggestions.
The maven-bundle-plugin is what I am using right now but it only provides
means of creating and maintaining an OSGi infrastructure, not reausing the
meat information from OSGi, which is what I am looking for.
Both Tycho and Sigil look very promising but for my scenario they both have
the same problem:
Missing maven 2 integration (Tycho only works with maven 3 and even ships it
with the downloadable).
I am working in the enterprise area and things there are moving at glacial
speed.
We will be stuck with maven 2 for quite some time and if I want to get OSGi
into our projects I will have to integrate everything with the existing
architecture which is maven 2 + hudson.

CU

Jochen


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Apache Felix 2.0.1 - Fragment-Host - The list of packages of the	fragment bundles are not at all exported.</title>
<author><name>Charles Moulliard &lt;cmoulliard@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ca364c40b0912040013ub3230fbifa9c30f19fff00ed@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca364c40b0912040013ub3230fbifa9c30f19fff00ed@mail-gmail-com%3e</id>
<updated>2009-12-04T08:13:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I have tested with logging defined as DEBUG or TRACE but no particular info
has been reported in the log.

For me, that was working before.

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm


On Thu, Dec 3, 2009 at 8:09 PM, Chris Custine &lt;chris.custine@gmail.com&gt;wrote:

&gt; Hi Charles,
&gt; In addition to Richard's suggestion to look at debug level framework
&gt; logging, I wonder was this working for you previously?
&gt;
&gt; Chris
&gt; --
&gt; Chris Custine
&gt; FUSESource :: http://fusesource.com
&gt; My Blog :: http://blog.organicelement.com
&gt; Apache ServiceMix :: http://servicemix.apache.org
&gt; Apache Directory Server :: http://directory.apache.org
&gt;
&gt;
&gt; On Thu, Dec 3, 2009 at 9:37 AM, Charles Moulliard &lt;cmoulliard@gmail.com
&gt; &gt;wrote:
&gt;
&gt; &gt; I try to link a fragment bundle to its host but it does not succeed with
&gt; &gt; Apache Felix 2.0.1 which is used on Apache Felix Karaf
&gt; &gt;
&gt; &gt; Here are the bundles installed for Hibernate :
&gt; &gt;
&gt; &gt; osgi:install -s
&gt; &gt;
&gt; &gt;
&gt; mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_2
&gt; &gt; osgi:install -s mvn:org.antlr/com.springsource.antlr/2.7.7
&gt; &gt; osgi:install -s mvn:org.jgroups/com.springsource.org.jgroups/2.5.1
&gt; &gt; osgi:install -s
&gt; &gt; mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/1.5.3
&gt; &gt; osgi:install -s
&gt; &gt; mvn:net.sourceforge.cglib/com.springsource.net.sf.cglib/2.2.0
&gt; &gt; osgi:install -s mvn:org.jboss.javassist/com.springsource.javassist/
&gt; &gt; 3.9.0.GA
&gt; &gt; osgi:install -s mvn:org.hibernate/com.springsource.org.hibernate/
&gt; 3.3.2.GA
&gt; &gt; osgi:install -s
&gt; &gt; mvn:org.hibernate/com.springsource.org.hibernate.annotations.common/
&gt; &gt; 3.3.0.GA
&gt; &gt; osgi:install -s mvn:org.hibernate/com.springsource.org.hibernate.ejb/
&gt; &gt; 3.4.0.GA
&gt; &gt;
&gt; &gt; and the two bundles involved
&gt; &gt;
&gt; &gt; [  86] [Installed  ] [            ] [       ] [   60] JBoss Hibernate
&gt; &gt; Entity
&gt; &gt; Manager (3.4.0.GA) // Fragment bundle
&gt; &gt; [  89] [Active     ] [            ] [       ] [   60] JBoss Hibernate
&gt; &gt; Object-Relational Mapper (3.3.2.GA) // its host
&gt; &gt;
&gt; &gt; using the command
&gt; &gt;
&gt; &gt; osgi:refresh 89
&gt; &gt;
&gt; &gt; does not affect the host bundle. The list of packages of the fragment
&gt; &gt; bundles are not at all exported.
&gt; &gt;
&gt; &gt; Regards,
&gt; &gt;
&gt; &gt; Charles Moulliard
&gt; &gt; Senior Enterprise Architect
&gt; &gt; Apache Camel Committer
&gt; &gt;
&gt; &gt; *****************************
&gt; &gt; blog : http://cmoulliard.blogspot.com
&gt; &gt; twitter : http://twitter.com/cmoulliard
&gt; &gt; Linkedlin : http://www.linkedin.com/in/charlesmoulliard
&gt; &gt;
&gt; &gt; Apache Camel Group :
&gt; &gt; http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm
&gt; &gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Apache Felix 2.0.1 - Fragment-Host - The list of packages of the	fragment bundles are not at all exported.</title>
<author><name>Chris Custine &lt;chris.custine@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c43b026c70912031109l1b0e1c34j161e26221793809a@mail.gmail.com%3e"/>
<id>urn:uuid:%3c43b026c70912031109l1b0e1c34j161e26221793809a@mail-gmail-com%3e</id>
<updated>2009-12-03T19:09:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Charles,
In addition to Richard's suggestion to look at debug level framework
logging, I wonder was this working for you previously?

Chris
--
Chris Custine
FUSESource :: http://fusesource.com
My Blog :: http://blog.organicelement.com
Apache ServiceMix :: http://servicemix.apache.org
Apache Directory Server :: http://directory.apache.org


On Thu, Dec 3, 2009 at 9:37 AM, Charles Moulliard &lt;cmoulliard@gmail.com&gt;wrote:

&gt; I try to link a fragment bundle to its host but it does not succeed with
&gt; Apache Felix 2.0.1 which is used on Apache Felix Karaf
&gt;
&gt; Here are the bundles installed for Hibernate :
&gt;
&gt; osgi:install -s
&gt;
&gt; mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_2
&gt; osgi:install -s mvn:org.antlr/com.springsource.antlr/2.7.7
&gt; osgi:install -s mvn:org.jgroups/com.springsource.org.jgroups/2.5.1
&gt; osgi:install -s
&gt; mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/1.5.3
&gt; osgi:install -s
&gt; mvn:net.sourceforge.cglib/com.springsource.net.sf.cglib/2.2.0
&gt; osgi:install -s mvn:org.jboss.javassist/com.springsource.javassist/
&gt; 3.9.0.GA
&gt; osgi:install -s mvn:org.hibernate/com.springsource.org.hibernate/3.3.2.GA
&gt; osgi:install -s
&gt; mvn:org.hibernate/com.springsource.org.hibernate.annotations.common/
&gt; 3.3.0.GA
&gt; osgi:install -s mvn:org.hibernate/com.springsource.org.hibernate.ejb/
&gt; 3.4.0.GA
&gt;
&gt; and the two bundles involved
&gt;
&gt; [  86] [Installed  ] [            ] [       ] [   60] JBoss Hibernate
&gt; Entity
&gt; Manager (3.4.0.GA) // Fragment bundle
&gt; [  89] [Active     ] [            ] [       ] [   60] JBoss Hibernate
&gt; Object-Relational Mapper (3.3.2.GA) // its host
&gt;
&gt; using the command
&gt;
&gt; osgi:refresh 89
&gt;
&gt; does not affect the host bundle. The list of packages of the fragment
&gt; bundles are not at all exported.
&gt;
&gt; Regards,
&gt;
&gt; Charles Moulliard
&gt; Senior Enterprise Architect
&gt; Apache Camel Committer
&gt;
&gt; *****************************
&gt; blog : http://cmoulliard.blogspot.com
&gt; twitter : http://twitter.com/cmoulliard
&gt; Linkedlin : http://www.linkedin.com/in/charlesmoulliard
&gt;
&gt; Apache Camel Group :
&gt; http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Apache Felix 2.0.1 - Fragment-Host - The list of packages of the 	fragment bundles are not at all exported.</title>
<author><name>&quot;Richard S. Hall&quot; &lt;heavy@ungoverned.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B17F128.8000107@ungoverned.org%3e"/>
<id>urn:uuid:%3c4B17F128-8000107@ungoverned-org%3e</id>
<updated>2009-12-03T17:11:04Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Can you set the framework log level to debug to see if it is complaining 
about a conflict between the host and fragment?

-&gt; richard

On 12/3/09 11:37, Charles Moulliard wrote:
&gt; I try to link a fragment bundle to its host but it does not succeed with
&gt; Apache Felix 2.0.1 which is used on Apache Felix Karaf
&gt;
&gt; Here are the bundles installed for Hibernate :
&gt;
&gt; osgi:install -s
&gt; mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_2
&gt; osgi:install -s mvn:org.antlr/com.springsource.antlr/2.7.7
&gt; osgi:install -s mvn:org.jgroups/com.springsource.org.jgroups/2.5.1
&gt; osgi:install -s
&gt; mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/1.5.3
&gt; osgi:install -s
&gt; mvn:net.sourceforge.cglib/com.springsource.net.sf.cglib/2.2.0
&gt; osgi:install -s mvn:org.jboss.javassist/com.springsource.javassist/3.9.0.GA
&gt; osgi:install -s mvn:org.hibernate/com.springsource.org.hibernate/3.3.2.GA
&gt; osgi:install -s
&gt; mvn:org.hibernate/com.springsource.org.hibernate.annotations.common/3.3.0.GA
&gt; osgi:install -s mvn:org.hibernate/com.springsource.org.hibernate.ejb/
&gt; 3.4.0.GA
&gt;
&gt; and the two bundles involved
&gt;
&gt; [  86] [Installed  ] [            ] [       ] [   60] JBoss Hibernate Entity
&gt; Manager (3.4.0.GA) // Fragment bundle
&gt; [  89] [Active     ] [            ] [       ] [   60] JBoss Hibernate
&gt; Object-Relational Mapper (3.3.2.GA) // its host
&gt;
&gt; using the command
&gt;
&gt; osgi:refresh 89
&gt;
&gt; does not affect the host bundle. The list of packages of the fragment
&gt; bundles are not at all exported.
&gt;
&gt; Regards,
&gt;
&gt; Charles Moulliard
&gt; Senior Enterprise Architect
&gt; Apache Camel Committer
&gt;
&gt; *****************************
&gt; blog : http://cmoulliard.blogspot.com
&gt; twitter : http://twitter.com/cmoulliard
&gt; Linkedlin : http://www.linkedin.com/in/charlesmoulliard
&gt;
&gt; Apache Camel Group :
&gt; http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm
&gt;
&gt;    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Apache Felix 2.0.1 - Fragment-Host - The list of packages of the	fragment bundles are not at all exported.</title>
<author><name>Charles Moulliard &lt;cmoulliard@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ca364c40b0912030837y5b300e01ueac400e8fc08163@mail.gmail.com%3e"/>
<id>urn:uuid:%3ca364c40b0912030837y5b300e01ueac400e8fc08163@mail-gmail-com%3e</id>
<updated>2009-12-03T16:37:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I try to link a fragment bundle to its host but it does not succeed with
Apache Felix 2.0.1 which is used on Apache Felix Karaf

Here are the bundles installed for Hibernate :

osgi:install -s
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.dom4j/1.6.1_2
osgi:install -s mvn:org.antlr/com.springsource.antlr/2.7.7
osgi:install -s mvn:org.jgroups/com.springsource.org.jgroups/2.5.1
osgi:install -s
mvn:org.objectweb.asm/com.springsource.org.objectweb.asm/1.5.3
osgi:install -s
mvn:net.sourceforge.cglib/com.springsource.net.sf.cglib/2.2.0
osgi:install -s mvn:org.jboss.javassist/com.springsource.javassist/3.9.0.GA
osgi:install -s mvn:org.hibernate/com.springsource.org.hibernate/3.3.2.GA
osgi:install -s
mvn:org.hibernate/com.springsource.org.hibernate.annotations.common/3.3.0.GA
osgi:install -s mvn:org.hibernate/com.springsource.org.hibernate.ejb/
3.4.0.GA

and the two bundles involved

[  86] [Installed  ] [            ] [       ] [   60] JBoss Hibernate Entity
Manager (3.4.0.GA) // Fragment bundle
[  89] [Active     ] [            ] [       ] [   60] JBoss Hibernate
Object-Relational Mapper (3.3.2.GA) // its host

using the command

osgi:refresh 89

does not affect the host bundle. The list of packages of the fragment
bundles are not at all exported.

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com
twitter : http://twitter.com/cmoulliard
Linkedlin : http://www.linkedin.com/in/charlesmoulliard

Apache Camel Group :
http://www.linkedin.com/groups?home=&amp;gid=2447439&amp;trk=anet_ug_hm


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Build process</title>
<author><name>Stuart McCulloch &lt;mcculls@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c81f0d9c0912030641m7b4e88k8edef00dd5306418@mail.gmail.com%3e"/>
<id>urn:uuid:%3c81f0d9c0912030641m7b4e88k8edef00dd5306418@mail-gmail-com%3e</id>
<updated>2009-12-03T14:41:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
2009/12/3 David Savage &lt;david.savage@paremus.com&gt;

&gt; Hi Jochen,
&gt;
&gt; You may want to look at Sigil [1] which is hosted here at Felix. This
&gt; uses exactly the approach you suggest in that it resolves package
&gt; dependencies from OSGi manifest files.
&gt;

for completeness I should mention the Tycho project, which can do
manifest-first or pom-first:

   http://docs.codehaus.org/display/M2ECLIPSE/Tycho+project+overview

as well as our very own Felix maven-bundle-plugin, which is more about
re-using Maven details:

   http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html

hope that hasn't muddied the waters...


&gt; To see an example of a sigil build in action you may want to check out
&gt; a recent blog post [2] I made which is actually related to our product
&gt; but uses a sigil build to create the necessary bundles.
&gt;
&gt; Very happy to receive feedback, issues or code contributions in this area
&gt; :)
&gt;
&gt; Regards,
&gt;
&gt; Dave
&gt;
&gt; [1] http://felix.apache.org/site/apache-felix-sigil.html
&gt; [2] http://chronological-thought.blogspot.com/2009/11/hello-tatooine.html
&gt;
&gt; On Thu, Dec 3, 2009 at 1:24 PM, Jochen Mader &lt;pflanzenmoerder@gmail.com&gt;
&gt; wrote:
&gt; &gt; Quite simply: I don't like my build process.
&gt; &gt; I am looking for a way of doing builds that stays true with the OSGi
&gt; &gt; philosophy.
&gt; &gt; I got my builds going with Maven, BND and OBR. But looking at the poms
&gt; &gt; always gives me the shivers.
&gt; &gt; The thing that drives me nuts is the replication of dependency
&gt; information
&gt; &gt; (the maven shotgun approach of "give me the bundle" vs the OSGi sniper
&gt; &gt; approach "give that package").
&gt; &gt; We have to specify the dependencies once to do our build and a second
&gt; time
&gt; &gt; to generate the manifest (BND).
&gt; &gt; I can't make use of the extended meta information an OSGi bundle contains
&gt; &gt; to, let's get wild, resolve my dependencies AND transitive dependencies
&gt; from
&gt; &gt; an OBR.
&gt; &gt; Is there some work being done that goes into that direction? Probably a
&gt; &gt; project I could join?
&gt; &gt; Something like maven plugin that replaces the dependency declarations
&gt; with a
&gt; &gt; "go to BND and grab the information from there as we are way too lazy to
&gt; &gt; type that stuff more than once" :)
&gt; &gt;
&gt; &gt; CU
&gt; &gt;
&gt; &gt; Jochen
&gt; &gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;
&gt;
-- 
Cheers, Stuart


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Build process</title>
<author><name>David Savage &lt;david.savage@paremus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3cfd848f8b0912030639i33c4e5d5w45524fa09c9a1cc8@mail.gmail.com%3e"/>
<id>urn:uuid:%3cfd848f8b0912030639i33c4e5d5w45524fa09c9a1cc8@mail-gmail-com%3e</id>
<updated>2009-12-03T14:39:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Jochen,

So trival hudson integration is easy in that it is just an ant build
that wraps the sigil build so all the normal hooks apply. I admit I've
not looked into any deeper integration - can you provide any links to
the sort of functionality you'd be looking for here?

Maven integration is something that I'd really like to work towards as
it's obviously a big part of the software build ecosystem. The choice
of ivy was in the main purely practical, as when we wrote sigil maven
2 didn't provide enough flexibility to plugin package level resolution
(at least not to my understanding).

I chatted with Jason a while ago when he was in London and Tycho looks
like a major step in the write direction in terms of plugability. But
hours in the day has meant that I've not made any progress in this
area. As it's all OSS if there is sufficient will to bring these two
worlds together then it's probably (?) just a matter of man hours.

Regards,

Dave

On Thu, Dec 3, 2009 at 2:14 PM, Jochen Mader &lt;pflanzenmoerder@gmail.com&gt; wrote:
&gt; So it does what I want from the OSGi side :)
&gt; Now I will have to check how to integrate this with a maven/hudson build and
&gt; the underlying structure.
&gt; Have you tried something like that?
&gt;
&gt; CU
&gt;
&gt; Jochen
&gt;

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Build process</title>
<author><name>Jochen Mader &lt;pflanzenmoerder@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c5554db730912030614w32d02ff5mbc31ae5b5d260df9@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5554db730912030614w32d02ff5mbc31ae5b5d260df9@mail-gmail-com%3e</id>
<updated>2009-12-03T14:14:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
So it does what I want from the OSGi side :)
Now I will have to check how to integrate this with a maven/hudson build and
the underlying structure.
Have you tried something like that?

CU

Jochen


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Build process</title>
<author><name>Jochen Mader &lt;pflanzenmoerder@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c5554db730912030547s7ad61f9od2d4c5a3f0aa3ac2@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5554db730912030547s7ad61f9od2d4c5a3f0aa3ac2@mail-gmail-com%3e</id>
<updated>2009-12-03T13:47:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks for the quick reply.
I will grab it and play around with it this weekend.

Cheers,

jochen


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Build process</title>
<author><name>David Savage &lt;david.savage@paremus.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3cfd848f8b0912030542v7903edb4uf068756925252314@mail.gmail.com%3e"/>
<id>urn:uuid:%3cfd848f8b0912030542v7903edb4uf068756925252314@mail-gmail-com%3e</id>
<updated>2009-12-03T13:42:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi Jochen,

You may want to look at Sigil [1] which is hosted here at Felix. This
uses exactly the approach you suggest in that it resolves package
dependencies from OSGi manifest files.

To see an example of a sigil build in action you may want to check out
a recent blog post [2] I made which is actually related to our product
but uses a sigil build to create the necessary bundles.

Very happy to receive feedback, issues or code contributions in this area :)

Regards,

Dave

[1] http://felix.apache.org/site/apache-felix-sigil.html
[2] http://chronological-thought.blogspot.com/2009/11/hello-tatooine.html

On Thu, Dec 3, 2009 at 1:24 PM, Jochen Mader &lt;pflanzenmoerder@gmail.com&gt; wrote:
&gt; Quite simply: I don't like my build process.
&gt; I am looking for a way of doing builds that stays true with the OSGi
&gt; philosophy.
&gt; I got my builds going with Maven, BND and OBR. But looking at the poms
&gt; always gives me the shivers.
&gt; The thing that drives me nuts is the replication of dependency information
&gt; (the maven shotgun approach of "give me the bundle" vs the OSGi sniper
&gt; approach "give that package").
&gt; We have to specify the dependencies once to do our build and a second time
&gt; to generate the manifest (BND).
&gt; I can't make use of the extended meta information an OSGi bundle contains
&gt; to, let's get wild, resolve my dependencies AND transitive dependencies from
&gt; an OBR.
&gt; Is there some work being done that goes into that direction? Probably a
&gt; project I could join?
&gt; Something like maven plugin that replaces the dependency declarations with a
&gt; "go to BND and grab the information from there as we are way too lazy to
&gt; type that stuff more than once" :)
&gt;
&gt; CU
&gt;
&gt; Jochen
&gt;

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Build process</title>
<author><name>Jochen Mader &lt;pflanzenmoerder@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c5554db730912030524p115d4689j51dfb111217f5f69@mail.gmail.com%3e"/>
<id>urn:uuid:%3c5554db730912030524p115d4689j51dfb111217f5f69@mail-gmail-com%3e</id>
<updated>2009-12-03T13:24:51Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Quite simply: I don't like my build process.
I am looking for a way of doing builds that stays true with the OSGi
philosophy.
I got my builds going with Maven, BND and OBR. But looking at the poms
always gives me the shivers.
The thing that drives me nuts is the replication of dependency information
(the maven shotgun approach of "give me the bundle" vs the OSGi sniper
approach "give that package").
We have to specify the dependencies once to do our build and a second time
to generate the manifest (BND).
I can't make use of the extended meta information an OSGi bundle contains
to, let's get wild, resolve my dependencies AND transitive dependencies from
an OBR.
Is there some work being done that goes into that direction? Probably a
project I could join?
Something like maven plugin that replaces the dependency declarations with a
"go to BND and grab the information from there as we are way too lazy to
type that stuff more than once" :)

CU

Jochen


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Deployment question...</title>
<author><name>Tony Anecito &lt;adanecito@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c599380.99022.qm@web39803.mail.mud.yahoo.com%3e"/>
<id>urn:uuid:%3c599380-99022-qm@web39803-mail-mud-yahoo-com%3e</id>
<updated>2009-12-03T06:29:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Thanks Rob for the reply.

I am thinking along the same lines but use izpack for example.

Regards,
-Tony

--- On Wed, 12/2/09, Rob Walker &lt;robw@ascert.com&gt; wrote:

&gt; From: Rob Walker &lt;robw@ascert.com&gt;
&gt; Subject: Re: Deployment question...
&gt; To: users@felix.apache.org
&gt; Date: Wednesday, December 2, 2009, 10:45 PM
&gt; Tony
&gt; 
&gt; It's possible to use both - a small "shim" launcher that
&gt; deploys via 
&gt; WebStart and launches OSGi, which does the rest of your
&gt; deployment and 
&gt; then manages updates afterwards. You'll need to write some
&gt; code to do 
&gt; this, but it's possible.
&gt; 
&gt; -- Rob
&gt; 
&gt; Tony Anecito wrote:
&gt; &gt; Hi,
&gt; &gt; I am a newbe to felix and have been using java web
&gt; start for years. I found out via the OSGi forum that the
&gt; framework is not meant for inital deployment and recommended
&gt; staying with web start for that functionality.
&gt; &gt;
&gt; &gt; I am looking for a complete intial deployment and
&gt; update solution. Does Felix also provide the missing piece?
&gt; My goal is deploy like a regular app and update using OSGi
&gt; if possible.
&gt; &gt;
&gt; &gt; Any suggestions?
&gt; &gt;
&gt; &gt; Thanks,
&gt; &gt; -Tony
&gt; &gt;
&gt; &gt;
&gt; &gt;
&gt; &gt;
&gt; &gt;       
&gt; &gt;
&gt; &gt;
&gt; ---------------------------------------------------------------------
&gt; &gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; &gt; For additional commands, e-mail: users-help@felix.apache.org
&gt; &gt;
&gt; &gt;   
&gt; 
&gt; -- 
&gt; 
&gt; 
&gt; Ascert - Taking systems to the Edge
&gt; robw@ascert.com
&gt; +44 (0)20 7488 3470
&gt; www.ascert.com
&gt; 
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt; 
&gt; 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Deployment question...</title>
<author><name>Rob Walker &lt;robw@ascert.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B175090.1070900@ascert.com%3e"/>
<id>urn:uuid:%3c4B175090-1070900@ascert-com%3e</id>
<updated>2009-12-03T05:45:52Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Tony

It's possible to use both - a small "shim" launcher that deploys via 
WebStart and launches OSGi, which does the rest of your deployment and 
then manages updates afterwards. You'll need to write some code to do 
this, but it's possible.

-- Rob

Tony Anecito wrote:
&gt; Hi,
&gt; I am a newbe to felix and have been using java web start for years. I found out via the
OSGi forum that the framework is not meant for inital deployment and recommended staying with
web start for that functionality.
&gt;
&gt; I am looking for a complete intial deployment and update solution. Does Felix also provide
the missing piece? My goal is deploy like a regular app and update using OSGi if possible.
&gt;
&gt; Any suggestions?
&gt;
&gt; Thanks,
&gt; -Tony
&gt;
&gt;
&gt;
&gt;
&gt;       
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;
&gt;   

-- 


Ascert - Taking systems to the Edge
robw@ascert.com
+44 (0)20 7488 3470
www.ascert.com


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>Kris Pruden &lt;kpruden@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3cD39FEB28-382D-402E-9E83-DEB7C5D97043@gmail.com%3e"/>
<id>urn:uuid:%3cD39FEB28-382D-402E-9E83-DEB7C5D97043@gmail-com%3e</id>
<updated>2009-12-02T22:11:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Dec 2, 2009, at 1:46 PM, Ziegenlippe wrote:

&gt; I had some thoughts on that Osgi serialization issue.
&gt; If Osgi would disallow to place one and the same class name in  
&gt; different bundles (even just by convention) it would be always  
&gt; possible to find the proper bundle for an input data  stream.

Unfortunately, OSGi does not impose that restriction.  In fact, the  
ability for more than one bundle to provide or contain the "same"  
class (by FQN) is one of the key benefits of OSGi.

&gt; Class name + version (or serialId) would uniquely identify the class  
&gt; to be loaded. To add the bundle name to the stream does work but is  
&gt; somehow strange to me.

Fully-qualified class name plus the serial ID might be good enough to  
unambiguously identify a class, but I don't think it's guaranteed.   
Regardless of the approach, you need to get to a bundle, because  
that's how you get the classloader.  You could use a heuristic like  
this to search for the bundle, but for my application at least, it was  
a lot easier to just include the owning bundle name in the serialized  
form and use that on the other end.  I figure if you can influence the  
deserialization logic, you can probably also influence the  
serialization logic, so you may as well have them cooperate...

&gt; Having the same interface placed in different bundles seem to me  
&gt; quite mysterious. For the osgi framework interface package you could  
&gt; use for instance:
&gt; the felix bundle:      &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
&gt;     &lt;artifactId&gt;org.osgi.core&lt;/artifactId&gt;
&gt;     &lt;version&gt;1.4.0&lt;/version&gt;
&gt; or
&gt; the osgi bundle:
&gt;   &lt;groupId&gt;org.osgi&lt;/groupId&gt;
&gt;   &lt;artifactId&gt;org.osgi.core&lt;/artifactId&gt;
&gt;   &lt;version&gt;4.2.0&lt;/version&gt;
&gt; What for is this good? In my opinion there should be only one  
&gt; distribution bundle of an interface. This possibly would make also  
&gt; serialization easier?

One use case I know of for allowing this is to permit multiple  
versions of the same bundle to be loaded at the same time, to satisfy  
mutually-exclusive version dependencies of other (presumably)  
independent bundles.

I agree that this is an odd situation in which to find oneself.   
However, when it does happen, and it's not an accident or oversight,  
I'd imagine it's because the developers really had no other  
alternative.  The fact that OSGi can accommodate these scenarios at  
all (afaik no other java container has this level of flexibility) is a  
bit part of its appeal imo.

&gt; Since in Osgi you imports bundles not modules you wouldn't know how  
&gt; many redistributions of one and the same interface you have in your  
&gt; environment.
&gt; Bye,
&gt; Andy
&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>Ziegenlippe &lt;ziegenlippe@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B16E022.5090406@googlemail.com%3e"/>
<id>urn:uuid:%3c4B16E022-5090406@googlemail-com%3e</id>
<updated>2009-12-02T21:46:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I had some thoughts on that Osgi serialization issue.
If Osgi would disallow to place one and the same class name in different 
bundles (even just by convention) it would be always possible to find 
the proper bundle for an input data  stream.
Class name + version (or serialId) would uniquely identify the class to 
be loaded. To add the bundle name to the stream does work but is somehow 
strange to me.
Having the same interface placed in different bundles seem to me quite 
mysterious. For the osgi framework interface package you could use for 
instance:
the felix bundle:  
     &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
      &lt;artifactId&gt;org.osgi.core&lt;/artifactId&gt;
      &lt;version&gt;1.4.0&lt;/version&gt;
or
the osgi bundle:
    &lt;groupId&gt;org.osgi&lt;/groupId&gt;
    &lt;artifactId&gt;org.osgi.core&lt;/artifactId&gt;
    &lt;version&gt;4.2.0&lt;/version&gt;
What for is this good? In my opinion there should be only one 
distribution bundle of an interface. This possibly would make also 
serialization easier?
Since in Osgi you imports bundles not modules you wouldn't know how many 
redistributions of one and the same interface you have in your environment.
Bye,
Andy


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>Ziegenlippe &lt;ziegenlippe@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B16D4C8.3050300@googlemail.com%3e"/>
<id>urn:uuid:%3c4B16D4C8-3050300@googlemail-com%3e</id>
<updated>2009-12-02T20:57:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
A more concrete example would be if you want to store a JMS message. JMS 
provides an interface for Message and another interface Session in order 
to create it.
I guess the Message interface is always something to be exported whereas 
the real message type e.g. MantaMqMessage which implements this 
interface is private property.
So what I have is just a pointer to Message:
  Message msg=Session.createMessage(){
       return new MantaMqMessage();
  }
Serialization is no problem so far because you know the MantaMqMessage 
through reflection. But deserialization would have to create a 
MantaMqMessage instance but cannot find it since is secretly kept in 
some bundle classloader.
Bye,
Andy

Angelo vd Sijpt schrieb:
&gt; I'm not quite sure what you're trying to accomplish in that way...
&gt; If the references are not necessary when deserializing, make them transient.
&gt; If they are necessary, there's something peculiar about your design; is it
&gt; really necessary that they are implementations of some interface because
&gt; they're used as services, or are they actually just value objects?
&gt;
&gt; Angelo
&gt;
&gt; On Wed, Dec 2, 2009 at 10:49 AM, andrea ziege &lt;ziegenlippe@googlemail.com&gt;wrote:
&gt;
&gt;   
&gt;&gt; This is ok I do it the same way:
&gt;&gt;        XStream stream=new XStream();
&gt;&gt;        stream.setClassLoader(Activator.class.getClassLoader());
&gt;&gt;
&gt;&gt; My problem was that the class I serialize contains references to interfaces
&gt;&gt; which are visible from my bundle. But the implementation classes are
&gt;&gt; invisible. This isn't a problem for serialization but for deserialization.
&gt;&gt; So even DynamicImport doesn't work. So I would need to make the impl
&gt;&gt; classes
&gt;&gt; public visible. Which I'm not able in all cases and what is in my opinion a
&gt;&gt; dirty fix.
&gt;&gt; Bye,
&gt;&gt; Andy
&gt;&gt;
&gt;&gt; 2009/12/2 Angelo vd Sijpt &lt;angelovds@gmail.com&gt;
&gt;&gt;
&gt;&gt;     
&gt;&gt;&gt; Maybe I'm going down the wrong path here, but if your bundle B uses
&gt;&gt;&gt;       
&gt;&gt; XStream
&gt;&gt;     
&gt;&gt;&gt; too, you can make use of that.
&gt;&gt;&gt; XStream will by default use (I believe) the system classloader, and not
&gt;&gt;&gt;       
&gt;&gt; the
&gt;&gt;     
&gt;&gt;&gt; classloader of bundle B. You can make it use the correct one by passing
&gt;&gt;&gt; your
&gt;&gt;&gt; own classloader:
&gt;&gt;&gt;
&gt;&gt;&gt; new XStream(null, new XppDriver(), BundleBClass.class.getClassLoader());
&gt;&gt;&gt;
&gt;&gt;&gt; You should make sure BundleBClass is some class that is loaded by the
&gt;&gt;&gt; classloader of bundle B, since that has access to the imported classes
&gt;&gt;&gt;       
&gt;&gt; from
&gt;&gt;     
&gt;&gt;&gt; bundle A.
&gt;&gt;&gt;
&gt;&gt;&gt; Angelo
&gt;&gt;&gt;
&gt;&gt;&gt; On Tue, Dec 1, 2009 at 7:44 PM, Ziegenlippe &lt;ziegenlippe@googlemail.com
&gt;&gt;&gt;       
&gt;&gt;&gt;&gt; wrote:
&gt;&gt;&gt;&gt;         
&gt;&gt;&gt;&gt; Hello,
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I cannot find a satisfying solution to a simple looking problem for
&gt;&gt;&gt;&gt;         
&gt;&gt; quite
&gt;&gt;     
&gt;&gt;&gt; a
&gt;&gt;&gt;       
&gt;&gt;&gt;&gt; while.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; The condensation of the problem:
&gt;&gt;&gt;&gt; Bundle A
&gt;&gt;&gt;&gt;  the producer stores objects as xml files (e.g. with XStream)
&gt;&gt;&gt;&gt;  it exports the /bundle.a/ package which contains the interface /Item/
&gt;&gt;&gt;&gt;         
&gt;&gt;&gt;  it
&gt;&gt;&gt;       
&gt;&gt;&gt;&gt; contains a private implementation package /bundle.a.impl/ which
&gt;&gt;&gt;&gt;         
&gt;&gt; contains
&gt;&gt;     
&gt;&gt;&gt; the
&gt;&gt;&gt;       
&gt;&gt;&gt;&gt; item implementation class /ItemImpl/
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Bundle B
&gt;&gt;&gt;&gt;  the consumer needs to load and process /Item/ instances
&gt;&gt;&gt;&gt;  therefor it imports package /bundle.a/ which contains the /Item/
&gt;&gt;&gt;&gt;         
&gt;&gt;&gt; interface
&gt;&gt;&gt;       
&gt;&gt;&gt;&gt; Problem: loading Item instances in bundle B leads always to
&gt;&gt;&gt;&gt; ClassNotFoundExceptions
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Even working with the last resort /DynamicImport-Package: * / does not
&gt;&gt;&gt;&gt; solve the problem since it imports only exported packages.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; From some hints in the internet I got the feeling that this issue is
&gt;&gt;&gt;&gt;         
&gt;&gt; not
&gt;&gt;     
&gt;&gt;&gt;&gt; really solved for OSGI. Is there any solution known? How deal others
&gt;&gt;&gt;&gt;         
&gt;&gt; with
&gt;&gt;     
&gt;&gt;&gt;&gt; that issue e.g. ActiveMq which claims to be OSGI compliant.
&gt;&gt;&gt;&gt; Or am I just on the wrong way?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Thank you in advance,
&gt;&gt;&gt;&gt; Andy
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;         
&gt;
&gt;   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>Ziegenlippe &lt;ziegenlippe@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B16D157.80908@googlemail.com%3e"/>
<id>urn:uuid:%3c4B16D157-80908@googlemail-com%3e</id>
<updated>2009-12-02T20:43:03Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I gave it a trial and it really works. Seems to work in general or at 
least when you have the chance to replace the ObjectIn/OutputStream 
implementation (which is for god sake possible for Hazelcast).
Regarding dynamically going bundles I would say hasta la vista baby. If 
your classes are not available you cannot deserialize Osgi or plain Java 
there is no difference.
But on the other hand if you update bundles you may have newer and 
better classes available which are still compatible. This could be 
handled with Kris solution too. This nice PackageAdmin can give you 
bundles for version ranges. The only thing you need take care about is a 
proper version scheme e.g. like APR does or at least proposes: 
http://apr.apache.org/versioning.html. Than the deserializer would know 
up to which version it could go. I guess something like that is done 
with MS dot net. They have the module system integrated into the 
platform and I think there are version compatibility rules too.
Bye,
Andy



Mike Haney schrieb:
&gt; Kris - that's an interesting solution.  I'm not familiar enough with the
&gt; inner workings of serialization, but I wonder if it would be possible to do
&gt; this on a global level and package it into a bundle to provide this support
&gt; across the entire OSGi runtime?  That would be a decent partial solution to
&gt; the problem.  It still doesn't help the problem with bundles dynamically
&gt; coming and going, but should be sufficient for many use cases, for example
&gt; storing data to the HTTP session between request (a la Wicket).
&gt;
&gt; On Tue, Dec 1, 2009 at 3:11 PM, Kris Pruden &lt;kpruden@gmail.com&gt; wrote:
&gt;
&gt;   
&gt;&gt; On Dec 1, 2009, at 11:16 AM, Ziegenlippe wrote:
&gt;&gt;
&gt;&gt; Nice. Does this mean I have to take care about serialization by my own? I
&gt;&gt;     
&gt;&gt;&gt; use great libs XStream and Hazelcast. Both of them are doing a good
&gt;&gt;&gt; serialization job. But I see without bundle-id+version there is no way.
&gt;&gt;&gt; Thanks for the answer,
&gt;&gt;&gt;
&gt;&gt;&gt;       
&gt;&gt; Not necessarily.  Some libraries support the injection of custom hooks at
&gt;&gt; various stages of the serialization/deserialization process.
&gt;&gt;
&gt;&gt; As an example, I was able to create OSGi-aware versions of
&gt;&gt; Object{Output,Input}Stream by overriding the annotateClass() and
&gt;&gt; resolveClass() methods, respectively.
&gt;&gt;
&gt;&gt; I'm not familiar with XStream, but it wouldn't surprise me if it offered
&gt;&gt; some way to influence the class loading process..
&gt;&gt;
&gt;&gt; As for Hazelcast, I actually went down that path and got it to work by
&gt;&gt; registering custom serializers which used the OSGi-aware object streams I
&gt;&gt; talked about above.
&gt;&gt;
&gt;&gt; Here's the activator I used:
&gt;&gt;
&gt;&gt; package com.hazelcast.osgi;
&gt;&gt;
&gt;&gt; import org.osgi.framework.BundleActivator;
&gt;&gt; import org.osgi.framework.BundleContext;
&gt;&gt; import org.osgi.framework.ServiceReference;
&gt;&gt; import org.osgi.service.packageadmin.PackageAdmin;
&gt;&gt;
&gt;&gt; import com.hazelcast.core.Hazelcast;
&gt;&gt; import com.hazelcast.nio.Serializer;
&gt;&gt;
&gt;&gt; public class Activator implements BundleActivator {
&gt;&gt;    public void start(BundleContext context) throws Exception {
&gt;&gt;        ServiceReference ref =
&gt;&gt; context.getServiceReference(PackageAdmin.class.getName());
&gt;&gt;        PackageAdmin pkgAdmin = (PackageAdmin) context.getService(ref);
&gt;&gt;        Serializer.registerTypeSerializer(new OsgiObjectSerializer());
&gt;&gt;        Serializer.registerTypeSerializer(new OsgiDataSerializer(pkgAdmin));
&gt;&gt;    }
&gt;&gt;
&gt;&gt;    public void stop(BundleContext context) throws Exception {
&gt;&gt;        Serializer.registerTypeSerializer(new
&gt;&gt; Serializer.ObjectSerializer());
&gt;&gt;        Serializer.registerTypeSerializer(new Serializer.DataSerializer());
&gt;&gt;        Hazelcast.shutdown();
&gt;&gt;    }
&gt;&gt; }
&gt;&gt;
&gt;&gt; The implementations of OsgiObjectSerializer and OsgiDataSerializer are
&gt;&gt; pretty similar to the versions that come with Hazelcast; they simply inject
&gt;&gt; a bundle name into the stream during serialization, and during
&gt;&gt; deserialization use that name to lookup the bundle to use to load the
&gt;&gt; class..
&gt;&gt;
&gt;&gt; Kris
&gt;&gt;
&gt;&gt;
&gt;&gt; Andy
&gt;&gt;     
&gt;&gt;&gt; Kris Pruden schrieb:
&gt;&gt;&gt;
&gt;&gt;&gt;       
&gt;&gt;&gt;&gt; I had a similar problem.  The solution boils down to delegating to the
&gt;&gt;&gt;&gt; "owning" bundle to load the class.  To do this you need of course to know
&gt;&gt;&gt;&gt; the name of the bundle.  In my case I was able to solve this problem with
a
&gt;&gt;&gt;&gt; couple helper methods that wrap the PackageAdmin service provided by OSGi:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;   public String getBundleName(Class&lt;?&gt; cls) {
&gt;&gt;&gt;&gt;       Bundle bundle = pkgAdmin.getBundle(cls);
&gt;&gt;&gt;&gt;       if (bundle != null) {
&gt;&gt;&gt;&gt;           return bundle.getSymbolicName();
&gt;&gt;&gt;&gt;       } else {
&gt;&gt;&gt;&gt;           return null;
&gt;&gt;&gt;&gt;       }
&gt;&gt;&gt;&gt;   }
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;   public Class&lt;?&gt; loadClass(String className, String bundleName) throws
&gt;&gt;&gt;&gt; ClassNotFoundException {
&gt;&gt;&gt;&gt;       Bundle[] bundles = pkgAdmin.getBundles(bundleName, null);
&gt;&gt;&gt;&gt;       if (bundles == null || bundles.length == 0) {
&gt;&gt;&gt;&gt;           return null;
&gt;&gt;&gt;&gt;       }
&gt;&gt;&gt;&gt;       return bundles[0].loadClass(className);
&gt;&gt;&gt;&gt;   }
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; When serializing the object, you can use getBundleName to get the name of
&gt;&gt;&gt;&gt; the bundle which "owns" the class being serialized.  This name needs to be
&gt;&gt;&gt;&gt; included in the xml data you store.  Then on deserialization, loadClass
&gt;&gt;&gt;&gt; looks up the bundle by the name specified, then uses that bundle to load
the
&gt;&gt;&gt;&gt; class.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; This code assumes that there will be only one version of the bundle with
&gt;&gt;&gt;&gt; a given name present, but it would be fairly straightforward to extend this
&gt;&gt;&gt;&gt; to look at bundle versions if needed...
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; HTH...
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Kris
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; On Dec 1, 2009, at 10:44 AM, Ziegenlippe wrote:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Hello,
&gt;&gt;&gt;&gt;         
&gt;&gt;&gt;&gt;&gt; I cannot find a satisfying solution to a simple looking problem for
&gt;&gt;&gt;&gt;&gt; quite a while.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; The condensation of the problem:
&gt;&gt;&gt;&gt;&gt; Bundle A
&gt;&gt;&gt;&gt;&gt; the producer stores objects as xml files (e.g. with XStream)
&gt;&gt;&gt;&gt;&gt; it exports the /bundle.a/ package which contains the interface /Item/
&gt;&gt;&gt;&gt;&gt;  it contains a private implementation package /bundle.a.impl/ which contains
&gt;&gt;&gt;&gt;&gt; the item implementation class /ItemImpl/
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Bundle B
&gt;&gt;&gt;&gt;&gt; the consumer needs to load and process /Item/ instances
&gt;&gt;&gt;&gt;&gt; therefor it imports package /bundle.a/ which contains the /Item/
&gt;&gt;&gt;&gt;&gt; interface
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Problem: loading Item instances in bundle B leads always to
&gt;&gt;&gt;&gt;&gt; ClassNotFoundExceptions
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Even working with the last resort /DynamicImport-Package: * / does not
&gt;&gt;&gt;&gt;&gt; solve the problem since it imports only exported packages.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; From some hints in the internet I got the feeling that this issue is
not
&gt;&gt;&gt;&gt;&gt; really solved for OSGI. Is there any solution known? How deal others
with
&gt;&gt;&gt;&gt;&gt; that issue e.g. ActiveMq which claims to be OSGI compliant.
&gt;&gt;&gt;&gt;&gt; Or am I just on the wrong way?
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Thank you in advance,
&gt;&gt;&gt;&gt;&gt; Andy
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;           
&gt;&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt;&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;         
&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;       
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;
&gt;&gt;
&gt;&gt;     
&gt;
&gt;   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Deployment question...</title>
<author><name>Tony Anecito &lt;adanecito@yahoo.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c891987.27844.qm@web39805.mail.mud.yahoo.com%3e"/>
<id>urn:uuid:%3c891987-27844-qm@web39805-mail-mud-yahoo-com%3e</id>
<updated>2009-12-02T18:50:24Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,
I am a newbe to felix and have been using java web start for years. I found out via the OSGi
forum that the framework is not meant for inital deployment and recommended staying with web
start for that functionality.

I am looking for a complete intial deployment and update solution. Does Felix also provide
the missing piece? My goal is deploy like a regular app and update using OSGi if possible.

Any suggestions?

Thanks,
-Tony




      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: iPojo and valid components</title>
<author><name>Clement Escoffier &lt;clement.escoffier@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3cCADB5FEC-651D-4CF0-8ECF-ACB89B002EE1@gmail.com%3e"/>
<id>urn:uuid:%3cCADB5FEC-651D-4CF0-8ECF-ACB89B002EE1@gmail-com%3e</id>
<updated>2009-12-02T17:05:12Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,



On 02.12.2009, at 17:08, Sebastian Heib wrote:

&gt; Hi,
&gt; 
&gt; I have an iPojo component that asks the user for some input data. This data is then provided
as a service for other bundles. So far - no problem. But I only want to provide the data for
other components, AFTER the user entered something (so as soon as there is actually data available),
and not while the user is still entering data (as the provided data would be empty in this
case).
&gt; 
&gt; But as my component must be valid for the user to enter something, the service is also
immediately available. This results in the consuming component to get valid as well, but without
the actual data (this is NOT what I want, I want the consuming component to get valid as soon
as there is real data available). I tried to write a handler for this case that checks if
the user input data is actually valid. Is this the way to go? Or is there an easier way? How
can I re-check the provided service within my handler (currently I check it once in the 'start'
method, but how to I know if something changed on the service side?)?

There is several way to do that.
- Doing a handler will work obviously, but this is really dependent to your case.
- Using the lifecycle controller (@Controller) which allow you to invalid your instance until
the configuration (here the user input) is correct
- Having an instance taking the user input and when it's done, creating another instance (which
provides the service) with the user entry as parameter (i.e. configuration). Something like:


 @Requires(filter="factory.name=my.second.component")
 Factory myFactory;

    public void receiveUserInput(String input) {
        Properties conf = new Properties();
        conf.put("user.input", input);
        try {
            myFactory.createComponentInstance(conf);
        } catch (UnacceptableConfiguration e) {
            e.printStackTrace();
        } catch (MissingHandlerException e) {
            e.printStackTrace();
        } catch (ConfigurationException e) {
            e.printStackTrace();
        }
    }


Regards,

Clement

&gt; 
&gt; Thanks,
&gt; Sebastian
&gt; 
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt; 



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>Angelo vd Sijpt &lt;angelovds@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c3c9ae1680912020857j23796e56gd3fdd005af002f32@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3c9ae1680912020857j23796e56gd3fdd005af002f32@mail-gmail-com%3e</id>
<updated>2009-12-02T16:57:49Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
I'm not quite sure what you're trying to accomplish in that way...
If the references are not necessary when deserializing, make them transient.
If they are necessary, there's something peculiar about your design; is it
really necessary that they are implementations of some interface because
they're used as services, or are they actually just value objects?

Angelo

On Wed, Dec 2, 2009 at 10:49 AM, andrea ziege &lt;ziegenlippe@googlemail.com&gt;wrote:

&gt; This is ok I do it the same way:
&gt;        XStream stream=new XStream();
&gt;        stream.setClassLoader(Activator.class.getClassLoader());
&gt;
&gt; My problem was that the class I serialize contains references to interfaces
&gt; which are visible from my bundle. But the implementation classes are
&gt; invisible. This isn't a problem for serialization but for deserialization.
&gt; So even DynamicImport doesn't work. So I would need to make the impl
&gt; classes
&gt; public visible. Which I'm not able in all cases and what is in my opinion a
&gt; dirty fix.
&gt; Bye,
&gt; Andy
&gt;
&gt; 2009/12/2 Angelo vd Sijpt &lt;angelovds@gmail.com&gt;
&gt;
&gt; &gt; Maybe I'm going down the wrong path here, but if your bundle B uses
&gt; XStream
&gt; &gt; too, you can make use of that.
&gt; &gt; XStream will by default use (I believe) the system classloader, and not
&gt; the
&gt; &gt; classloader of bundle B. You can make it use the correct one by passing
&gt; &gt; your
&gt; &gt; own classloader:
&gt; &gt;
&gt; &gt; new XStream(null, new XppDriver(), BundleBClass.class.getClassLoader());
&gt; &gt;
&gt; &gt; You should make sure BundleBClass is some class that is loaded by the
&gt; &gt; classloader of bundle B, since that has access to the imported classes
&gt; from
&gt; &gt; bundle A.
&gt; &gt;
&gt; &gt; Angelo
&gt; &gt;
&gt; &gt; On Tue, Dec 1, 2009 at 7:44 PM, Ziegenlippe &lt;ziegenlippe@googlemail.com
&gt; &gt; &gt;wrote:
&gt; &gt;
&gt; &gt; &gt; Hello,
&gt; &gt; &gt;
&gt; &gt; &gt; I cannot find a satisfying solution to a simple looking problem for
&gt; quite
&gt; &gt; a
&gt; &gt; &gt; while.
&gt; &gt; &gt;
&gt; &gt; &gt; The condensation of the problem:
&gt; &gt; &gt; Bundle A
&gt; &gt; &gt;  the producer stores objects as xml files (e.g. with XStream)
&gt; &gt; &gt;  it exports the /bundle.a/ package which contains the interface /Item/
&gt; &gt;  it
&gt; &gt; &gt; contains a private implementation package /bundle.a.impl/ which
&gt; contains
&gt; &gt; the
&gt; &gt; &gt; item implementation class /ItemImpl/
&gt; &gt; &gt;
&gt; &gt; &gt; Bundle B
&gt; &gt; &gt;  the consumer needs to load and process /Item/ instances
&gt; &gt; &gt;  therefor it imports package /bundle.a/ which contains the /Item/
&gt; &gt; interface
&gt; &gt; &gt;
&gt; &gt; &gt; Problem: loading Item instances in bundle B leads always to
&gt; &gt; &gt; ClassNotFoundExceptions
&gt; &gt; &gt;
&gt; &gt; &gt; Even working with the last resort /DynamicImport-Package: * / does not
&gt; &gt; &gt; solve the problem since it imports only exported packages.
&gt; &gt; &gt;
&gt; &gt; &gt; From some hints in the internet I got the feeling that this issue is
&gt; not
&gt; &gt; &gt; really solved for OSGI. Is there any solution known? How deal others
&gt; with
&gt; &gt; &gt; that issue e.g. ActiveMq which claims to be OSGI compliant.
&gt; &gt; &gt; Or am I just on the wrong way?
&gt; &gt; &gt;
&gt; &gt; &gt; Thank you in advance,
&gt; &gt; &gt; Andy
&gt; &gt; &gt;
&gt; &gt; &gt;
&gt; &gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>iPojo and valid components</title>
<author><name>Sebastian Heib &lt;heib@synyx.de&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B1690F9.5020003@synyx.de%3e"/>
<id>urn:uuid:%3c4B1690F9-5020003@synyx-de%3e</id>
<updated>2009-12-02T16:08:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Hi,

I have an iPojo component that asks the user for some input data. This 
data is then provided as a service for other bundles. So far - no 
problem. But I only want to provide the data for other components, AFTER 
the user entered something (so as soon as there is actually data 
available), and not while the user is still entering data (as the 
provided data would be empty in this case).

But as my component must be valid for the user to enter something, the 
service is also immediately available. This results in the consuming 
component to get valid as well, but without the actual data (this is NOT 
what I want, I want the consuming component to get valid as soon as 
there is real data available). I tried to write a handler for this case 
that checks if the user input data is actually valid. Is this the way to 
go? Or is there an easier way? How can I re-check the provided service 
within my handler (currently I check it once in the 'start' method, but 
how to I know if something changed on the service side?)?

Thanks,
Sebastian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Felix framework build problem</title>
<author><name>Guo Du &lt;mrduguo@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ce2a35cbc0912020745u8e1900di3d956c3b35f14149@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce2a35cbc0912020745u8e1900di3d956c3b35f14149@mail-gmail-com%3e</id>
<updated>2009-12-02T15:45:48Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Wed, Dec 2, 2009 at 2:48 PM, Richard S. Hall &lt;heavy@ungoverned.org&gt; wrote:
&gt; Is RAT still incubating? If so, we will probably stay on the other release
&gt; until then.
There is a stable release from apache:
http://repo1.maven.org/maven2/org/apache/rat/apache-rat-plugin/0.6/
We don't need to change unless it's been broken or we need feature
from newer release.

&gt; In the meantime, I explicitly mention the version, so it should work now.
Thanks for the quick fix.

-Guo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Felix framework build problem</title>
<author><name>&quot;Richard S. Hall&quot; &lt;heavy@ungoverned.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c4B167E2F.5030006@ungoverned.org%3e"/>
<id>urn:uuid:%3c4B167E2F-5030006@ungoverned-org%3e</id>
<updated>2009-12-02T14:48:15Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Is RAT still incubating? If so, we will probably stay on the other 
release until then.

In the meantime, I explicitly mention the version, so it should work now.

-&gt; richard

On 12/2/09 5:12, Guo Du wrote:
&gt; On Tue, Dec 1, 2009 at 6:54 PM, Guo Du&lt;mrduguo@gmail.com&gt;  wrote:
&gt;    
&gt;&gt; The 1.0-alpha-3 is latest version of rat-maven-plugin which resolved
&gt;&gt; automatically. IN Nick's case, it was resolved to
&gt;&gt; 1.0-alpha-4-SNAPSHOT.
&gt;&gt;      
&gt; We probably should always use fixed artifact version for
&gt; plugin/dependencies instead of automatically resolve. Nick's problem
&gt; won't happen if we have fixed version associated with rat plugin. The
&gt; auto resolve are the main source to make maven build unreliable. We
&gt; may make sure current latest version works on our trunk code base, but
&gt; no confidence to tell it still works for next coming version.
&gt;
&gt; This practice was used in jackrabbit project as well:
&gt; http://svn.apache.org/repos/asf/jackrabbit/parent/trunk/pom.xml
&gt;
&gt; Just a suggestion, it will take time to do it :)
&gt;
&gt; -Guo
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;
&gt;    

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: Felix framework build problem</title>
<author><name>Guo Du &lt;mrduguo@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3ce2a35cbc0912020212i14f4912du23f8065d8d7c986c@mail.gmail.com%3e"/>
<id>urn:uuid:%3ce2a35cbc0912020212i14f4912du23f8065d8d7c986c@mail-gmail-com%3e</id>
<updated>2009-12-02T10:12:07Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Tue, Dec 1, 2009 at 6:54 PM, Guo Du &lt;mrduguo@gmail.com&gt; wrote:
&gt; The 1.0-alpha-3 is latest version of rat-maven-plugin which resolved
&gt; automatically. IN Nick's case, it was resolved to
&gt; 1.0-alpha-4-SNAPSHOT.
We probably should always use fixed artifact version for
plugin/dependencies instead of automatically resolve. Nick's problem
won't happen if we have fixed version associated with rat plugin. The
auto resolve are the main source to make maven build unreliable. We
may make sure current latest version works on our trunk code base, but
no confidence to tell it still works for next coming version.

This practice was used in jackrabbit project as well:
http://svn.apache.org/repos/asf/jackrabbit/parent/trunk/pom.xml

Just a suggestion, it will take time to do it :)

-Guo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>andrea ziege &lt;ziegenlippe@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3cc586d8f50912020149r6e3ff433sd46ec4322d5810cf@mail.gmail.com%3e"/>
<id>urn:uuid:%3cc586d8f50912020149r6e3ff433sd46ec4322d5810cf@mail-gmail-com%3e</id>
<updated>2009-12-02T09:49:06Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
This is ok I do it the same way:
        XStream stream=new XStream();
        stream.setClassLoader(Activator.class.getClassLoader());

My problem was that the class I serialize contains references to interfaces
which are visible from my bundle. But the implementation classes are
invisible. This isn't a problem for serialization but for deserialization.
So even DynamicImport doesn't work. So I would need to make the impl classes
public visible. Which I'm not able in all cases and what is in my opinion a
dirty fix.
Bye,
Andy

2009/12/2 Angelo vd Sijpt &lt;angelovds@gmail.com&gt;

&gt; Maybe I'm going down the wrong path here, but if your bundle B uses XStream
&gt; too, you can make use of that.
&gt; XStream will by default use (I believe) the system classloader, and not the
&gt; classloader of bundle B. You can make it use the correct one by passing
&gt; your
&gt; own classloader:
&gt;
&gt; new XStream(null, new XppDriver(), BundleBClass.class.getClassLoader());
&gt;
&gt; You should make sure BundleBClass is some class that is loaded by the
&gt; classloader of bundle B, since that has access to the imported classes from
&gt; bundle A.
&gt;
&gt; Angelo
&gt;
&gt; On Tue, Dec 1, 2009 at 7:44 PM, Ziegenlippe &lt;ziegenlippe@googlemail.com
&gt; &gt;wrote:
&gt;
&gt; &gt; Hello,
&gt; &gt;
&gt; &gt; I cannot find a satisfying solution to a simple looking problem for quite
&gt; a
&gt; &gt; while.
&gt; &gt;
&gt; &gt; The condensation of the problem:
&gt; &gt; Bundle A
&gt; &gt;  the producer stores objects as xml files (e.g. with XStream)
&gt; &gt;  it exports the /bundle.a/ package which contains the interface /Item/
&gt;  it
&gt; &gt; contains a private implementation package /bundle.a.impl/ which contains
&gt; the
&gt; &gt; item implementation class /ItemImpl/
&gt; &gt;
&gt; &gt; Bundle B
&gt; &gt;  the consumer needs to load and process /Item/ instances
&gt; &gt;  therefor it imports package /bundle.a/ which contains the /Item/
&gt; interface
&gt; &gt;
&gt; &gt; Problem: loading Item instances in bundle B leads always to
&gt; &gt; ClassNotFoundExceptions
&gt; &gt;
&gt; &gt; Even working with the last resort /DynamicImport-Package: * / does not
&gt; &gt; solve the problem since it imports only exported packages.
&gt; &gt;
&gt; &gt; From some hints in the internet I got the feeling that this issue is not
&gt; &gt; really solved for OSGI. Is there any solution known? How deal others with
&gt; &gt; that issue e.g. ActiveMq which claims to be OSGI compliant.
&gt; &gt; Or am I just on the wrong way?
&gt; &gt;
&gt; &gt; Thank you in advance,
&gt; &gt; Andy
&gt; &gt;
&gt; &gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>andrea ziege &lt;ziegenlippe@googlemail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3cc586d8f50912020102v6f3dbe58p2c99d7ccafb450d8@mail.gmail.com%3e"/>
<id>urn:uuid:%3cc586d8f50912020102v6f3dbe58p2c99d7ccafb450d8@mail-gmail-com%3e</id>
<updated>2009-12-02T09:02:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
The Hazelcast solution is quite ok and not to much effort. I like it.
Do the guys from Hazelcast know about it? They have an issue exactly for
that problem (http://code.google.com/p/hazelcast/issues/detail?id=161).
Thank you Kris.
Bye,
Andy


2009/12/1 Kris Pruden &lt;kpruden@gmail.com&gt;

&gt; On Dec 1, 2009, at 11:16 AM, Ziegenlippe wrote:
&gt;
&gt;  Nice. Does this mean I have to take care about serialization by my own? I
&gt;&gt; use great libs XStream and Hazelcast. Both of them are doing a good
&gt;&gt; serialization job. But I see without bundle-id+version there is no way.
&gt;&gt; Thanks for the answer,
&gt;&gt;
&gt;
&gt; Not necessarily.  Some libraries support the injection of custom hooks at
&gt; various stages of the serialization/deserialization process.
&gt;
&gt; As an example, I was able to create OSGi-aware versions of
&gt; Object{Output,Input}Stream by overriding the annotateClass() and
&gt; resolveClass() methods, respectively.
&gt;
&gt; I'm not familiar with XStream, but it wouldn't surprise me if it offered
&gt; some way to influence the class loading process..
&gt;
&gt; As for Hazelcast, I actually went down that path and got it to work by
&gt; registering custom serializers which used the OSGi-aware object streams I
&gt; talked about above.
&gt;
&gt; Here's the activator I used:
&gt;
&gt; package com.hazelcast.osgi;
&gt;
&gt; import org.osgi.framework.BundleActivator;
&gt; import org.osgi.framework.BundleContext;
&gt; import org.osgi.framework.ServiceReference;
&gt; import org.osgi.service.packageadmin.PackageAdmin;
&gt;
&gt; import com.hazelcast.core.Hazelcast;
&gt; import com.hazelcast.nio.Serializer;
&gt;
&gt; public class Activator implements BundleActivator {
&gt;    public void start(BundleContext context) throws Exception {
&gt;        ServiceReference ref =
&gt; context.getServiceReference(PackageAdmin.class.getName());
&gt;        PackageAdmin pkgAdmin = (PackageAdmin) context.getService(ref);
&gt;        Serializer.registerTypeSerializer(new OsgiObjectSerializer());
&gt;        Serializer.registerTypeSerializer(new OsgiDataSerializer(pkgAdmin));
&gt;    }
&gt;
&gt;    public void stop(BundleContext context) throws Exception {
&gt;        Serializer.registerTypeSerializer(new
&gt; Serializer.ObjectSerializer());
&gt;        Serializer.registerTypeSerializer(new Serializer.DataSerializer());
&gt;        Hazelcast.shutdown();
&gt;    }
&gt; }
&gt;
&gt; The implementations of OsgiObjectSerializer and OsgiDataSerializer are
&gt; pretty similar to the versions that come with Hazelcast; they simply inject
&gt; a bundle name into the stream during serialization, and during
&gt; deserialization use that name to lookup the bundle to use to load the
&gt; class..
&gt;
&gt; Kris
&gt;
&gt;
&gt;  Andy
&gt;&gt;
&gt;&gt;
&gt;&gt; Kris Pruden schrieb:
&gt;&gt;
&gt;&gt;&gt; I had a similar problem.  The solution boils down to delegating to the
&gt;&gt;&gt; "owning" bundle to load the class.  To do this you need of course to know
&gt;&gt;&gt; the name of the bundle.  In my case I was able to solve this problem with a
&gt;&gt;&gt; couple helper methods that wrap the PackageAdmin service provided by OSGi:
&gt;&gt;&gt;
&gt;&gt;&gt;   public String getBundleName(Class&lt;?&gt; cls) {
&gt;&gt;&gt;       Bundle bundle = pkgAdmin.getBundle(cls);
&gt;&gt;&gt;       if (bundle != null) {
&gt;&gt;&gt;           return bundle.getSymbolicName();
&gt;&gt;&gt;       } else {
&gt;&gt;&gt;           return null;
&gt;&gt;&gt;       }
&gt;&gt;&gt;   }
&gt;&gt;&gt;
&gt;&gt;&gt;   public Class&lt;?&gt; loadClass(String className, String bundleName) throws
&gt;&gt;&gt; ClassNotFoundException {
&gt;&gt;&gt;       Bundle[] bundles = pkgAdmin.getBundles(bundleName, null);
&gt;&gt;&gt;       if (bundles == null || bundles.length == 0) {
&gt;&gt;&gt;           return null;
&gt;&gt;&gt;       }
&gt;&gt;&gt;       return bundles[0].loadClass(className);
&gt;&gt;&gt;   }
&gt;&gt;&gt;
&gt;&gt;&gt; When serializing the object, you can use getBundleName to get the name of
&gt;&gt;&gt; the bundle which "owns" the class being serialized.  This name needs to be
&gt;&gt;&gt; included in the xml data you store.  Then on deserialization, loadClass
&gt;&gt;&gt; looks up the bundle by the name specified, then uses that bundle to load the
&gt;&gt;&gt; class.
&gt;&gt;&gt;
&gt;&gt;&gt; This code assumes that there will be only one version of the bundle with
&gt;&gt;&gt; a given name present, but it would be fairly straightforward to extend this
&gt;&gt;&gt; to look at bundle versions if needed...
&gt;&gt;&gt;
&gt;&gt;&gt; HTH...
&gt;&gt;&gt;
&gt;&gt;&gt; Kris
&gt;&gt;&gt;
&gt;&gt;&gt; On Dec 1, 2009, at 10:44 AM, Ziegenlippe wrote:
&gt;&gt;&gt;
&gt;&gt;&gt;  Hello,
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I cannot find a satisfying solution to a simple looking problem for
&gt;&gt;&gt;&gt; quite a while.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; The condensation of the problem:
&gt;&gt;&gt;&gt; Bundle A
&gt;&gt;&gt;&gt; the producer stores objects as xml files (e.g. with XStream)
&gt;&gt;&gt;&gt; it exports the /bundle.a/ package which contains the interface /Item/
&gt;&gt;&gt;&gt;  it contains a private implementation package /bundle.a.impl/ which contains
&gt;&gt;&gt;&gt; the item implementation class /ItemImpl/
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Bundle B
&gt;&gt;&gt;&gt; the consumer needs to load and process /Item/ instances
&gt;&gt;&gt;&gt; therefor it imports package /bundle.a/ which contains the /Item/
&gt;&gt;&gt;&gt; interface
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Problem: loading Item instances in bundle B leads always to
&gt;&gt;&gt;&gt; ClassNotFoundExceptions
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Even working with the last resort /DynamicImport-Package: * / does not
&gt;&gt;&gt;&gt; solve the problem since it imports only exported packages.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; From some hints in the internet I got the feeling that this issue is not
&gt;&gt;&gt;&gt; really solved for OSGI. Is there any solution known? How deal others with
&gt;&gt;&gt;&gt; that issue e.g. ActiveMq which claims to be OSGI compliant.
&gt;&gt;&gt;&gt; Or am I just on the wrong way?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Thank you in advance,
&gt;&gt;&gt;&gt; Andy
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;
&gt;&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>Angelo vd Sijpt &lt;angelovds@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c3c9ae1680912011507j508d8813k5e3acb4c5cb3e72b@mail.gmail.com%3e"/>
<id>urn:uuid:%3c3c9ae1680912011507j508d8813k5e3acb4c5cb3e72b@mail-gmail-com%3e</id>
<updated>2009-12-01T23:07:17Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Maybe I'm going down the wrong path here, but if your bundle B uses XStream
too, you can make use of that.
XStream will by default use (I believe) the system classloader, and not the
classloader of bundle B. You can make it use the correct one by passing your
own classloader:

new XStream(null, new XppDriver(), BundleBClass.class.getClassLoader());

You should make sure BundleBClass is some class that is loaded by the
classloader of bundle B, since that has access to the imported classes from
bundle A.

Angelo

On Tue, Dec 1, 2009 at 7:44 PM, Ziegenlippe &lt;ziegenlippe@googlemail.com&gt;wrote:

&gt; Hello,
&gt;
&gt; I cannot find a satisfying solution to a simple looking problem for quite a
&gt; while.
&gt;
&gt; The condensation of the problem:
&gt; Bundle A
&gt;  the producer stores objects as xml files (e.g. with XStream)
&gt;  it exports the /bundle.a/ package which contains the interface /Item/  it
&gt; contains a private implementation package /bundle.a.impl/ which contains the
&gt; item implementation class /ItemImpl/
&gt;
&gt; Bundle B
&gt;  the consumer needs to load and process /Item/ instances
&gt;  therefor it imports package /bundle.a/ which contains the /Item/ interface
&gt;
&gt; Problem: loading Item instances in bundle B leads always to
&gt; ClassNotFoundExceptions
&gt;
&gt; Even working with the last resort /DynamicImport-Package: * / does not
&gt; solve the problem since it imports only exported packages.
&gt;
&gt; From some hints in the internet I got the feeling that this issue is not
&gt; really solved for OSGI. Is there any solution known? How deal others with
&gt; that issue e.g. ActiveMq which claims to be OSGI compliant.
&gt; Or am I just on the wrong way?
&gt;
&gt; Thank you in advance,
&gt; Andy
&gt;
&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>Kris Pruden &lt;kpruden@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3cE0B5077B-74D9-4C33-A489-F2EA69E2ED3A@gmail.com%3e"/>
<id>urn:uuid:%3cE0B5077B-74D9-4C33-A489-F2EA69E2ED3A@gmail-com%3e</id>
<updated>2009-12-01T21:27:25Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
On Dec 1, 2009, at 1:16 PM, Mike Haney wrote:

&gt; Kris - that's an interesting solution.  I'm not familiar enough with  
&gt; the
&gt; inner workings of serialization, but I wonder if it would be  
&gt; possible to do
&gt; this on a global level and package it into a bundle to provide this  
&gt; support
&gt; across the entire OSGi runtime?  That would be a decent partial  
&gt; solution to
&gt; the problem.  It still doesn't help the problem with bundles  
&gt; dynamically
&gt; coming and going, but should be sufficient for many use cases, for  
&gt; example
&gt; storing data to the HTTP session between request (a la Wicket).

I thought about that, but in the Object{Input,Ouput}Stream cases at  
least, for this solution to work you must use a different class.  In  
other words, You must explicitly use OsgiObjectOutputStream and its  
counterpart for this to work.  I haven't figured out a way to make the  
included-with-java versions to work.  I suppose one could resort to a  
boot agent that simply replaces the implementations of these classes  
with OSGi-aware versions might work.

I think the more general case is harder.  Any logic that explicitly  
loads classes (as all serialization mechanisms must ultimately do)  
pretty much has to be OSGi-aware, or support the injection of OSGi- 
aware hooks.  Luckily, most well-designed libraries seem to support  
this (interestingly, the java.io object streams are *not* well- 
designed in this regard).  So, while it may never be possible to  
provide a library-independent solution to this problem, it should be  
possible with some work to make a given library work with OSGi in such  
a way that at least the clients of that library don't need to do any  
extra work.

Hopefully as OSGi catches on more of these libraries will natively  
support it...

Kris

&gt; On Tue, Dec 1, 2009 at 3:11 PM, Kris Pruden &lt;kpruden@gmail.com&gt; wrote:
&gt;
&gt;&gt; On Dec 1, 2009, at 11:16 AM, Ziegenlippe wrote:
&gt;&gt;
&gt;&gt; Nice. Does this mean I have to take care about serialization by my  
&gt;&gt; own? I
&gt;&gt;&gt; use great libs XStream and Hazelcast. Both of them are doing a good
&gt;&gt;&gt; serialization job. But I see without bundle-id+version there is no  
&gt;&gt;&gt; way.
&gt;&gt;&gt; Thanks for the answer,
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; Not necessarily.  Some libraries support the injection of custom  
&gt;&gt; hooks at
&gt;&gt; various stages of the serialization/deserialization process.
&gt;&gt;
&gt;&gt; As an example, I was able to create OSGi-aware versions of
&gt;&gt; Object{Output,Input}Stream by overriding the annotateClass() and
&gt;&gt; resolveClass() methods, respectively.
&gt;&gt;
&gt;&gt; I'm not familiar with XStream, but it wouldn't surprise me if it  
&gt;&gt; offered
&gt;&gt; some way to influence the class loading process..
&gt;&gt;
&gt;&gt; As for Hazelcast, I actually went down that path and got it to work  
&gt;&gt; by
&gt;&gt; registering custom serializers which used the OSGi-aware object  
&gt;&gt; streams I
&gt;&gt; talked about above.
&gt;&gt;
&gt;&gt; Here's the activator I used:
&gt;&gt;
&gt;&gt; package com.hazelcast.osgi;
&gt;&gt;
&gt;&gt; import org.osgi.framework.BundleActivator;
&gt;&gt; import org.osgi.framework.BundleContext;
&gt;&gt; import org.osgi.framework.ServiceReference;
&gt;&gt; import org.osgi.service.packageadmin.PackageAdmin;
&gt;&gt;
&gt;&gt; import com.hazelcast.core.Hazelcast;
&gt;&gt; import com.hazelcast.nio.Serializer;
&gt;&gt;
&gt;&gt; public class Activator implements BundleActivator {
&gt;&gt;   public void start(BundleContext context) throws Exception {
&gt;&gt;       ServiceReference ref =
&gt;&gt; context.getServiceReference(PackageAdmin.class.getName());
&gt;&gt;       PackageAdmin pkgAdmin = (PackageAdmin) context.getService(ref);
&gt;&gt;       Serializer.registerTypeSerializer(new OsgiObjectSerializer());
&gt;&gt;       Serializer.registerTypeSerializer(new  
&gt;&gt; OsgiDataSerializer(pkgAdmin));
&gt;&gt;   }
&gt;&gt;
&gt;&gt;   public void stop(BundleContext context) throws Exception {
&gt;&gt;       Serializer.registerTypeSerializer(new
&gt;&gt; Serializer.ObjectSerializer());
&gt;&gt;       Serializer.registerTypeSerializer(new  
&gt;&gt; Serializer.DataSerializer());
&gt;&gt;       Hazelcast.shutdown();
&gt;&gt;   }
&gt;&gt; }
&gt;&gt;
&gt;&gt; The implementations of OsgiObjectSerializer and OsgiDataSerializer  
&gt;&gt; are
&gt;&gt; pretty similar to the versions that come with Hazelcast; they  
&gt;&gt; simply inject
&gt;&gt; a bundle name into the stream during serialization, and during
&gt;&gt; deserialization use that name to lookup the bundle to use to load the
&gt;&gt; class..
&gt;&gt;
&gt;&gt; Kris
&gt;&gt;
&gt;&gt;
&gt;&gt; Andy
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; Kris Pruden schrieb:
&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I had a similar problem.  The solution boils down to delegating  
&gt;&gt;&gt;&gt; to the
&gt;&gt;&gt;&gt; "owning" bundle to load the class.  To do this you need of course  
&gt;&gt;&gt;&gt; to know
&gt;&gt;&gt;&gt; the name of the bundle.  In my case I was able to solve this  
&gt;&gt;&gt;&gt; problem with a
&gt;&gt;&gt;&gt; couple helper methods that wrap the PackageAdmin service provided  
&gt;&gt;&gt;&gt; by OSGi:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;  public String getBundleName(Class&lt;?&gt; cls) {
&gt;&gt;&gt;&gt;      Bundle bundle = pkgAdmin.getBundle(cls);
&gt;&gt;&gt;&gt;      if (bundle != null) {
&gt;&gt;&gt;&gt;          return bundle.getSymbolicName();
&gt;&gt;&gt;&gt;      } else {
&gt;&gt;&gt;&gt;          return null;
&gt;&gt;&gt;&gt;      }
&gt;&gt;&gt;&gt;  }
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;  public Class&lt;?&gt; loadClass(String className, String bundleName)  
&gt;&gt;&gt;&gt; throws
&gt;&gt;&gt;&gt; ClassNotFoundException {
&gt;&gt;&gt;&gt;      Bundle[] bundles = pkgAdmin.getBundles(bundleName, null);
&gt;&gt;&gt;&gt;      if (bundles == null || bundles.length == 0) {
&gt;&gt;&gt;&gt;          return null;
&gt;&gt;&gt;&gt;      }
&gt;&gt;&gt;&gt;      return bundles[0].loadClass(className);
&gt;&gt;&gt;&gt;  }
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; When serializing the object, you can use getBundleName to get the  
&gt;&gt;&gt;&gt; name of
&gt;&gt;&gt;&gt; the bundle which "owns" the class being serialized.  This name  
&gt;&gt;&gt;&gt; needs to be
&gt;&gt;&gt;&gt; included in the xml data you store.  Then on deserialization,  
&gt;&gt;&gt;&gt; loadClass
&gt;&gt;&gt;&gt; looks up the bundle by the name specified, then uses that bundle  
&gt;&gt;&gt;&gt; to load the
&gt;&gt;&gt;&gt; class.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; This code assumes that there will be only one version of the  
&gt;&gt;&gt;&gt; bundle with
&gt;&gt;&gt;&gt; a given name present, but it would be fairly straightforward to  
&gt;&gt;&gt;&gt; extend this
&gt;&gt;&gt;&gt; to look at bundle versions if needed...
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; HTH...
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Kris
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; On Dec 1, 2009, at 10:44 AM, Ziegenlippe wrote:
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Hello,
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; I cannot find a satisfying solution to a simple looking problem  
&gt;&gt;&gt;&gt;&gt; for
&gt;&gt;&gt;&gt;&gt; quite a while.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; The condensation of the problem:
&gt;&gt;&gt;&gt;&gt; Bundle A
&gt;&gt;&gt;&gt;&gt; the producer stores objects as xml files (e.g. with XStream)
&gt;&gt;&gt;&gt;&gt; it exports the /bundle.a/ package which contains the interface / 
&gt;&gt;&gt;&gt;&gt; Item/
&gt;&gt;&gt;&gt;&gt; it contains a private implementation package /bundle.a.impl/  
&gt;&gt;&gt;&gt;&gt; which contains
&gt;&gt;&gt;&gt;&gt; the item implementation class /ItemImpl/
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Bundle B
&gt;&gt;&gt;&gt;&gt; the consumer needs to load and process /Item/ instances
&gt;&gt;&gt;&gt;&gt; therefor it imports package /bundle.a/ which contains the /Item/
&gt;&gt;&gt;&gt;&gt; interface
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Problem: loading Item instances in bundle B leads always to
&gt;&gt;&gt;&gt;&gt; ClassNotFoundExceptions
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Even working with the last resort /DynamicImport-Package: * /  
&gt;&gt;&gt;&gt;&gt; does not
&gt;&gt;&gt;&gt;&gt; solve the problem since it imports only exported packages.
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; From some hints in the internet I got the feeling that this  
&gt;&gt;&gt;&gt;&gt; issue is not
&gt;&gt;&gt;&gt;&gt; really solved for OSGI. Is there any solution known? How deal  
&gt;&gt;&gt;&gt;&gt; others with
&gt;&gt;&gt;&gt;&gt; that issue e.g. ActiveMq which claims to be OSGI compliant.
&gt;&gt;&gt;&gt;&gt; Or am I just on the wrong way?
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt; Thank you in advance,
&gt;&gt;&gt;&gt;&gt; Andy
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt;&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;
&gt;&gt;


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org



</pre>
</div>
</content>
</entry>
<entry>
<title>Re: OSGI Deserialization</title>
<author><name>Mike Haney &lt;txmikester@gmail.com&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/felix-users/200912.mbox/%3c7aa9fe390912011316s523e0003s4b5399f5eee45a44@mail.gmail.com%3e"/>
<id>urn:uuid:%3c7aa9fe390912011316s523e0003s4b5399f5eee45a44@mail-gmail-com%3e</id>
<updated>2009-12-01T21:16:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Kris - that's an interesting solution.  I'm not familiar enough with the
inner workings of serialization, but I wonder if it would be possible to do
this on a global level and package it into a bundle to provide this support
across the entire OSGi runtime?  That would be a decent partial solution to
the problem.  It still doesn't help the problem with bundles dynamically
coming and going, but should be sufficient for many use cases, for example
storing data to the HTTP session between request (a la Wicket).

On Tue, Dec 1, 2009 at 3:11 PM, Kris Pruden &lt;kpruden@gmail.com&gt; wrote:

&gt; On Dec 1, 2009, at 11:16 AM, Ziegenlippe wrote:
&gt;
&gt; Nice. Does this mean I have to take care about serialization by my own? I
&gt;&gt; use great libs XStream and Hazelcast. Both of them are doing a good
&gt;&gt; serialization job. But I see without bundle-id+version there is no way.
&gt;&gt; Thanks for the answer,
&gt;&gt;
&gt;
&gt; Not necessarily.  Some libraries support the injection of custom hooks at
&gt; various stages of the serialization/deserialization process.
&gt;
&gt; As an example, I was able to create OSGi-aware versions of
&gt; Object{Output,Input}Stream by overriding the annotateClass() and
&gt; resolveClass() methods, respectively.
&gt;
&gt; I'm not familiar with XStream, but it wouldn't surprise me if it offered
&gt; some way to influence the class loading process..
&gt;
&gt; As for Hazelcast, I actually went down that path and got it to work by
&gt; registering custom serializers which used the OSGi-aware object streams I
&gt; talked about above.
&gt;
&gt; Here's the activator I used:
&gt;
&gt; package com.hazelcast.osgi;
&gt;
&gt; import org.osgi.framework.BundleActivator;
&gt; import org.osgi.framework.BundleContext;
&gt; import org.osgi.framework.ServiceReference;
&gt; import org.osgi.service.packageadmin.PackageAdmin;
&gt;
&gt; import com.hazelcast.core.Hazelcast;
&gt; import com.hazelcast.nio.Serializer;
&gt;
&gt; public class Activator implements BundleActivator {
&gt;    public void start(BundleContext context) throws Exception {
&gt;        ServiceReference ref =
&gt; context.getServiceReference(PackageAdmin.class.getName());
&gt;        PackageAdmin pkgAdmin = (PackageAdmin) context.getService(ref);
&gt;        Serializer.registerTypeSerializer(new OsgiObjectSerializer());
&gt;        Serializer.registerTypeSerializer(new OsgiDataSerializer(pkgAdmin));
&gt;    }
&gt;
&gt;    public void stop(BundleContext context) throws Exception {
&gt;        Serializer.registerTypeSerializer(new
&gt; Serializer.ObjectSerializer());
&gt;        Serializer.registerTypeSerializer(new Serializer.DataSerializer());
&gt;        Hazelcast.shutdown();
&gt;    }
&gt; }
&gt;
&gt; The implementations of OsgiObjectSerializer and OsgiDataSerializer are
&gt; pretty similar to the versions that come with Hazelcast; they simply inject
&gt; a bundle name into the stream during serialization, and during
&gt; deserialization use that name to lookup the bundle to use to load the
&gt; class..
&gt;
&gt; Kris
&gt;
&gt;
&gt; Andy
&gt;&gt;
&gt;&gt;
&gt;&gt; Kris Pruden schrieb:
&gt;&gt;
&gt;&gt;&gt; I had a similar problem.  The solution boils down to delegating to the
&gt;&gt;&gt; "owning" bundle to load the class.  To do this you need of course to know
&gt;&gt;&gt; the name of the bundle.  In my case I was able to solve this problem with a
&gt;&gt;&gt; couple helper methods that wrap the PackageAdmin service provided by OSGi:
&gt;&gt;&gt;
&gt;&gt;&gt;   public String getBundleName(Class&lt;?&gt; cls) {
&gt;&gt;&gt;       Bundle bundle = pkgAdmin.getBundle(cls);
&gt;&gt;&gt;       if (bundle != null) {
&gt;&gt;&gt;           return bundle.getSymbolicName();
&gt;&gt;&gt;       } else {
&gt;&gt;&gt;           return null;
&gt;&gt;&gt;       }
&gt;&gt;&gt;   }
&gt;&gt;&gt;
&gt;&gt;&gt;   public Class&lt;?&gt; loadClass(String className, String bundleName) throws
&gt;&gt;&gt; ClassNotFoundException {
&gt;&gt;&gt;       Bundle[] bundles = pkgAdmin.getBundles(bundleName, null);
&gt;&gt;&gt;       if (bundles == null || bundles.length == 0) {
&gt;&gt;&gt;           return null;
&gt;&gt;&gt;       }
&gt;&gt;&gt;       return bundles[0].loadClass(className);
&gt;&gt;&gt;   }
&gt;&gt;&gt;
&gt;&gt;&gt; When serializing the object, you can use getBundleName to get the name of
&gt;&gt;&gt; the bundle which "owns" the class being serialized.  This name needs to be
&gt;&gt;&gt; included in the xml data you store.  Then on deserialization, loadClass
&gt;&gt;&gt; looks up the bundle by the name specified, then uses that bundle to load the
&gt;&gt;&gt; class.
&gt;&gt;&gt;
&gt;&gt;&gt; This code assumes that there will be only one version of the bundle with
&gt;&gt;&gt; a given name present, but it would be fairly straightforward to extend this
&gt;&gt;&gt; to look at bundle versions if needed...
&gt;&gt;&gt;
&gt;&gt;&gt; HTH...
&gt;&gt;&gt;
&gt;&gt;&gt; Kris
&gt;&gt;&gt;
&gt;&gt;&gt; On Dec 1, 2009, at 10:44 AM, Ziegenlippe wrote:
&gt;&gt;&gt;
&gt;&gt;&gt; Hello,
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; I cannot find a satisfying solution to a simple looking problem for
&gt;&gt;&gt;&gt; quite a while.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; The condensation of the problem:
&gt;&gt;&gt;&gt; Bundle A
&gt;&gt;&gt;&gt; the producer stores objects as xml files (e.g. with XStream)
&gt;&gt;&gt;&gt; it exports the /bundle.a/ package which contains the interface /Item/
&gt;&gt;&gt;&gt;  it contains a private implementation package /bundle.a.impl/ which contains
&gt;&gt;&gt;&gt; the item implementation class /ItemImpl/
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Bundle B
&gt;&gt;&gt;&gt; the consumer needs to load and process /Item/ instances
&gt;&gt;&gt;&gt; therefor it imports package /bundle.a/ which contains the /Item/
&gt;&gt;&gt;&gt; interface
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Problem: loading Item instances in bundle B leads always to
&gt;&gt;&gt;&gt; ClassNotFoundExceptions
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Even working with the last resort /DynamicImport-Package: * / does not
&gt;&gt;&gt;&gt; solve the problem since it imports only exported packages.
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; From some hints in the internet I got the feeling that this issue is not
&gt;&gt;&gt;&gt; really solved for OSGI. Is there any solution known? How deal others with
&gt;&gt;&gt;&gt; that issue e.g. ActiveMq which claims to be OSGI compliant.
&gt;&gt;&gt;&gt; Or am I just on the wrong way?
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt; Thank you in advance,
&gt;&gt;&gt;&gt; Andy
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt; ---------------------------------------------------------------------
&gt;&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt;&gt;
&gt;&gt; ---------------------------------------------------------------------
&gt;&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt;&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;&gt;
&gt;&gt;
&gt;
&gt; ---------------------------------------------------------------------
&gt; To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
&gt; For additional commands, e-mail: users-help@felix.apache.org
&gt;
&gt;


</pre>
</div>
</content>
</entry>
</feed>
