You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@karaf.apache.org by Charles Moulliard <ch...@gmail.com> on 2013/01/21 11:35:31 UTC

Bundle.findEntries issue with Features deployment

Hi,

For a reason that I don't know, when I try to deploy a bundle containing a
feature file, the process does not succeed

Command used

install -s feature:mvn:org.apache.camel/camel-example-sql/2.11-SNAPSHOT

Bundle contains the features file here under

META-INF/org.apache.karaf.shell.features/features.xml

remark : directory name = org.apache.karaf.shell.features

In debug mode, I see that Felix looks for the following entry -->
META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT and of course
returns empty list here in the code

FeatureDeploymentListener

    public void bundleChanged(BundleEvent bundleEvent) {
            Bundle bundle = bundleEvent.getBundle();
            if (bundleEvent.getType() == BundleEvent.INSTALLED ||
bundleEvent.getType() == BundleEvent.RESOLVED || bundleEvent.getType() ==
BundleEvent.STARTED) {
                try {
                    List<URL> urls = new ArrayList<URL>();
                    Enumeration featuresUrlEnumeration =
bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
                    while (featuresUrlEnumeration != null &&
featuresUrlEnumeration.hasMoreElements()) {

Why bundle version has been added ? Is there a trick to avoid that ?

Regards,

-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Bundle.findEntries issue with Features deployment

Posted by Guillaume Nodet <gn...@gmail.com>.
I've raised and fixed KARAF-2134 for this issue.


On Mon, Jan 21, 2013 at 12:13 PM, Charles Moulliard <ch...@gmail.com>wrote:

> You better know than me this part of the code. So you can go.
>
>
> On Mon, Jan 21, 2013 at 12:10 PM, Guillaume Nodet <gn...@gmail.com>
> wrote:
>
> > Right, so it's really the FeaturesDeployer class which does not support
> mvn
> > urls well.
> > I can have a look at it if you want.
> >
> >
> > On Mon, Jan 21, 2013 at 12:08 PM, Charles Moulliard <ch007m@gmail.com
> > >wrote:
> >
> > > Nevertheless the camel-example-sql bundle content which has been
> deployed
> > > on karaf 2.3 is not correct. Here is what I see from the bundle in the
> > > cache :
> > >
> > > RedHat-MacBook:target chmoulli$ cd
> > > ~/MyApplications/apache-karaf-2.3.0/data/cache/bundle99/version0.0/
> > > RedHat-MacBook:version0.0 chmoulli$ jar -tf bundle.jar
> > > META-INF/MANIFEST.MF
> > > META-INF/
> > > META-INF/org.apache.karaf.shell.features/
> > > META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT
> > >
> > >
> > > On Mon, Jan 21, 2013 at 12:05 PM, Charles Moulliard <ch007m@gmail.com
> > > >wrote:
> > >
> > > > Content of the jar created by camel example sql is correct
> > > >
> > > > RedHat-MacBook:target chmoulli$ jar -tf
> > > > camel-example-sql-2.11-SNAPSHOT.jar
> > > > META-INF/MANIFEST.MF
> > > > META-INF/
> > > > META-INF/DEPENDENCIES
> > > > META-INF/LICENSE
> > > > META-INF/LICENSE.txt
> > > > META-INF/NOTICE
> > > > META-INF/NOTICE.txt
> > > > META-INF/maven/
> > > > META-INF/maven/org.apache.camel/
> > > > META-INF/maven/org.apache.camel/camel-example-sql/
> > > > META-INF/maven/org.apache.camel/camel-example-sql/pom.properties
> > > > META-INF/maven/org.apache.camel/camel-example-sql/pom.xml
> > > > META-INF/org.apache.karaf.shell.features/
> > > > META-INF/org.apache.karaf.shell.features/features.xml
> > > > META-INF/spring/
> > > > META-INF/spring/camel-context.xml
> > > > log4j.properties
> > > > org/
> > > > org/apache/
> > > > org/apache/camel/
> > > > org/apache/camel/example/
> > > > org/apache/camel/example/sql/
> > > > org/apache/camel/example/sql/DatabaseBean.class
> > > > org/apache/camel/example/sql/OrderBean.class
> > > > sql.properties
> > > >
> > > >
> > > > On Mon, Jan 21, 2013 at 12:00 PM, Guillaume Nodet <gnodet@gmail.com
> > > >wrote:
> > > >
> > > >> I think the problem is in the generated bundle, which I suppose
> > create a
> > > >> wrong jar.
> > > >> Can you run a jar -tf on the generated bundle ?
> > > >>
> > > >>
> > > >> On Mon, Jan 21, 2013 at 11:35 AM, Charles Moulliard <
> ch007m@gmail.com
> > > >> >wrote:
> > > >>
> > > >> > Hi,
> > > >> >
> > > >> > For a reason that I don't know, when I try to deploy a bundle
> > > >> containing a
> > > >> > feature file, the process does not succeed
> > > >> >
> > > >> > Command used
> > > >> >
> > > >> > install -s
> > > feature:mvn:org.apache.camel/camel-example-sql/2.11-SNAPSHOT
> > > >> >
> > > >> > Bundle contains the features file here under
> > > >> >
> > > >> > META-INF/org.apache.karaf.shell.features/features.xml
> > > >> >
> > > >> > remark : directory name = org.apache.karaf.shell.features
> > > >> >
> > > >> > In debug mode, I see that Felix looks for the following entry -->
> > > >> > META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT and of
> course
> > > >> > returns empty list here in the code
> > > >> >
> > > >> > FeatureDeploymentListener
> > > >> >
> > > >> >     public void bundleChanged(BundleEvent bundleEvent) {
> > > >> >             Bundle bundle = bundleEvent.getBundle();
> > > >> >             if (bundleEvent.getType() == BundleEvent.INSTALLED ||
> > > >> > bundleEvent.getType() == BundleEvent.RESOLVED ||
> > bundleEvent.getType()
> > > >> ==
> > > >> > BundleEvent.STARTED) {
> > > >> >                 try {
> > > >> >                     List<URL> urls = new ArrayList<URL>();
> > > >> >                     Enumeration featuresUrlEnumeration =
> > > >> > bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml",
> > false);
> > > >> >                     while (featuresUrlEnumeration != null &&
> > > >> > featuresUrlEnumeration.hasMoreElements()) {
> > > >> >
> > > >> > Why bundle version has been added ? Is there a trick to avoid
> that ?
> > > >> >
> > > >> > Regards,
> > > >> >
> > > >> > --
> > > >> > Charles Moulliard
> > > >> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > >> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> > > >> >
> > > >> >
> > > >>
> > > >>
> > > >> --
> > > >> ------------------------
> > > >> Guillaume Nodet
> > > >> ------------------------
> > > >> Blog: http://gnodet.blogspot.com/
> > > >> ------------------------
> > > >> FuseSource, Integration everywhere
> > > >> http://fusesource.com
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > Charles Moulliard
> > > > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> > > >
> > > >
> > >
> > >
> > > --
> > > Charles Moulliard
> > > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> > >
> >
> >
> >
> > --
> > ------------------------
> > Guillaume Nodet
> > ------------------------
> > Blog: http://gnodet.blogspot.com/
> > ------------------------
> > FuseSource, Integration everywhere
> > http://fusesource.com
> >
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com

Re: Bundle.findEntries issue with Features deployment

Posted by Charles Moulliard <ch...@gmail.com>.
You better know than me this part of the code. So you can go.


On Mon, Jan 21, 2013 at 12:10 PM, Guillaume Nodet <gn...@gmail.com> wrote:

> Right, so it's really the FeaturesDeployer class which does not support mvn
> urls well.
> I can have a look at it if you want.
>
>
> On Mon, Jan 21, 2013 at 12:08 PM, Charles Moulliard <ch007m@gmail.com
> >wrote:
>
> > Nevertheless the camel-example-sql bundle content which has been deployed
> > on karaf 2.3 is not correct. Here is what I see from the bundle in the
> > cache :
> >
> > RedHat-MacBook:target chmoulli$ cd
> > ~/MyApplications/apache-karaf-2.3.0/data/cache/bundle99/version0.0/
> > RedHat-MacBook:version0.0 chmoulli$ jar -tf bundle.jar
> > META-INF/MANIFEST.MF
> > META-INF/
> > META-INF/org.apache.karaf.shell.features/
> > META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT
> >
> >
> > On Mon, Jan 21, 2013 at 12:05 PM, Charles Moulliard <ch007m@gmail.com
> > >wrote:
> >
> > > Content of the jar created by camel example sql is correct
> > >
> > > RedHat-MacBook:target chmoulli$ jar -tf
> > > camel-example-sql-2.11-SNAPSHOT.jar
> > > META-INF/MANIFEST.MF
> > > META-INF/
> > > META-INF/DEPENDENCIES
> > > META-INF/LICENSE
> > > META-INF/LICENSE.txt
> > > META-INF/NOTICE
> > > META-INF/NOTICE.txt
> > > META-INF/maven/
> > > META-INF/maven/org.apache.camel/
> > > META-INF/maven/org.apache.camel/camel-example-sql/
> > > META-INF/maven/org.apache.camel/camel-example-sql/pom.properties
> > > META-INF/maven/org.apache.camel/camel-example-sql/pom.xml
> > > META-INF/org.apache.karaf.shell.features/
> > > META-INF/org.apache.karaf.shell.features/features.xml
> > > META-INF/spring/
> > > META-INF/spring/camel-context.xml
> > > log4j.properties
> > > org/
> > > org/apache/
> > > org/apache/camel/
> > > org/apache/camel/example/
> > > org/apache/camel/example/sql/
> > > org/apache/camel/example/sql/DatabaseBean.class
> > > org/apache/camel/example/sql/OrderBean.class
> > > sql.properties
> > >
> > >
> > > On Mon, Jan 21, 2013 at 12:00 PM, Guillaume Nodet <gnodet@gmail.com
> > >wrote:
> > >
> > >> I think the problem is in the generated bundle, which I suppose
> create a
> > >> wrong jar.
> > >> Can you run a jar -tf on the generated bundle ?
> > >>
> > >>
> > >> On Mon, Jan 21, 2013 at 11:35 AM, Charles Moulliard <ch007m@gmail.com
> > >> >wrote:
> > >>
> > >> > Hi,
> > >> >
> > >> > For a reason that I don't know, when I try to deploy a bundle
> > >> containing a
> > >> > feature file, the process does not succeed
> > >> >
> > >> > Command used
> > >> >
> > >> > install -s
> > feature:mvn:org.apache.camel/camel-example-sql/2.11-SNAPSHOT
> > >> >
> > >> > Bundle contains the features file here under
> > >> >
> > >> > META-INF/org.apache.karaf.shell.features/features.xml
> > >> >
> > >> > remark : directory name = org.apache.karaf.shell.features
> > >> >
> > >> > In debug mode, I see that Felix looks for the following entry -->
> > >> > META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT and of course
> > >> > returns empty list here in the code
> > >> >
> > >> > FeatureDeploymentListener
> > >> >
> > >> >     public void bundleChanged(BundleEvent bundleEvent) {
> > >> >             Bundle bundle = bundleEvent.getBundle();
> > >> >             if (bundleEvent.getType() == BundleEvent.INSTALLED ||
> > >> > bundleEvent.getType() == BundleEvent.RESOLVED ||
> bundleEvent.getType()
> > >> ==
> > >> > BundleEvent.STARTED) {
> > >> >                 try {
> > >> >                     List<URL> urls = new ArrayList<URL>();
> > >> >                     Enumeration featuresUrlEnumeration =
> > >> > bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml",
> false);
> > >> >                     while (featuresUrlEnumeration != null &&
> > >> > featuresUrlEnumeration.hasMoreElements()) {
> > >> >
> > >> > Why bundle version has been added ? Is there a trick to avoid that ?
> > >> >
> > >> > Regards,
> > >> >
> > >> > --
> > >> > Charles Moulliard
> > >> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > >> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> ------------------------
> > >> Guillaume Nodet
> > >> ------------------------
> > >> Blog: http://gnodet.blogspot.com/
> > >> ------------------------
> > >> FuseSource, Integration everywhere
> > >> http://fusesource.com
> > >>
> > >
> > >
> > >
> > > --
> > > Charles Moulliard
> > > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> > >
> > >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
>
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> FuseSource, Integration everywhere
> http://fusesource.com
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Bundle.findEntries issue with Features deployment

Posted by Guillaume Nodet <gn...@gmail.com>.
Right, so it's really the FeaturesDeployer class which does not support mvn
urls well.
I can have a look at it if you want.


On Mon, Jan 21, 2013 at 12:08 PM, Charles Moulliard <ch...@gmail.com>wrote:

> Nevertheless the camel-example-sql bundle content which has been deployed
> on karaf 2.3 is not correct. Here is what I see from the bundle in the
> cache :
>
> RedHat-MacBook:target chmoulli$ cd
> ~/MyApplications/apache-karaf-2.3.0/data/cache/bundle99/version0.0/
> RedHat-MacBook:version0.0 chmoulli$ jar -tf bundle.jar
> META-INF/MANIFEST.MF
> META-INF/
> META-INF/org.apache.karaf.shell.features/
> META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT
>
>
> On Mon, Jan 21, 2013 at 12:05 PM, Charles Moulliard <ch007m@gmail.com
> >wrote:
>
> > Content of the jar created by camel example sql is correct
> >
> > RedHat-MacBook:target chmoulli$ jar -tf
> > camel-example-sql-2.11-SNAPSHOT.jar
> > META-INF/MANIFEST.MF
> > META-INF/
> > META-INF/DEPENDENCIES
> > META-INF/LICENSE
> > META-INF/LICENSE.txt
> > META-INF/NOTICE
> > META-INF/NOTICE.txt
> > META-INF/maven/
> > META-INF/maven/org.apache.camel/
> > META-INF/maven/org.apache.camel/camel-example-sql/
> > META-INF/maven/org.apache.camel/camel-example-sql/pom.properties
> > META-INF/maven/org.apache.camel/camel-example-sql/pom.xml
> > META-INF/org.apache.karaf.shell.features/
> > META-INF/org.apache.karaf.shell.features/features.xml
> > META-INF/spring/
> > META-INF/spring/camel-context.xml
> > log4j.properties
> > org/
> > org/apache/
> > org/apache/camel/
> > org/apache/camel/example/
> > org/apache/camel/example/sql/
> > org/apache/camel/example/sql/DatabaseBean.class
> > org/apache/camel/example/sql/OrderBean.class
> > sql.properties
> >
> >
> > On Mon, Jan 21, 2013 at 12:00 PM, Guillaume Nodet <gnodet@gmail.com
> >wrote:
> >
> >> I think the problem is in the generated bundle, which I suppose create a
> >> wrong jar.
> >> Can you run a jar -tf on the generated bundle ?
> >>
> >>
> >> On Mon, Jan 21, 2013 at 11:35 AM, Charles Moulliard <ch007m@gmail.com
> >> >wrote:
> >>
> >> > Hi,
> >> >
> >> > For a reason that I don't know, when I try to deploy a bundle
> >> containing a
> >> > feature file, the process does not succeed
> >> >
> >> > Command used
> >> >
> >> > install -s
> feature:mvn:org.apache.camel/camel-example-sql/2.11-SNAPSHOT
> >> >
> >> > Bundle contains the features file here under
> >> >
> >> > META-INF/org.apache.karaf.shell.features/features.xml
> >> >
> >> > remark : directory name = org.apache.karaf.shell.features
> >> >
> >> > In debug mode, I see that Felix looks for the following entry -->
> >> > META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT and of course
> >> > returns empty list here in the code
> >> >
> >> > FeatureDeploymentListener
> >> >
> >> >     public void bundleChanged(BundleEvent bundleEvent) {
> >> >             Bundle bundle = bundleEvent.getBundle();
> >> >             if (bundleEvent.getType() == BundleEvent.INSTALLED ||
> >> > bundleEvent.getType() == BundleEvent.RESOLVED || bundleEvent.getType()
> >> ==
> >> > BundleEvent.STARTED) {
> >> >                 try {
> >> >                     List<URL> urls = new ArrayList<URL>();
> >> >                     Enumeration featuresUrlEnumeration =
> >> > bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
> >> >                     while (featuresUrlEnumeration != null &&
> >> > featuresUrlEnumeration.hasMoreElements()) {
> >> >
> >> > Why bundle version has been added ? Is there a trick to avoid that ?
> >> >
> >> > Regards,
> >> >
> >> > --
> >> > Charles Moulliard
> >> > Apache Committer / Sr. Enterprise Architect (RedHat)
> >> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >> >
> >> >
> >>
> >>
> >> --
> >> ------------------------
> >> Guillaume Nodet
> >> ------------------------
> >> Blog: http://gnodet.blogspot.com/
> >> ------------------------
> >> FuseSource, Integration everywhere
> >> http://fusesource.com
> >>
> >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
> >
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com

Re: Bundle.findEntries issue with Features deployment

Posted by Charles Moulliard <ch...@gmail.com>.
Nevertheless the camel-example-sql bundle content which has been deployed
on karaf 2.3 is not correct. Here is what I see from the bundle in the
cache :

RedHat-MacBook:target chmoulli$ cd
~/MyApplications/apache-karaf-2.3.0/data/cache/bundle99/version0.0/
RedHat-MacBook:version0.0 chmoulli$ jar -tf bundle.jar
META-INF/MANIFEST.MF
META-INF/
META-INF/org.apache.karaf.shell.features/
META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT


On Mon, Jan 21, 2013 at 12:05 PM, Charles Moulliard <ch...@gmail.com>wrote:

> Content of the jar created by camel example sql is correct
>
> RedHat-MacBook:target chmoulli$ jar -tf
> camel-example-sql-2.11-SNAPSHOT.jar
> META-INF/MANIFEST.MF
> META-INF/
> META-INF/DEPENDENCIES
> META-INF/LICENSE
> META-INF/LICENSE.txt
> META-INF/NOTICE
> META-INF/NOTICE.txt
> META-INF/maven/
> META-INF/maven/org.apache.camel/
> META-INF/maven/org.apache.camel/camel-example-sql/
> META-INF/maven/org.apache.camel/camel-example-sql/pom.properties
> META-INF/maven/org.apache.camel/camel-example-sql/pom.xml
> META-INF/org.apache.karaf.shell.features/
> META-INF/org.apache.karaf.shell.features/features.xml
> META-INF/spring/
> META-INF/spring/camel-context.xml
> log4j.properties
> org/
> org/apache/
> org/apache/camel/
> org/apache/camel/example/
> org/apache/camel/example/sql/
> org/apache/camel/example/sql/DatabaseBean.class
> org/apache/camel/example/sql/OrderBean.class
> sql.properties
>
>
> On Mon, Jan 21, 2013 at 12:00 PM, Guillaume Nodet <gn...@gmail.com>wrote:
>
>> I think the problem is in the generated bundle, which I suppose create a
>> wrong jar.
>> Can you run a jar -tf on the generated bundle ?
>>
>>
>> On Mon, Jan 21, 2013 at 11:35 AM, Charles Moulliard <ch007m@gmail.com
>> >wrote:
>>
>> > Hi,
>> >
>> > For a reason that I don't know, when I try to deploy a bundle
>> containing a
>> > feature file, the process does not succeed
>> >
>> > Command used
>> >
>> > install -s feature:mvn:org.apache.camel/camel-example-sql/2.11-SNAPSHOT
>> >
>> > Bundle contains the features file here under
>> >
>> > META-INF/org.apache.karaf.shell.features/features.xml
>> >
>> > remark : directory name = org.apache.karaf.shell.features
>> >
>> > In debug mode, I see that Felix looks for the following entry -->
>> > META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT and of course
>> > returns empty list here in the code
>> >
>> > FeatureDeploymentListener
>> >
>> >     public void bundleChanged(BundleEvent bundleEvent) {
>> >             Bundle bundle = bundleEvent.getBundle();
>> >             if (bundleEvent.getType() == BundleEvent.INSTALLED ||
>> > bundleEvent.getType() == BundleEvent.RESOLVED || bundleEvent.getType()
>> ==
>> > BundleEvent.STARTED) {
>> >                 try {
>> >                     List<URL> urls = new ArrayList<URL>();
>> >                     Enumeration featuresUrlEnumeration =
>> > bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
>> >                     while (featuresUrlEnumeration != null &&
>> > featuresUrlEnumeration.hasMoreElements()) {
>> >
>> > Why bundle version has been added ? Is there a trick to avoid that ?
>> >
>> > Regards,
>> >
>> > --
>> > Charles Moulliard
>> > Apache Committer / Sr. Enterprise Architect (RedHat)
>> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>> >
>> >
>>
>>
>> --
>> ------------------------
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> FuseSource, Integration everywhere
>> http://fusesource.com
>>
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Bundle.findEntries issue with Features deployment

Posted by Charles Moulliard <ch...@gmail.com>.
Content of the jar created by camel example sql is correct

RedHat-MacBook:target chmoulli$ jar -tf camel-example-sql-2.11-SNAPSHOT.jar
META-INF/MANIFEST.MF
META-INF/
META-INF/DEPENDENCIES
META-INF/LICENSE
META-INF/LICENSE.txt
META-INF/NOTICE
META-INF/NOTICE.txt
META-INF/maven/
META-INF/maven/org.apache.camel/
META-INF/maven/org.apache.camel/camel-example-sql/
META-INF/maven/org.apache.camel/camel-example-sql/pom.properties
META-INF/maven/org.apache.camel/camel-example-sql/pom.xml
META-INF/org.apache.karaf.shell.features/
META-INF/org.apache.karaf.shell.features/features.xml
META-INF/spring/
META-INF/spring/camel-context.xml
log4j.properties
org/
org/apache/
org/apache/camel/
org/apache/camel/example/
org/apache/camel/example/sql/
org/apache/camel/example/sql/DatabaseBean.class
org/apache/camel/example/sql/OrderBean.class
sql.properties


On Mon, Jan 21, 2013 at 12:00 PM, Guillaume Nodet <gn...@gmail.com> wrote:

> I think the problem is in the generated bundle, which I suppose create a
> wrong jar.
> Can you run a jar -tf on the generated bundle ?
>
>
> On Mon, Jan 21, 2013 at 11:35 AM, Charles Moulliard <ch007m@gmail.com
> >wrote:
>
> > Hi,
> >
> > For a reason that I don't know, when I try to deploy a bundle containing
> a
> > feature file, the process does not succeed
> >
> > Command used
> >
> > install -s feature:mvn:org.apache.camel/camel-example-sql/2.11-SNAPSHOT
> >
> > Bundle contains the features file here under
> >
> > META-INF/org.apache.karaf.shell.features/features.xml
> >
> > remark : directory name = org.apache.karaf.shell.features
> >
> > In debug mode, I see that Felix looks for the following entry -->
> > META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT and of course
> > returns empty list here in the code
> >
> > FeatureDeploymentListener
> >
> >     public void bundleChanged(BundleEvent bundleEvent) {
> >             Bundle bundle = bundleEvent.getBundle();
> >             if (bundleEvent.getType() == BundleEvent.INSTALLED ||
> > bundleEvent.getType() == BundleEvent.RESOLVED || bundleEvent.getType() ==
> > BundleEvent.STARTED) {
> >                 try {
> >                     List<URL> urls = new ArrayList<URL>();
> >                     Enumeration featuresUrlEnumeration =
> > bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
> >                     while (featuresUrlEnumeration != null &&
> > featuresUrlEnumeration.hasMoreElements()) {
> >
> > Why bundle version has been added ? Is there a trick to avoid that ?
> >
> > Regards,
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
> >
>
>
> --
> ------------------------
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> FuseSource, Integration everywhere
> http://fusesource.com
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Bundle.findEntries issue with Features deployment

Posted by Guillaume Nodet <gn...@gmail.com>.
I think the problem is in the generated bundle, which I suppose create a
wrong jar.
Can you run a jar -tf on the generated bundle ?


On Mon, Jan 21, 2013 at 11:35 AM, Charles Moulliard <ch...@gmail.com>wrote:

> Hi,
>
> For a reason that I don't know, when I try to deploy a bundle containing a
> feature file, the process does not succeed
>
> Command used
>
> install -s feature:mvn:org.apache.camel/camel-example-sql/2.11-SNAPSHOT
>
> Bundle contains the features file here under
>
> META-INF/org.apache.karaf.shell.features/features.xml
>
> remark : directory name = org.apache.karaf.shell.features
>
> In debug mode, I see that Felix looks for the following entry -->
> META-INF/org.apache.karaf.shell.features/2.11-SNAPSHOT and of course
> returns empty list here in the code
>
> FeatureDeploymentListener
>
>     public void bundleChanged(BundleEvent bundleEvent) {
>             Bundle bundle = bundleEvent.getBundle();
>             if (bundleEvent.getType() == BundleEvent.INSTALLED ||
> bundleEvent.getType() == BundleEvent.RESOLVED || bundleEvent.getType() ==
> BundleEvent.STARTED) {
>                 try {
>                     List<URL> urls = new ArrayList<URL>();
>                     Enumeration featuresUrlEnumeration =
> bundle.findEntries("/META-INF/" + FEATURE_PATH + "/", "*.xml", false);
>                     while (featuresUrlEnumeration != null &&
> featuresUrlEnumeration.hasMoreElements()) {
>
> Why bundle version has been added ? Is there a trick to avoid that ?
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>


-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com