You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Olivier21 <ol...@netcourrier.com> on 2016/04/27 16:21:25 UTC
Bundle versioning
Hello,
I'm a newbie for Karaf and I have two problems.
1) I installed a kar archive in Karaf via the deploy folder.
2)After, I tested the Web Service and it works fine. The version of all the
OSGI bundle in the archive is "1.0.0" and all the bundles have got a class
"Activator" which display the message "bundle X started in version 1.0.0"
after the deployement.
3) I stopped Karaf
4) I remove the kar archive from the deploy folder
5) I decided to change the release of one of the OSGI bundles to "1.0.1" and
I created a jar file that I copy in the deploy folder. This bundle have got
a class "Activator" which should display the message "bundle X started in
version 1.0.1".
6) I started Karaf
7) The message "bundle X started in version *1.0.0*" is displayed instead of
the message "bundle X started in version *1.0.1*". Hence, this message
appears 2 times because I didn't remove the release "1.0.0" of this bundle.
8) If I stop Karaf then I remove the jar file from the deploy folder then I
restart Karaf, then the message "bundle X started in version *1.0.0*"
doesn't appears any more but the message "bundle X started in version
*1.0.1*" appears 2 times.
Nevertheless, instead of renaming the version "1.0.0" to "1.0.1", if I
rename the version "1.0.0" to "1.1.0" (in the point 5 above), then I started
Karaf (in the point 6 above), the message "bundle X started in version
*1.0.0*" appears firstly (that's normal) followed by the message "bundle X
started in version *1.1.0*". Hence, everything is normal in this case.
*Could you say me why it doesn't work like this in the case of the version
"1.0.1" please?*
For your information, here is an extract of the parent pom :
<dependency>
<groupId>org.omega.wsrest</groupId>
<artifactId>omega-module-service-metier</artifactId>
<version>[1.0.0, 2.0)</version>
</dependency>
<dependency>
<groupId>org.omega.wsrest</groupId>
<artifactId>omega-module-dao</artifactId>
<version>[1.0.0, 2.0)</version>
</dependency>
and here is an extract of the child pom :
<dependency>
<groupId>org.omega.wsrest</groupId>
<artifactId>omega-module-service-metier</artifactId>
<version>1.0.0</version>
<type>bundle</type>
</dependency>
<dependency>
<groupId>org.omega.wsrest</groupId>
<artifactId>omega-module-dao</artifactId>
<version>1.0.0</version>
<type>bundle</type>
</dependency>
All the modules (parents and childs are in the kar archive).
Moreover, I have a second question : in my case, I have a bundle A which is
called by :
- bundle B
- and Bundle C
This is the bundle A which is in my Jar archive. *How to do to say to bundle
B and C to point to the new release of bundle A?* (Until now, I restarted
Karaf ...but I imagine there is another way).
Thank you in advance for your help.
Olivier
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
JB, you can see the project in attached file above.
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046408.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
I don't think it's a Karaf issue, but more an issue with your bundles
and the way you start. Can you give me some details ? Do you use
blueprint, SCR, ... ? How do you deploy (bundle:install mvn, deploy
folder, ...) ?
I don't have time right now, but I will take a look on your project.
However, you sent your project as attachment on the mailing list, which
is not possible. Can you please send to me directly on my address
(jbonofre@apache.org) ?
Thanks,
Regards
JB
On 04/29/2016 03:24 PM, Olivier21 wrote:
> Hi JB,
>
> I see an other strange thing between the version 1.0.1 and the version 1.1.0
> In the 2 cases, I put the jar file in the deploy folder, then I execute
> Karaf which deployed my bundle.
>
> In the case of the version 1.1.0 of my bundle, you can see what is displayed
> below (bundle:update 215 allows to update the hibernate-osgi bundle. It
> seems it's necessary) :
>
>
> __ __ ____
> / //_/____ __________ _/ __/
> / ,< / __ `/ ___/ __ `/ /_
> / /| |/ /_/ / / / /_/ / __/
> /_/ |_|\__,_/_/ \__,_/_/
>
> Apache Karaf (4.0.4)
>
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>
> karaf@root()> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST
> 1.0.0*
> Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
> Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
> 1.0.0
> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
>
> karaf@root()> bundle:update 123
> *Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
> Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
> karaf@root()> bundle:update 215
> karaf@root()> bundle:refresh
> karaf@root()> Arret du bundle omega-module-jaxrs du projet OMEGA_WSREST
> 1.0.0
> Arret du bundle omega-module-service-metier du projet OMEGA_WS_REST 1.0.0
> *Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
> Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
> Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
> 1.0.0
> **Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0**
>
> *Everything is OK.*
>
>
>
>
> And here you can see the case of the deployement of the version 1.0.1 of my
> bundle (I start from a new installation of Karaf):
>
> __ __ ____
> / //_/____ __________ _/ __/
> / ,< / __ `/ ___/ __ `/ /_
> / /| |/ /_/ / / / /_/ / __/
> /_/ |_|\__,_/_/ \__,_/_/
>
> Apache Karaf (4.0.4)
>
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>
> karaf@root()> Demarrage du bundle omega-module-dao du projet OMEGA_WSREST
> 1.0.0
> Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
> Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
> 1.0.0
> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
> /---------> Not OK : it should be 1.0.1/
>
> karaf@root()> bundle:update 123
> Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
> /---------> Not OK : it should be 1.0.1/
> karaf@root()> bundle:update 215
> karaf@root()> bundle:refresh
> karaf@root()> Arret du bundle omega-module-jaxrs du projet OMEGA_WSREST
> 1.0.0
> *Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
> Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
> /---------> Not OK : it should be 1.0.1 and only one time/
> Arret du bundle omega-module-service-metier du projet OMEGA_WS_REST 1.0.0
> Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.1
> Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.1*
> /---------> Not OK : it should be 1.0.1 and only one time/
> Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
> 1.0.0
>
>
>
> In the second case (version 1.0.1), you can see that after the
> "bundle:refresh" command, the bundle dao (version 1.0.1) seems to be
> deployed 2 times...
>
> Had you got the time to see my project? Have you an idea where is the
> problem?
>
> Thank you for your help.
>
> Olivier
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046440.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Bundle versioning
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
I don't think it's a Karaf issue, but more an issue with your bundles
and the way you start. Can you give me some details ? Do you use
blueprint, SCR, ... ? How do you deploy (bundle:install mvn, deploy
folder, ...) ?
I don't have time right now, but I will take a look on your project.
However, you sent your project as attachment on the mailing list, which
is not possible. Can you please send to me directly on my address
(jbonofre@apache.org) ?
Thanks,
Regards
JB
On 04/29/2016 03:24 PM, Olivier21 wrote:
> Hi JB,
>
> I see an other strange thing between the version 1.0.1 and the version 1.1.0
> In the 2 cases, I put the jar file in the deploy folder, then I execute
> Karaf which deployed my bundle.
>
> In the case of the version 1.1.0 of my bundle, you can see what is displayed
> below (bundle:update 215 allows to update the hibernate-osgi bundle. It
> seems it's necessary) :
>
>
> __ __ ____
> / //_/____ __________ _/ __/
> / ,< / __ `/ ___/ __ `/ /_
> / /| |/ /_/ / / / /_/ / __/
> /_/ |_|\__,_/_/ \__,_/_/
>
> Apache Karaf (4.0.4)
>
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>
> karaf@root()> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST
> 1.0.0*
> Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
> Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
> 1.0.0
> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
>
> karaf@root()> bundle:update 123
> *Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
> Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
> karaf@root()> bundle:update 215
> karaf@root()> bundle:refresh
> karaf@root()> Arret du bundle omega-module-jaxrs du projet OMEGA_WSREST
> 1.0.0
> Arret du bundle omega-module-service-metier du projet OMEGA_WS_REST 1.0.0
> *Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
> Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
> Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
> 1.0.0
> **Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0**
>
> *Everything is OK.*
>
>
>
>
> And here you can see the case of the deployement of the version 1.0.1 of my
> bundle (I start from a new installation of Karaf):
>
> __ __ ____
> / //_/____ __________ _/ __/
> / ,< / __ `/ ___/ __ `/ /_
> / /| |/ /_/ / / / /_/ / __/
> /_/ |_|\__,_/_/ \__,_/_/
>
> Apache Karaf (4.0.4)
>
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
>
> karaf@root()> Demarrage du bundle omega-module-dao du projet OMEGA_WSREST
> 1.0.0
> Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
> Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
> 1.0.0
> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
> /---------> Not OK : it should be 1.0.1/
>
> karaf@root()> bundle:update 123
> Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
> /---------> Not OK : it should be 1.0.1/
> karaf@root()> bundle:update 215
> karaf@root()> bundle:refresh
> karaf@root()> Arret du bundle omega-module-jaxrs du projet OMEGA_WSREST
> 1.0.0
> *Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
> Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
> /---------> Not OK : it should be 1.0.1 and only one time/
> Arret du bundle omega-module-service-metier du projet OMEGA_WS_REST 1.0.0
> Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.1
> Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.1*
> /---------> Not OK : it should be 1.0.1 and only one time/
> Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
> 1.0.0
>
>
>
> In the second case (version 1.0.1), you can see that after the
> "bundle:refresh" command, the bundle dao (version 1.0.1) seems to be
> deployed 2 times...
>
> Had you got the time to see my project? Have you an idea where is the
> problem?
>
> Thank you for your help.
>
> Olivier
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046440.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
Hi JB,
I see an other strange thing between the version 1.0.1 and the version 1.1.0
In the 2 cases, I put the jar file in the deploy folder, then I execute
Karaf which deployed my bundle.
In the case of the version 1.1.0 of my bundle, you can see what is displayed
below (bundle:update 215 allows to update the hibernate-osgi bundle. It
seems it's necessary) :
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (4.0.4)
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
karaf@root()> *Demarrage du bundle omega-module-dao du projet OMEGA_WSREST
1.0.0*
Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
1.0.0
*Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
karaf@root()> bundle:update 123
*Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
karaf@root()> bundle:update 215
karaf@root()> bundle:refresh
karaf@root()> Arret du bundle omega-module-jaxrs du projet OMEGA_WSREST
1.0.0
Arret du bundle omega-module-service-metier du projet OMEGA_WS_REST 1.0.0
*Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0*
Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
1.0.0
**Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.1.0**
*Everything is OK.*
And here you can see the case of the deployement of the version 1.0.1 of my
bundle (I start from a new installation of Karaf):
__ __ ____
/ //_/____ __________ _/ __/
/ ,< / __ `/ ___/ __ `/ /_
/ /| |/ /_/ / / / /_/ / __/
/_/ |_|\__,_/_/ \__,_/_/
Apache Karaf (4.0.4)
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf.
karaf@root()> Demarrage du bundle omega-module-dao du projet OMEGA_WSREST
1.0.0
Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
1.0.0
*Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
/---------> Not OK : it should be 1.0.1/
karaf@root()> bundle:update 123
Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
*Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
/---------> Not OK : it should be 1.0.1/
karaf@root()> bundle:update 215
karaf@root()> bundle:refresh
karaf@root()> Arret du bundle omega-module-jaxrs du projet OMEGA_WSREST
1.0.0
*Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0
Arret du bundle omega-module-dao du projet OMEGA_WSREST 1.0.0*
/---------> Not OK : it should be 1.0.1 and only one time/
Arret du bundle omega-module-service-metier du projet OMEGA_WS_REST 1.0.0
Demarrage du bundle omega-module-jaxrs du projet OMEGA_WSREST 1.0.0
*Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.1
Demarrage du bundle omega-module-dao du projet OMEGA_WSREST 1.0.1*
/---------> Not OK : it should be 1.0.1 and only one time/
Demarrage du bundle omega-module-service-metier du projet OMEGA_WS_REST
1.0.0
In the second case (version 1.0.1), you can see that after the
"bundle:refresh" command, the bundle dao (version 1.0.1) seems to be
deployed 2 times...
Had you got the time to see my project? Have you an idea where is the
problem?
Thank you for your help.
Olivier
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046440.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
To test, you must create a datasource.
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046437.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
---- Message d'origine ----
De : Olivier21 [via Karaf] <ml...@n3.nabble.com>
À : Olivier21 <ol...@netcourrier.com>
Objet : Re: Bundle versioning
Date : 28/04/2016 15:35:18 CEST
Thank you JB,
"bundle:update id" give the same result : "bundle X started in version 1.0.0"
The activator code is :
package org.omega.module.dao;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator
{
public void start(BundleContext context)
{
System.out.println("bundle X started in version 1.0.1");
}
public void stop(BundleContext context)
{
System.out.println("bundle X stopped in version 1.0.1");
}
}
I will try to give send you the kar archive and the different jar files.
Olivier
----------------------------------------------------------------------
If you reply to this email, your message will be added to the discussion below:
http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046435.html
To unsubscribe from Bundle versioning, click here.
NAML
wsrest-omega-module-kar-1.0.0.kar (2M) <http://karaf.922171.n3.nabble.com/attachment/4046436/0/wsrest-omega-module-kar-1.0.0.kar>
omega-module-dao-1.0.1.jar (25K) <http://karaf.922171.n3.nabble.com/attachment/4046436/1/omega-module-dao-1.0.1.jar>
omega-module-dao-1.1.0.jar (25K) <http://karaf.922171.n3.nabble.com/attachment/4046436/2/omega-module-dao-1.1.0.jar>
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046436.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
Thank you JB,
"bundle:update id" give the same result : "/bundle X started in version
1.0.0/"
The activator code is :
package org.omega.module.dao;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator
{
public void start(BundleContext context)
{
System.out.println("bundle X started in version 1.0.1");
}
public void stop(BundleContext context)
{
System.out.println("bundle X stopped in version 1.0.1");
}
}
I will try to give send you the kar archive and the different jar files.
Olivier
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046435.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Olivier,
bundle:update ?
What's your activator code ?
Regards
JB
On 04/28/2016 02:39 PM, Olivier21 wrote:
> Hi JB,
>
> I tried another way to deploy the version 1.0.1 of my bundle.
>
> I put the jar file in the maven repository (in the folder
> "apache-karaf-4.0.4/${user.home}/.m2/repository/org/omega/wsrest/omega-module-dao/1.0.1")
> and I execute the command :
>
> bundle:install -s mvn:org.omega.wsrest/omega-module-dao/*1.0.1*.
>
> The message which is diplayed is : "/bundle X started in version *1.0.0*/"
> instead of "/bundle X started in version *1.0.1*/"
>
> But if I do the same thing withe the release *1.1.0* of my bundle, the
> message which is diplayed is :
> "bundle X started in version *1.1.0*"
>
> Thank you for your help.
>
> Olivier
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046433.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
Hi JB,
I tried another way to deploy the version 1.0.1 of my bundle.
I put the jar file in the maven repository (in the folder
"apache-karaf-4.0.4/${user.home}/.m2/repository/org/omega/wsrest/omega-module-dao/1.0.1")
and I execute the command :
bundle:install -s mvn:org.omega.wsrest/omega-module-dao/*1.0.1*.
The message which is diplayed is : "/bundle X started in version *1.0.0*/"
instead of "/bundle X started in version *1.0.1*/"
But if I do the same thing withe the release *1.1.0* of my bundle, the
message which is diplayed is :
"bundle X started in version *1.1.0*"
Thank you for your help.
Olivier
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046433.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
JB, you can see the project in attached file above and you can see the
explanations :
/There is 5 modules :
> - OMEGA_WSREST is the parent module
> - omega-module-kar is the module which allows to generate the kar
> archive
> - omega-module-dao is the data access module
> - omega-module-jaxrs is the web layer module
> - omega-module-service-metier is the business layer module
>
> In fact, I separated each layer of my Web Service Rest.
>
> In order to create the kar archive, I right-click on the parent project
> (OMEGA_WSREST) then I choose "Run as" then "Maven build" then, in "goals",
> I type "clean install". It builds one jar by module and at the end, it
> generate a kar file thanks to the module "omega-module-kar".
>
> In fact, I thougt that the only way to install all my bundles and all the
> dependencies in Karaf was to generate a kar archive.
>
> Therefore, if you are a better way to install all my bundle easyly, I
> would like you show me. /
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046409.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Olivier,
unfortunately, it's not possible to attach file on the Apache mailing
lists. Can you share on github or so ?
Thanks,
Regards
JB
On 04/27/2016 05:29 PM, Olivier21 wrote:
> Thank you JB,
>
> In attached file, you can see my project. You have to unzip the file in your eclipse Workspace.
>
> There is 5 modules :
> - OMEGA_WSREST is the parent module
> - omega-module-kar is the module which allows to generate the kar archive
> - omega-module-dao is the data access module
> - omega-module-jaxrs is the web layer module
> - omega-module-service-metier is the business layer module
>
> In fact, I separated each layer of my Web Service Rest.
>
> In order to create the kar archive, I right-click on the parent project (OMEGA_WSREST) then I choose "Run as" then "Maven build" then, in "goals", I type "clean install". It builds one jar by module and at the end, it generate a kar file thanks to the module "omega-module-kar".
>
> In fact, I thougt that the only way to install all my bundles and all the dependencies in Karaf was to generate a kar archive.
>
> Therefore, if you are a better way to install all my bundle easyly, I would like you show me.
>
> Thank you for your help.
>
> Olivier
>
>
>
>
> ---- Message d'origine ----
> De : jbonofre [via Karaf] <ml...@n3.nabble.com>
> À : Olivier21 <ol...@netcourrier.com>
> Objet : Re: Bundle versioning
> Date : 27/04/2016 17:12:14 CEST
>
> Hi Olivier,
>
> sure, if you can share, I can take a look on your project.
>
> Thanks,
> Regards
> JB
>
> On 04/27/2016 05:10 PM, Olivier21 wrote:
>
>> Ok thank you.
>>
>> I have multiple bundles. In eclipse, it's represented by multiple modules.
>>
>> I have a parent module and many child modules.
>> Among these child modules, I have a module which contains a feature xml file
>> and it's created via the archetype "karaf-feature-archetype".
>>
>> When I right-click on the parent project then I choose "Run as" then "Maven
>> build" then, in "goals", I type "clean install", It builds one jar by module
>> and at the end, it generate a kar file thanks to the module which has been
>> created via the "karaf-feature-archetype".
>>
>> The xml feature contains :
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <features name="${project.artifactId}-${project.version}"
>> xmlns="http://karaf.apache.org/xmlns/features/v1.3.0">
>>
>>
>>
>> <repository>mvn:org.apache.cxf.karaf/apache-cxf/3.1.5/xml/features</repository>
>>
>> <repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/0.7.0/xml/features</repository>
>>
>>
>> <feature name='${project.artifactId}' description='${project.name}'
>> version='${project.version}'>
>> <details>${project.description}</details>
>>
>>
>> <feature version="3.1.5">cxf</feature>
>>
>>
>>
>> <feature>pax-jdbc</feature>
>> <feature>pax-jdbc-config</feature>
>> <feature>pax-jdbc-pool-dbcp2</feature>
>>
>>
>> <feature>jdbc</feature>
>>
>> <feature version="4.3.6.Final">hibernate</feature>
>> <feature version="2.3.0">jpa</feature>
>> <feature version="1.3.0">transaction</feature>
>> <feature version="4.0.4">jndi</feature>
>>
>>
>> <bundle>mvn:org.postgresql/postgresql/9.4-1203-jdbc41</bundle>
>>
>> <bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
>> <bundle>mvn:commons-logging/commons-logging/1.2</bundle>
>> <bundle>mvn:commons-io/commons-io/2.4</bundle>
>>
>>
>> <bundle>mvn:org.eclipse.persistence/javax.persistence/2.1.1</bundle>
>>
>>
>> <bundle>mvn:org.omega.wsrest/omega-module-dao/1.0.0</bundle>
>>
>> <bundle>mvn:org.omega.wsrest/omega-module-service-metier/1.0.0</bundle>
>> <bundle>mvn:org.omega.wsrest/omega-module-jaxrs/1.0.0</bundle>
>> </feature>
>>
>> </features>
>>
>>
>>
>> Have you a exemple of how to use the generate-descriptor plugin?
>>
>> Can I send you my project to allow you to better understand What I did?
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046403.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
Thank you JB,
In attached file, you can see my project. You have to unzip the file in your eclipse Workspace.
There is 5 modules :
- OMEGA_WSREST is the parent module
- omega-module-kar is the module which allows to generate the kar archive
- omega-module-dao is the data access module
- omega-module-jaxrs is the web layer module
- omega-module-service-metier is the business layer module
In fact, I separated each layer of my Web Service Rest.
In order to create the kar archive, I right-click on the parent project (OMEGA_WSREST) then I choose "Run as" then "Maven build" then, in "goals", I type "clean install". It builds one jar by module and at the end, it generate a kar file thanks to the module "omega-module-kar".
In fact, I thougt that the only way to install all my bundles and all the dependencies in Karaf was to generate a kar archive.
Therefore, if you are a better way to install all my bundle easyly, I would like you show me.
Thank you for your help.
Olivier
---- Message d'origine ----
De : jbonofre [via Karaf] <ml...@n3.nabble.com>
À : Olivier21 <ol...@netcourrier.com>
Objet : Re: Bundle versioning
Date : 27/04/2016 17:12:14 CEST
Hi Olivier,
sure, if you can share, I can take a look on your project.
Thanks,
Regards
JB
On 04/27/2016 05:10 PM, Olivier21 wrote:
> Ok thank you.
>
> I have multiple bundles. In eclipse, it's represented by multiple modules.
>
> I have a parent module and many child modules.
> Among these child modules, I have a module which contains a feature xml file
> and it's created via the archetype "karaf-feature-archetype".
>
> When I right-click on the parent project then I choose "Run as" then "Maven
> build" then, in "goals", I type "clean install", It builds one jar by module
> and at the end, it generate a kar file thanks to the module which has been
> created via the "karaf-feature-archetype".
>
> The xml feature contains :
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <features name="${project.artifactId}-${project.version}"
> xmlns="http://karaf.apache.org/xmlns/features/v1.3.0">
>
>
>
> <repository>mvn:org.apache.cxf.karaf/apache-cxf/3.1.5/xml/features</repository>
>
> <repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/0.7.0/xml/features</repository>
>
>
> <feature name='${project.artifactId}' description='${project.name}'
> version='${project.version}'>
> <details>${project.description}</details>
>
>
> <feature version="3.1.5">cxf</feature>
>
>
>
> <feature>pax-jdbc</feature>
> <feature>pax-jdbc-config</feature>
> <feature>pax-jdbc-pool-dbcp2</feature>
>
>
> <feature>jdbc</feature>
>
> <feature version="4.3.6.Final">hibernate</feature>
> <feature version="2.3.0">jpa</feature>
> <feature version="1.3.0">transaction</feature>
> <feature version="4.0.4">jndi</feature>
>
>
> <bundle>mvn:org.postgresql/postgresql/9.4-1203-jdbc41</bundle>
>
> <bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
> <bundle>mvn:commons-logging/commons-logging/1.2</bundle>
> <bundle>mvn:commons-io/commons-io/2.4</bundle>
>
>
> <bundle>mvn:org.eclipse.persistence/javax.persistence/2.1.1</bundle>
>
>
> <bundle>mvn:org.omega.wsrest/omega-module-dao/1.0.0</bundle>
>
> <bundle>mvn:org.omega.wsrest/omega-module-service-metier/1.0.0</bundle>
> <bundle>mvn:org.omega.wsrest/omega-module-jaxrs/1.0.0</bundle>
> </feature>
>
> </features>
>
>
>
> Have you a exemple of how to use the generate-descriptor plugin?
>
> Can I send you my project to allow you to better understand What I did?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046403.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
----------------------------------------------------------------------
If you reply to this email, your message will be added to the discussion below:
http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046404.html
To unsubscribe from Bundle versioning, click here.
NAML
OMEGA_WSREST.zip (2M) <http://karaf.922171.n3.nabble.com/attachment/4046405/0/OMEGA_WSREST.zip>
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046405.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
Ok Thank Jean-Baptiste,
I sent you the project to the email I receive in response of this post.
Olivier
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046406.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Olivier,
sure, if you can share, I can take a look on your project.
Thanks,
Regards
JB
On 04/27/2016 05:10 PM, Olivier21 wrote:
> Ok thank you.
>
> I have multiple bundles. In eclipse, it's represented by multiple modules.
>
> I have a parent module and many child modules.
> Among these child modules, I have a module which contains a feature xml file
> and it's created via the archetype "karaf-feature-archetype".
>
> When I right-click on the parent project then I choose "Run as" then "Maven
> build" then, in "goals", I type "clean install", It builds one jar by module
> and at the end, it generate a kar file thanks to the module which has been
> created via the "karaf-feature-archetype".
>
> The xml feature contains :
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <features name="${project.artifactId}-${project.version}"
> xmlns="http://karaf.apache.org/xmlns/features/v1.3.0">
>
>
>
> <repository>mvn:org.apache.cxf.karaf/apache-cxf/3.1.5/xml/features</repository>
>
> <repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/0.7.0/xml/features</repository>
>
>
> <feature name='${project.artifactId}' description='${project.name}'
> version='${project.version}'>
> <details>${project.description}</details>
>
>
> <feature version="3.1.5">cxf</feature>
>
>
>
> <feature>pax-jdbc</feature>
> <feature>pax-jdbc-config</feature>
> <feature>pax-jdbc-pool-dbcp2</feature>
>
>
> <feature>jdbc</feature>
>
> <feature version="4.3.6.Final">hibernate</feature>
> <feature version="2.3.0">jpa</feature>
> <feature version="1.3.0">transaction</feature>
> <feature version="4.0.4">jndi</feature>
>
>
> <bundle>mvn:org.postgresql/postgresql/9.4-1203-jdbc41</bundle>
>
> <bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
> <bundle>mvn:commons-logging/commons-logging/1.2</bundle>
> <bundle>mvn:commons-io/commons-io/2.4</bundle>
>
>
> <bundle>mvn:org.eclipse.persistence/javax.persistence/2.1.1</bundle>
>
>
> <bundle>mvn:org.omega.wsrest/omega-module-dao/1.0.0</bundle>
>
> <bundle>mvn:org.omega.wsrest/omega-module-service-metier/1.0.0</bundle>
> <bundle>mvn:org.omega.wsrest/omega-module-jaxrs/1.0.0</bundle>
> </feature>
>
> </features>
>
>
>
> Have you a exemple of how to use the generate-descriptor plugin?
>
> Can I send you my project to allow you to better understand What I did?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046403.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
Ok thank you.
I have multiple bundles. In eclipse, it's represented by multiple modules.
I have a parent module and many child modules.
Among these child modules, I have a module which contains a feature xml file
and it's created via the archetype "karaf-feature-archetype".
When I right-click on the parent project then I choose "Run as" then "Maven
build" then, in "goals", I type "clean install", It builds one jar by module
and at the end, it generate a kar file thanks to the module which has been
created via the "karaf-feature-archetype".
The xml feature contains :
<?xml version="1.0" encoding="UTF-8"?>
<features name="${project.artifactId}-${project.version}"
xmlns="http://karaf.apache.org/xmlns/features/v1.3.0">
<repository>mvn:org.apache.cxf.karaf/apache-cxf/3.1.5/xml/features</repository>
<repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/0.7.0/xml/features</repository>
<feature name='${project.artifactId}' description='${project.name}'
version='${project.version}'>
<details>${project.description}</details>
<feature version="3.1.5">cxf</feature>
<feature>pax-jdbc</feature>
<feature>pax-jdbc-config</feature>
<feature>pax-jdbc-pool-dbcp2</feature>
<feature>jdbc</feature>
<feature version="4.3.6.Final">hibernate</feature>
<feature version="2.3.0">jpa</feature>
<feature version="1.3.0">transaction</feature>
<feature version="4.0.4">jndi</feature>
<bundle>mvn:org.postgresql/postgresql/9.4-1203-jdbc41</bundle>
<bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
<bundle>mvn:commons-logging/commons-logging/1.2</bundle>
<bundle>mvn:commons-io/commons-io/2.4</bundle>
<bundle>mvn:org.eclipse.persistence/javax.persistence/2.1.1</bundle>
<bundle>mvn:org.omega.wsrest/omega-module-dao/1.0.0</bundle>
<bundle>mvn:org.omega.wsrest/omega-module-service-metier/1.0.0</bundle>
<bundle>mvn:org.omega.wsrest/omega-module-jaxrs/1.0.0</bundle>
</feature>
</features>
Have you a exemple of how to use the generate-descriptor plugin?
Can I send you my project to allow you to better understand What I did?
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046403.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I see.
If you have a single bundle, you don't need feature or kar.
If you have multiple bundles, then just create a features XML (or use
the generate-descriptor plugin).
Regards
JB
On 04/27/2016 04:43 PM, Olivier21 wrote:
> In fact I create the kar file with the maven archetype
> "org.apache.karaf.archetypes" in Eclipse
>
> groupId : org.apache.karaf.archetypes
> ArtefactId : karaf-feature-archetype
>
> Thank you for your help.
>
> Olivier
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046401.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
In fact I create the kar file with the maven archetype
"org.apache.karaf.archetypes" in Eclipse
groupId : org.apache.karaf.archetypes
ArtefactId : karaf-feature-archetype
Thank you for your help.
Olivier
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046401.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Olivier,
how do you create the kar file ?
A kar file is basically a zip file packaging features XML ;)
So I guess you already have your features XML ;)
Regards
JB
On 04/27/2016 04:32 PM, Olivier21 wrote:
> Hi,
>
> Sorry I forgot the karaf version. This is the version 4.0.4...
>
> I didn't try to remove data or other folder. This is the default
> installation of Karaf.
>
> Have you an exemple to generate a feature from an eclipse project which is
> composed of many maven module?
>
> Thank you for your help.
>
> Olivier
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046399.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Bundle versioning
Posted by Olivier21 <ol...@netcourrier.com>.
Hi,
Sorry I forgot the karaf version. This is the version 4.0.4...
I didn't try to remove data or other folder. This is the default
installation of Karaf.
Have you an exemple to generate a feature from an eclipse project which is
composed of many maven module?
Thank you for your help.
Olivier
--
View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396p4046399.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Bundle versioning
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,
What's your Karaf version ? I tested similar scenario with 4.0.4 without
problem.
Did you try to remove data or other folders ?
Generally speaking, kar is an atomic deployment. Prefer to use feature
directly, it's more flexible.
Regards
JB
On 04/27/2016 04:21 PM, Olivier21 wrote:
> Hello,
>
> I'm a newbie for Karaf and I have two problems.
>
> 1) I installed a kar archive in Karaf via the deploy folder.
>
> 2)After, I tested the Web Service and it works fine. The version of all the
> OSGI bundle in the archive is "1.0.0" and all the bundles have got a class
> "Activator" which display the message "bundle X started in version 1.0.0"
> after the deployement.
>
> 3) I stopped Karaf
>
> 4) I remove the kar archive from the deploy folder
>
> 5) I decided to change the release of one of the OSGI bundles to "1.0.1" and
> I created a jar file that I copy in the deploy folder. This bundle have got
> a class "Activator" which should display the message "bundle X started in
> version 1.0.1".
>
> 6) I started Karaf
>
> 7) The message "bundle X started in version *1.0.0*" is displayed instead of
> the message "bundle X started in version *1.0.1*". Hence, this message
> appears 2 times because I didn't remove the release "1.0.0" of this bundle.
>
> 8) If I stop Karaf then I remove the jar file from the deploy folder then I
> restart Karaf, then the message "bundle X started in version *1.0.0*"
> doesn't appears any more but the message "bundle X started in version
> *1.0.1*" appears 2 times.
>
>
> Nevertheless, instead of renaming the version "1.0.0" to "1.0.1", if I
> rename the version "1.0.0" to "1.1.0" (in the point 5 above), then I started
> Karaf (in the point 6 above), the message "bundle X started in version
> *1.0.0*" appears firstly (that's normal) followed by the message "bundle X
> started in version *1.1.0*". Hence, everything is normal in this case.
>
>
> *Could you say me why it doesn't work like this in the case of the version
> "1.0.1" please?*
>
>
>
> For your information, here is an extract of the parent pom :
>
>
> <dependency>
> <groupId>org.omega.wsrest</groupId>
> <artifactId>omega-module-service-metier</artifactId>
> <version>[1.0.0, 2.0)</version>
> </dependency>
>
> <dependency>
> <groupId>org.omega.wsrest</groupId>
> <artifactId>omega-module-dao</artifactId>
> <version>[1.0.0, 2.0)</version>
> </dependency>
>
>
> and here is an extract of the child pom :
>
>
> <dependency>
> <groupId>org.omega.wsrest</groupId>
> <artifactId>omega-module-service-metier</artifactId>
> <version>1.0.0</version>
> <type>bundle</type>
> </dependency>
>
> <dependency>
> <groupId>org.omega.wsrest</groupId>
> <artifactId>omega-module-dao</artifactId>
> <version>1.0.0</version>
> <type>bundle</type>
> </dependency>
>
>
>
> All the modules (parents and childs are in the kar archive).
>
>
>
> Moreover, I have a second question : in my case, I have a bundle A which is
> called by :
> - bundle B
> - and Bundle C
>
> This is the bundle A which is in my Jar archive. *How to do to say to bundle
> B and C to point to the new release of bundle A?* (Until now, I restarted
> Karaf ...but I imagine there is another way).
>
> Thank you in advance for your help.
>
> Olivier
>
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Bundle-versioning-tp4046396.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com