You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Konstantine Kougios <Ko...@akqa.com> on 2014/09/12 17:02:44 UTC

bundle B can't see changes of classes of bundle A

Hi,

I am trying to sort out a very weird issue for a few hours now. I got 2 bundles, A and B.

A has a class JsonObject and B has tests that run on the server (via sling-junit). So when I change a class in A and deploy it via mvn/mvn-sling-plugin , my B bundle doesn’t see the change. If I refresh B or stop/start B, again it doesn’t see the change of JsonObject. Only a mvn clean install fixes the issue.

I’ve checked both bundle jar files to see if there are duplicate classes or maybe B includes A.jar, but no, the jars seem proper.

Any ideas?

Thanks,

Kostas

Re: bundle B can't see changes of classes of bundle A

Posted by Al...@grassvalley.com.
it is not a bug. They do that feature in BND to allow service providers to 
export their APIs as well. Me, I find this creates more problems by 
accidentally including classes you didn't mean to (like in your case) than 
the case where you export and package something from another bundle. This 
is specially problematic when you run your bundles exploded (before BND 
has the chance to create the jar by bringing the external classes, so you 
get a bunch of ClassNotFoundException since the manifest has the 
export-packages but they bytecode is not there) 
If you want more details check this
http://stackoverflow.com/questions/23368960/exporting-api-from-implementation-bundle

Alejandro Endo | Software Designer/Concepteur de logiciels 




From:   Konstantine Kougios <Ko...@akqa.com>
To:     Neil Bartlett <nj...@gmail.com>, "users@felix.apache.org" 
<us...@felix.apache.org>, 
Date:   2014-09-12 12:29 PM
Subject:        Re: bundle B can't see changes of classes of bundle A



I found the issue, it was a problem in one of my bundle?s pom file, it did 
<Export-Package> a root level package and this made maven include ALL 
classes for that package into the jar (not only the ones of the bundle but 
classes from other bundles)!

Is that to be considered a bug of maven-bundle-plugin or just my bad?

Thanks,

Kostas

From: Neil Bartlett <nj...@gmail.com>>
Date: Friday, 12 September 2014 16:58
To: "users@felix.apache.org<ma...@felix.apache.org>" 
<us...@felix.apache.org>>, Konstantine 
Kougios <konstantine.kougios@akqa.com<mailto:konstantine.kougios@akqa.com
>>
Subject: Re: bundle B can't see changes of classes of bundle A

How do you perform the bundle update? If you do not refresh packages, then 
bundle B will remain wired to the old version of bundle A? this is true 
even if you uninstall bundle A.

After any mutation of the set of installed bundles, it is essential to 
perform a package refresh.

Regards,
Neil



On 12 September 2014 at 16:52:36, Konstantine Kougios 
(konstantine.kougios@akqa.com<ma...@akqa.com>) wrote:

So lets say I modify the toString method of a class in A. Then B when 
using the toString(), it gets the old value (the one before A was 
modified)

Also, I can uninstall A but B still works! And I?ve verified B.jar doesn?t 
include A classes or A.jar.

Thanks,

Kostas


From: Neil Bartlett <nj...@gmail.com>>
Date: Friday, 12 September 2014 16:49
To: "users@felix.apache.org<ma...@felix.apache.org>" 
<us...@felix.apache.org>>, Konstantine 
Kougios <konstantine.kougios@akqa.com<mailto:konstantine.kougios@akqa.com
>>
Subject: Re: bundle B can't see changes of classes of bundle A

Can you be more specific about what this phrase means: ?bundle doesn?t see 
the change?? It?s best to describe exactly what behaviour you expected, 
then how the actual behaviour differed from that.

Kind regards,
Neil



On 12 September 2014 at 16:03:16, Konstantine Kougios 
(konstantine.kougios@akqa.com<ma...@akqa.com>) wrote:

Hi,

I am trying to sort out a very weird issue for a few hours now. I got 2 
bundles, A and B.

A has a class JsonObject and B has tests that run on the server (via 
sling-junit). So when I change a class in A and deploy it via 
mvn/mvn-sling-plugin , my B bundle doesn?t see the change. If I refresh B 
or stop/start B, again it doesn?t see the change of JsonObject. Only a mvn 
clean install fixes the issue.

I?ve checked both bundle jar files to see if there are duplicate classes 
or maybe B includes A.jar, but no, the jars seem proper.

Any ideas?

Thanks,

Kostas


DISCLAIMER:
Privileged and/or Confidential information may be contained in this
message. If you are not the addressee of this message, you may not
copy, use or deliver this message to anyone. In such event, you
should destroy the message and kindly notify the sender by reply
e-mail. It is understood that opinions or conclusions that do not
relate to the official business of the company are neither given
nor endorsed by the company.
Thank You.

Re: bundle B can't see changes of classes of bundle A

Posted by Konstantine Kougios <Ko...@akqa.com>.
I found the issue, it was a problem in one of my bundle’s pom file, it did <Export-Package> a root level package and this made maven include ALL classes for that package into the jar (not only the ones of the bundle but classes from other bundles)!

Is that to be considered a bug of maven-bundle-plugin or just my bad?

Thanks,

Kostas

From: Neil Bartlett <nj...@gmail.com>>
Date: Friday, 12 September 2014 16:58
To: "users@felix.apache.org<ma...@felix.apache.org>" <us...@felix.apache.org>>, Konstantine Kougios <ko...@akqa.com>>
Subject: Re: bundle B can't see changes of classes of bundle A

How do you perform the bundle update? If you do not refresh packages, then bundle B will remain wired to the old version of bundle A… this is true even if you uninstall bundle A.

After any mutation of the set of installed bundles, it is essential to perform a package refresh.

Regards,
Neil



On 12 September 2014 at 16:52:36, Konstantine Kougios (konstantine.kougios@akqa.com<ma...@akqa.com>) wrote:

So lets say I modify the toString method of a class in A. Then B when using the toString(), it gets the old value (the one before A was modified)

Also, I can uninstall A but B still works! And I’ve verified B.jar doesn’t include A classes or A.jar.

Thanks,

Kostas


From: Neil Bartlett <nj...@gmail.com>>
Date: Friday, 12 September 2014 16:49
To: "users@felix.apache.org<ma...@felix.apache.org>" <us...@felix.apache.org>>, Konstantine Kougios <ko...@akqa.com>>
Subject: Re: bundle B can't see changes of classes of bundle A

Can you be more specific about what this phrase means: “bundle doesn’t see the change”? It’s best to describe exactly what behaviour you expected, then how the actual behaviour differed from that.

Kind regards,
Neil



On 12 September 2014 at 16:03:16, Konstantine Kougios (konstantine.kougios@akqa.com<ma...@akqa.com>) wrote:

Hi,

I am trying to sort out a very weird issue for a few hours now. I got 2 bundles, A and B.

A has a class JsonObject and B has tests that run on the server (via sling-junit). So when I change a class in A and deploy it via mvn/mvn-sling-plugin , my B bundle doesn’t see the change. If I refresh B or stop/start B, again it doesn’t see the change of JsonObject. Only a mvn clean install fixes the issue.

I’ve checked both bundle jar files to see if there are duplicate classes or maybe B includes A.jar, but no, the jars seem proper.

Any ideas?

Thanks,

Kostas

Re: bundle B can't see changes of classes of bundle A

Posted by Konstantine Kougios <Ko...@akqa.com>.
Yes I tried several times doing a manual refresh using the console.

Thanks,

Kostas

From: Neil Bartlett <nj...@gmail.com>>
Date: Friday, 12 September 2014 16:58
To: "users@felix.apache.org<ma...@felix.apache.org>" <us...@felix.apache.org>>, Konstantine Kougios <ko...@akqa.com>>
Subject: Re: bundle B can't see changes of classes of bundle A

How do you perform the bundle update? If you do not refresh packages, then bundle B will remain wired to the old version of bundle A… this is true even if you uninstall bundle A.

After any mutation of the set of installed bundles, it is essential to perform a package refresh.

Regards,
Neil



On 12 September 2014 at 16:52:36, Konstantine Kougios (konstantine.kougios@akqa.com<ma...@akqa.com>) wrote:

So lets say I modify the toString method of a class in A. Then B when using the toString(), it gets the old value (the one before A was modified)

Also, I can uninstall A but B still works! And I’ve verified B.jar doesn’t include A classes or A.jar.

Thanks,

Kostas


From: Neil Bartlett <nj...@gmail.com>>
Date: Friday, 12 September 2014 16:49
To: "users@felix.apache.org<ma...@felix.apache.org>" <us...@felix.apache.org>>, Konstantine Kougios <ko...@akqa.com>>
Subject: Re: bundle B can't see changes of classes of bundle A

Can you be more specific about what this phrase means: “bundle doesn’t see the change”? It’s best to describe exactly what behaviour you expected, then how the actual behaviour differed from that.

Kind regards,
Neil



On 12 September 2014 at 16:03:16, Konstantine Kougios (konstantine.kougios@akqa.com<ma...@akqa.com>) wrote:

Hi,

I am trying to sort out a very weird issue for a few hours now. I got 2 bundles, A and B.

A has a class JsonObject and B has tests that run on the server (via sling-junit). So when I change a class in A and deploy it via mvn/mvn-sling-plugin , my B bundle doesn’t see the change. If I refresh B or stop/start B, again it doesn’t see the change of JsonObject. Only a mvn clean install fixes the issue.

I’ve checked both bundle jar files to see if there are duplicate classes or maybe B includes A.jar, but no, the jars seem proper.

Any ideas?

Thanks,

Kostas

Re: bundle B can't see changes of classes of bundle A

Posted by Neil Bartlett <nj...@gmail.com>.
How do you perform the bundle update? If you do not refresh packages, then bundle B will remain wired to the old version of bundle A… this is true even if you uninstall bundle A.

After any mutation of the set of installed bundles, it is essential to perform a package refresh.

Regards,
Neil


On 12 September 2014 at 16:52:36, Konstantine Kougios (konstantine.kougios@akqa.com) wrote:

So lets say I modify the toString method of a class in A. Then B when using the toString(), it gets the old value (the one before A was modified)

Also, I can uninstall A but B still works! And I’ve verified B.jar doesn’t include A classes or A.jar. 

Thanks,

Kostas


From: Neil Bartlett <nj...@gmail.com>
Date: Friday, 12 September 2014 16:49
To: "users@felix.apache.org" <us...@felix.apache.org>, Konstantine Kougios <ko...@akqa.com>
Subject: Re: bundle B can't see changes of classes of bundle A

Can you be more specific about what this phrase means: “bundle doesn’t see the change”? It’s best to describe exactly what behaviour you expected, then how the actual behaviour differed from that.

Kind regards,
Neil


On 12 September 2014 at 16:03:16, Konstantine Kougios (konstantine.kougios@akqa.com) wrote:

Hi,

I am trying to sort out a very weird issue for a few hours now. I got 2 bundles, A and B.

A has a class JsonObject and B has tests that run on the server (via sling-junit). So when I change a class in A and deploy it via mvn/mvn-sling-plugin , my B bundle doesn’t see the change. If I refresh B or stop/start B, again it doesn’t see the change of JsonObject. Only a mvn clean install fixes the issue.

I’ve checked both bundle jar files to see if there are duplicate classes or maybe B includes A.jar, but no, the jars seem proper.

Any ideas?

Thanks,

Kostas

Re: bundle B can't see changes of classes of bundle A

Posted by Konstantine Kougios <Ko...@akqa.com>.
So lets say I modify the toString method of a class in A. Then B when using the toString(), it gets the old value (the one before A was modified)

Also, I can uninstall A but B still works! And I’ve verified B.jar doesn’t include A classes or A.jar.

Thanks,

Kostas


From: Neil Bartlett <nj...@gmail.com>>
Date: Friday, 12 September 2014 16:49
To: "users@felix.apache.org<ma...@felix.apache.org>" <us...@felix.apache.org>>, Konstantine Kougios <ko...@akqa.com>>
Subject: Re: bundle B can't see changes of classes of bundle A

Can you be more specific about what this phrase means: “bundle doesn’t see the change”? It’s best to describe exactly what behaviour you expected, then how the actual behaviour differed from that.

Kind regards,
Neil



On 12 September 2014 at 16:03:16, Konstantine Kougios (konstantine.kougios@akqa.com<ma...@akqa.com>) wrote:

Hi,

I am trying to sort out a very weird issue for a few hours now. I got 2 bundles, A and B.

A has a class JsonObject and B has tests that run on the server (via sling-junit). So when I change a class in A and deploy it via mvn/mvn-sling-plugin , my B bundle doesn’t see the change. If I refresh B or stop/start B, again it doesn’t see the change of JsonObject. Only a mvn clean install fixes the issue.

I’ve checked both bundle jar files to see if there are duplicate classes or maybe B includes A.jar, but no, the jars seem proper.

Any ideas?

Thanks,

Kostas

Re: bundle B can't see changes of classes of bundle A

Posted by Neil Bartlett <nj...@gmail.com>.
Can you be more specific about what this phrase means: “bundle doesn’t see the change”? It’s best to describe exactly what behaviour you expected, then how the actual behaviour differed from that.

Kind regards,
Neil


On 12 September 2014 at 16:03:16, Konstantine Kougios (konstantine.kougios@akqa.com) wrote:

Hi,  

I am trying to sort out a very weird issue for a few hours now. I got 2 bundles, A and B.  

A has a class JsonObject and B has tests that run on the server (via sling-junit). So when I change a class in A and deploy it via mvn/mvn-sling-plugin , my B bundle doesn’t see the change. If I refresh B or stop/start B, again it doesn’t see the change of JsonObject. Only a mvn clean install fixes the issue.  

I’ve checked both bundle jar files to see if there are duplicate classes or maybe B includes A.jar, but no, the jars seem proper.  

Any ideas?  

Thanks,  

Kostas