You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ntle <nt...@castortech.com> on 2019/06/13 17:47:54 UTC

Kar installer alto start bundle regardless of start=false in feature

Hello,

I have a .kar file that contain 1 feature with a lot of bundles that we has
been running from eclipse. Installing the .kar to karaf took a few second
but i noticed *the bundles were started immediately* although my
o.apache.karaf.kar.cfg was set to not auto start:
noAutoRefreshBundles=true
noAutoStartBundles=true

And the kar installation also specify not starting:
kar:install --no-start
file:./../irisba/com.castortech.iris.vision.tycho/target/irisba.kar

And even inside the features.xml, all the bundles are set not to start:
<?xml version="1.0" encoding="UTF-8"?>
<features>
  <feature name='IrisBA' version='1.0.0' description='IrisBA feature'>
    <bundle
start="false">mvn:com.castortech.filters/ba/1.0.0-201906121937</bundle>
........
    <bundle
start="false">mvn:org.eclipse.equinox/app/1.3.400-v20150715-1528</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox/common/3.9.0-v20170207-1454</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox/concurrent/1.1.0-v20130327-1442</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox/console/1.1.300-v20170512-2111</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox/event/1.4.0-v20170105-1446</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox.http/registry/1.1.400-v20150715-1528</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox.jsp.jasper/registry/1.0.300-v20130327-1442</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox.jsp/jasper/1.0.500-v20150119-1358</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox/preferences/3.7.0-v20170126-2132</bundle>
    <bundle
start="false">mvn:org.eclipse.equinox/registry/3.7.0-v20170222-1344</bundle>
    <bundle
start="false">mvn:org.eclipse.osgi.compatibility/state/1.1.0-v20170516-1513</bundle>
    <bundle
start="false">mvn:org.eclipse.osgi.services/remoteserviceadmin/1.6.100-v20160907-0906</bundle>
    <bundle
start="false">mvn:org.eclipse.osgi/util/3.4.0-v20170111-1608</bundle>
    <bundle
start="false">mvn:org.osgi.service/cm/1.5.0-201505202024</bundle>
    <bundle
start="false">mvn:org.osgi.service/component/1.3.0-201505202024</bundle>
    <bundle
start="false">mvn:org.osgi.service/event/1.3.1-201505202024</bundle>
    <bundle
start="false">mvn:org.osgi.service/jaxrs/1.0.0-201802012106</bundle>
    <bundle
start="false">mvn:org.osgi.service/metatype/1.3.0-201505202024</bundle>
    <bundle
start="false">mvn:org.osgi.util/function/1.1.0-201802012106</bundle>
    <bundle
start="false">mvn:org.osgi.util/promise/1.1.0-201802012106</bundle>
    <bundle
start="false">mvn:org.osgi.util/pushstream/1.0.0-201802012107</bundle>
.......
  </feature>
</features>

I'm not sure if this is due to the installation of the o.eclipse.equinox*
and org.osgi* bundles in my features.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by ntle <nt...@castortech.com>.
Thank you for looking into this JB

Thai



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

I'm testing it today as part of Jira KARAF-6334.

Regards
JB

On 03/07/2019 01:27, ntle wrote:
> Hi JB,
> 
> Do you have any update on this?
> 
> Thai
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
FYI, I already found couple of issue with the KAR service. I'm doing a
complete pass right now. I keep you posted.

Regards
JB

On 03/07/2019 01:27, ntle wrote:
> Hi JB,
> 
> Do you have any update on this?
> 
> Thai
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by ntle <nt...@castortech.com>.
Hi JB,

Do you have any update on this?

Thai



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

not yet, I will do it before the end of this week.

I will update the Jira I created about that.

Regards
JB

On 25/06/2019 22:42, ntle wrote:
> Hello JB,
> 
> Have you got a chance to do the test ?
> 
> Thai
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by ntle <nt...@castortech.com>.
Hello JB,

Have you got a chance to do the test ?

Thai



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by ntle <nt...@castortech.com>.
Hi JB,

Found a particular bundle that is getting start when installing kar with
only 1 feature with 1 bundle:

The org.hamcrest.core is always trying to start regardless of no start
option. Here is my feature xml:
<?xml version="1.0" encoding="UTF-8"?>
<features>
  <feature name='IrisBA' version='1.0.0' description='IrisBA feature'>

    <bundle start='false'>mvn:org.hamcrest/core/1.3.0-v201303031735</bundle>

  </feature>
</features>

Here is console log show the bundle is starting when the bundle is installed

C:\Users\ntle\gitNew\apache-karaf-4.2.6>bin\karaf.bat clean
 ...
karaf@root()> kar:install --no-start
file:./../irisba/com.castortech.iris.vision.tycho/target/irisba.kar
karaf@root()> feature:info IrisBA
Feature IrisBA 1.0.0
Description:
  IrisBA feature
Feature has no configuration
Feature has no configuration files
Feature has no dependencies.
Feature contains followed bundles:
  mvn:org.hamcrest/core/1.3.0-v201303031735
Feature has no conditionals.
karaf@root()> feature:info IrisBA
Feature IrisBA 1.0.0
Description:
  IrisBA feature
Feature has no configuration
Feature has no configuration files
Feature has no dependencies.
Feature contains followed bundles:
  mvn:org.hamcrest/core/1.3.0-v201303031735
Feature has no conditionals.
karaf@root()>
karaf@root()> bundle:list -t 0 -s | grep hamcrest
45 | Starting |  80 | 1.3.0.v201303031735     | org.hamcrest.core
karaf@root()>



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Or you can simply use more "classic" OSGi form ;)
No need to use pde or bnd.

You can take a look on the examples in the Karaf distribution.

Anyway, I'm working on the kar test case and I will let you know if it's
a bug.

Regards
JB

On 14/06/2019 17:06, ntle wrote:
> Thanks JB,
> 
> Our application was originally an eclipse base product so dependency is
> managed by pde. We are migrating the app to web base but still using pde
> (running from eclipse osgi launcher at the moment) so in order to deploy to
> karaf we are using karaf-bridge
> (https://github.com/hstaudacher/tycho-karaf-bridge) to put all our bundles
> to a single feature in a kar file. This type of deployment will be changed
> when we switch our env to bnd which is maven base, at that point we can
> build our feature and install from maven repo.
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by ntle <nt...@castortech.com>.
Thanks JB,

Our application was originally an eclipse base product so dependency is
managed by pde. We are migrating the app to web base but still using pde
(running from eclipse osgi launcher at the moment) so in order to deploy to
karaf we are using karaf-bridge
(https://github.com/hstaudacher/tycho-karaf-bridge) to put all our bundles
to a single feature in a kar file. This type of deployment will be changed
when we switch our env to bnd which is maven base, at that point we can
build our feature and install from maven repo.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Are you require to use a KAR ? No way to directly use feature ?

Anyway, I'm trying to reproduce in a test case.

I keep you posted.

Regards
JB

On 14/06/2019 15:56, ntle wrote:
> Do you have any suggestion on this issue? I'm trying to load bundle to the
> kar file one by one and install to karaf to see at which bundle this
> behavior occurs.
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by ntle <nt...@castortech.com>.
Do you have any suggestion on this issue? I'm trying to load bundle to the
kar file one by one and install to karaf to see at which bundle this
behavior occurs.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by ntle <nt...@castortech.com>.
oh, sorry, I'm using 4.2.6



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
And the Karaf version you are using ?

Regards
JB

On 13/06/2019 20:44, ntle wrote:
> JB,
> 
> I dont have install attribute on the feature, only "name", "version" and
> "description".
> 
> Thai Le
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by ntle <nt...@castortech.com>.
JB,

I dont have install attribute on the feature, only "name", "version" and
"description".

Thai Le



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Kar installer alto start bundle regardless of start=false in feature

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

what Karaf version are you using ?

Don't you have install attribution on the feature ?

Regards
JB

On 13/06/2019 19:47, ntle wrote:
> Hello,
> 
> I have a .kar file that contain 1 feature with a lot of bundles that we has
> been running from eclipse. Installing the .kar to karaf took a few second
> but i noticed *the bundles were started immediately* although my
> o.apache.karaf.kar.cfg was set to not auto start:
> noAutoRefreshBundles=true
> noAutoStartBundles=true
> 
> And the kar installation also specify not starting:
> kar:install --no-start
> file:./../irisba/com.castortech.iris.vision.tycho/target/irisba.kar
> 
> And even inside the features.xml, all the bundles are set not to start:
> <?xml version="1.0" encoding="UTF-8"?>
> <features>
>   <feature name='IrisBA' version='1.0.0' description='IrisBA feature'>
>     <bundle
> start="false">mvn:com.castortech.filters/ba/1.0.0-201906121937</bundle>
> ........
>     <bundle
> start="false">mvn:org.eclipse.equinox/app/1.3.400-v20150715-1528</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox/common/3.9.0-v20170207-1454</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox/concurrent/1.1.0-v20130327-1442</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox/console/1.1.300-v20170512-2111</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox/event/1.4.0-v20170105-1446</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox.http/registry/1.1.400-v20150715-1528</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox.jsp.jasper/registry/1.0.300-v20130327-1442</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox.jsp/jasper/1.0.500-v20150119-1358</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox/preferences/3.7.0-v20170126-2132</bundle>
>     <bundle
> start="false">mvn:org.eclipse.equinox/registry/3.7.0-v20170222-1344</bundle>
>     <bundle
> start="false">mvn:org.eclipse.osgi.compatibility/state/1.1.0-v20170516-1513</bundle>
>     <bundle
> start="false">mvn:org.eclipse.osgi.services/remoteserviceadmin/1.6.100-v20160907-0906</bundle>
>     <bundle
> start="false">mvn:org.eclipse.osgi/util/3.4.0-v20170111-1608</bundle>
>     <bundle
> start="false">mvn:org.osgi.service/cm/1.5.0-201505202024</bundle>
>     <bundle
> start="false">mvn:org.osgi.service/component/1.3.0-201505202024</bundle>
>     <bundle
> start="false">mvn:org.osgi.service/event/1.3.1-201505202024</bundle>
>     <bundle
> start="false">mvn:org.osgi.service/jaxrs/1.0.0-201802012106</bundle>
>     <bundle
> start="false">mvn:org.osgi.service/metatype/1.3.0-201505202024</bundle>
>     <bundle
> start="false">mvn:org.osgi.util/function/1.1.0-201802012106</bundle>
>     <bundle
> start="false">mvn:org.osgi.util/promise/1.1.0-201802012106</bundle>
>     <bundle
> start="false">mvn:org.osgi.util/pushstream/1.0.0-201802012107</bundle>
> .......
>   </feature>
> </features>
> 
> I'm not sure if this is due to the installation of the o.eclipse.equinox*
> and org.osgi* bundles in my features.
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com