Re: Weird behaviour when uninstalling feature with fragment

2017-05-29 Thread Steinar Bang
> Steinar Bang :
> Achim Nierbeck :

>> But maybe a lib your using might fire this in case of an "error".

> This could be it.

> The problem bundle is an OSGi bundle fragment made from the
> liquibase-slf4j maven dependency[1], as outlined in
>  
> http://karaf.922171.n3.nabble.com/Experiences-with-karaf-and-liquibase-tp4050470p4050471.html

> Could it be that something strange happens with slf4j when the fragment
> is uninstalled, and that this is what kills karaf...?

> [1] 

I did another experiment: I made the fragment bundle be empty (ie. made
a bundle without any code).  And that bundle could be uninstalled
without getting an error message.

So the best guess is that there is something in this code that gives a
problem when the bundle is yanked:
 
https://github.com/mattbertolini/liquibase-slf4j/blob/master/src/main/java/liquibase/ext/logging/slf4j/Slf4jLogger.java



Re: Weird behaviour when uninstalling feature with fragment

2017-05-29 Thread Steinar Bang
> Achim Nierbeck :

> Not sure, but at first glance this reminds me of a system.exit
> somewhere in the code.  May it be that something in your code fires
> this on a "change" or Bundle stop?

My own code, by itself does not trigger this issue.
I tried various things by elimination, and it's the introduction of the
fragment bundle that is the problem.

> But maybe a lib your using might fire this in case of an "error".

This could be it.

The problem bundle is an OSGi bundle fragment made from the
liquibase-slf4j maven dependency[1], as outlined in
 
http://karaf.922171.n3.nabble.com/Experiences-with-karaf-and-liquibase-tp4050470p4050471.html

Could it be that something strange happens with slf4j when the fragment
is uninstalled, and that this is what kills karaf...?

[1] 



Re: Weird behaviour when uninstalling feature with fragment

2017-05-29 Thread Achim Nierbeck
Hi Steinar ...

Not sure, but at first glance this reminds me of a system.exit somewhere in
the code.
May it be that something in your code fires this on a "change" or Bundle
stop?
But maybe a lib your using might fire this in case of an "error".

regards, Achim

2017-05-29 21:19 GMT+02:00 Steinar Bang :

> > Steinar Bang :
>
> > When I followed your instructions, and:
> >  - Created a maven module that rebundled the liquibase-slf4j jar into an
> >OSGi bundle fragment (as outlined in your gist)
> >  - Modified the feature.xml file as outlined in the quoted file above
> >(the start levels are important)
>
> It works: ie. the feature installs, and liquibase output ends up in
> karaf.log.
>
> However, when I uninstall the feature containing the fragment, karaf
> itself shuts down.
>
> Has anyone else seen something similar?
> Is this expected behaviour of fragments?
>
> If I remove the liquibase-slf4j-osgi fragment OSGi bundle from the
> feature, then liquibase output ends up on the karaf console, but there
> are no strange side effects from uninstalling the feature.
>
> Here's karaf.log output from the shutdown that happens caused by feature
> uninstall (the unexpected stuff is from "2017-05-28T23:30:02,177"
> ("FelixShutdown"):
>
> 2017-05-28T23:30:01,840 | INFO  | pipe-feature:install
> ukelonn-db-derby-test | FeaturesServiceImpl  | 9 -
> org.apache.karaf.features.core - 4.1.1 | Removing features:
> feature:ukelonn-db-derby-test/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]
> 2017-05-28T23:30:02,040 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 | Changes to
> perform:
> 2017-05-28T23:30:02,040 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |   Region: root
> 2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 | Bundles to
> uninstall:
> 2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  derby/10.11.101.1616546
> 2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  no.priv.bang.ukelonn.api/1.0.0.SNAPSHOT
> 2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  no.priv.bang.ukelonn.db.liquibase/1.0.0.SNAPSHOT
> 2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  no.priv.bang.ukelonn.db.test/1.0.0.SNAPSHOT
> 2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  no.priv.bang.ukelonn.rebundled.liquibase-slf4j-osgi/2.0.0
> 2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.liquibase.core/3.5.3
> 2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.ops4j.base.spi/1.5.0
> 2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.ops4j.pax.jdbc/1.0.1
> 2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.ops4j.pax.jdbc.derby/1.0.1
> 2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.osgi.service.jdbc/1.0.0.201505202023
> 2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.yaml.snakeyaml/1.17.0
> 2017-05-28T23:30:02,043 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 | Stopping bundles:
> 2017-05-28T23:30:02,045 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.yaml.snakeyaml/1.17.0
> 2017-05-28T23:30:02,046 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.osgi.service.jdbc/1.0.0.201505202023
> 2017-05-28T23:30:02,046 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.ops4j.pax.jdbc/1.0.1
> 2017-05-28T23:30:02,049 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.ops4j.base.spi/1.5.0
> 2017-05-28T23:30:02,049 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.1.1 |
>  org.liquibase.core/3.5.3
> 2017-05-28T23:30:02,050 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
>   

Weird behaviour when uninstalling feature with fragment

2017-05-29 Thread Steinar Bang
> Steinar Bang :

> When I followed your instructions, and:
>  - Created a maven module that rebundled the liquibase-slf4j jar into an
>OSGi bundle fragment (as outlined in your gist)
>  - Modified the feature.xml file as outlined in the quoted file above
>(the start levels are important)

It works: ie. the feature installs, and liquibase output ends up in
karaf.log.

However, when I uninstall the feature containing the fragment, karaf
itself shuts down.

Has anyone else seen something similar?
Is this expected behaviour of fragments?

If I remove the liquibase-slf4j-osgi fragment OSGi bundle from the
feature, then liquibase output ends up on the karaf console, but there
are no strange side effects from uninstalling the feature.

Here's karaf.log output from the shutdown that happens caused by feature
uninstall (the unexpected stuff is from "2017-05-28T23:30:02,177"
("FelixShutdown"): 

2017-05-28T23:30:01,840 | INFO  | pipe-feature:install ukelonn-db-derby-test | 
FeaturesServiceImpl  | 9 - org.apache.karaf.features.core - 4.1.1 | 
Removing features: feature:ukelonn-db-derby-test/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]
2017-05-28T23:30:02,040 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 | Changes to perform:
2017-05-28T23:30:02,040 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   Region: root
2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 | Bundles to uninstall:
2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
derby/10.11.101.1616546
2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
no.priv.bang.ukelonn.api/1.0.0.SNAPSHOT
2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
no.priv.bang.ukelonn.db.liquibase/1.0.0.SNAPSHOT
2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
no.priv.bang.ukelonn.db.test/1.0.0.SNAPSHOT
2017-05-28T23:30:02,041 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
no.priv.bang.ukelonn.rebundled.liquibase-slf4j-osgi/2.0.0
2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
org.liquibase.core/3.5.3
2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
org.ops4j.base.spi/1.5.0
2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
org.ops4j.pax.jdbc/1.0.1
2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
org.ops4j.pax.jdbc.derby/1.0.1
2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
org.osgi.service.jdbc/1.0.0.201505202023
2017-05-28T23:30:02,042 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
org.yaml.snakeyaml/1.17.0
2017-05-28T23:30:02,043 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 | Stopping bundles:
2017-05-28T23:30:02,045 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   org.yaml.snakeyaml/1.17.0
2017-05-28T23:30:02,046 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
org.osgi.service.jdbc/1.0.0.201505202023
2017-05-28T23:30:02,046 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   org.ops4j.pax.jdbc/1.0.1
2017-05-28T23:30:02,049 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   org.ops4j.base.spi/1.5.0
2017-05-28T23:30:02,049 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   org.liquibase.core/3.5.3
2017-05-28T23:30:02,050 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
no.priv.bang.ukelonn.db.test/1.0.0.SNAPSHOT
2017-05-28T23:30:02,051 | INFO  | pool-3-thread-1  | FeaturesServiceImpl
  | 9 - org.apache.karaf.features.core - 4.1.1 |   
no.priv.bang.ukelonn.db.liquibase/1.0.0.SNAPSHOT
2017-05-28T23:30:02,052 | INFO  | pool-3-thread-1  | FeaturesServiceImpl