Karaf 4.2.7 shutdown unexpected

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Karaf 4.2.7 shutdown unexpected

Zhendong Chen
Hi all,

we are using Karaf 4.2.7 with Spring 5.1.9 and Hibernate 5.3.14.
After Karaf Started, we trying install a new feature, and Karaf shutdown
with no Exception.
By using Hibernate 5.2.12 everything is ok.

How can I find out or which logger should I use, why Karaf did that?

org.apache.karaf.features.internal.service.FeaturesServiceImpl   | Changes
to perform:
org.apache.karaf.features.internal.service.FeaturesServiceImpl   |   Region:
root
org.apache.karaf.features.internal.service.FeaturesServiceImpl   |    
Bundles to install:
org.apache.karaf.features.internal.service.FeaturesServiceImpl   | Stopping
bundles:

Thanks!

Best,
Zhendong



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

fpapon
Hi,

It seems like you have the system bundle (0) restarted because of the
refresh.

You can use the "-v" option with "feature:install" to have more
informations.

regards,

François
[hidden email]

Le 23/01/2020 à 19:28, Zhendong Chen a écrit :

> Hi all,
>
> we are using Karaf 4.2.7 with Spring 5.1.9 and Hibernate 5.3.14.
> After Karaf Started, we trying install a new feature, and Karaf shutdown
> with no Exception.
> By using Hibernate 5.2.12 everything is ok.
>
> How can I find out or which logger should I use, why Karaf did that?
>
> org.apache.karaf.features.internal.service.FeaturesServiceImpl   | Changes
> to perform:
> org.apache.karaf.features.internal.service.FeaturesServiceImpl   |   Region:
> root
> org.apache.karaf.features.internal.service.FeaturesServiceImpl   |    
> Bundles to install:
> org.apache.karaf.features.internal.service.FeaturesServiceImpl   | Stopping
> bundles:
>
> Thanks!
>
> Best,
> Zhendong
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
François Papon
fpapon@apache.org
Yupiik - https://www.yupiik.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

Zhendong Chen
Thanks François, I used "-v" option, but still don't get more information. :(



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

jbonofre
Hi,

can you simulate the feature installation with feature:install -t -v ?

You should have the resolver output identifying the cause of the refresh.

Regards
JB

On 23/01/2020 22:44, Zhendong Chen wrote:
> Thanks François, I used "-v" option, but still don't get more information. :(
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

Zhendong Chen
Thanks JB, how should I understand these warning?

    org.apache.aries.blueprint.core/1.10.2 (Should be wired to:
osgi.cmpn/5.0.0.201305092017 (through
[org.apache.aries.blueprint.core/1.10.2] osgi.wiring.package;
filter:="(&(osgi.wiring.package=org.osgi.service.blueprint.container)(version>=1.0.0)(!(version>=1.1.0)))"))

    org.apache.aries.jmx.blueprint.core/1.2.0 (Should be wired to:
osgi.cmpn/5.0.0.201305092017 (through
[org.apache.aries.jmx.blueprint.core/1.2.0] osgi.wiring.package;
filter:="(&(osgi.wiring.package=org.osgi.service.blueprint.container)(version>=1.0.0)(!(version>=2.0.0)))"))

    org.apache.felix.coordinator/1.0.2 (Should be wired to:
osgi.cmpn/5.0.0.201305092017 (through [org.apache.felix.coordinator/1.0.2]
osgi.wiring.package;
filter:="(&(osgi.wiring.package=org.osgi.service.coordinator)(version>=1.0.0)(!(version>=2.0.0)))"))

    org.eclipse.equinox.preferences/3.7.0.v20170126-2132 (Should be wired
to: osgi.cmpn/5.0.0.201305092017 (through
[org.eclipse.equinox.preferences/3.7.0.v20170126-2132] osgi.wiring.package;
filter:="(&(osgi.wiring.package=org.osgi.service.prefs)(version>=1.1.1)(!(version>=1.2.0)))"))



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

jbonofre
Hi,

I would like to complete trace to have the complete picture. It can
happen when several bundles provide the same package.
Most of the time, a refresh (bundle:refresh) re-evaluates the wiring.

Regards
JB

On 29/01/2020 22:20, Zhendong Chen wrote:

> Thanks JB, how should I understand these warning?
>
>     org.apache.aries.blueprint.core/1.10.2 (Should be wired to:
> osgi.cmpn/5.0.0.201305092017 (through
> [org.apache.aries.blueprint.core/1.10.2] osgi.wiring.package;
> filter:="(&(osgi.wiring.package=org.osgi.service.blueprint.container)(version>=1.0.0)(!(version>=1.1.0)))"))
>
>     org.apache.aries.jmx.blueprint.core/1.2.0 (Should be wired to:
> osgi.cmpn/5.0.0.201305092017 (through
> [org.apache.aries.jmx.blueprint.core/1.2.0] osgi.wiring.package;
> filter:="(&(osgi.wiring.package=org.osgi.service.blueprint.container)(version>=1.0.0)(!(version>=2.0.0)))"))
>
>     org.apache.felix.coordinator/1.0.2 (Should be wired to:
> osgi.cmpn/5.0.0.201305092017 (through [org.apache.felix.coordinator/1.0.2]
> osgi.wiring.package;
> filter:="(&(osgi.wiring.package=org.osgi.service.coordinator)(version>=1.0.0)(!(version>=2.0.0)))"))
>
>     org.eclipse.equinox.preferences/3.7.0.v20170126-2132 (Should be wired
> to: osgi.cmpn/5.0.0.201305092017 (through
> [org.eclipse.equinox.preferences/3.7.0.v20170126-2132] osgi.wiring.package;
> filter:="(&(osgi.wiring.package=org.osgi.service.prefs)(version>=1.1.1)(!(version>=1.2.0)))"))
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

Zhendong Chen
Hi JB,

I found the problem.
The new hibernate-osgi feature, see hibernate-osgi-5.3.14.Final-karaf.xml
has changed compare with 5.2.x

If I remove these two lines, everything is ok.
<feature>aries-blueprint</feature>
<bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>

How can I pragmatically remove these dependency?
We use this dependency since 4.2.7
                <dependency>
                        <groupId>org.hibernate</groupId>
                        <artifactId>hibernate-osgi</artifactId>
                        <classifier>karaf</classifier>
                        <version>5.3.14.Final</version>
                        <type>xml</type>
                        <scope>runtime</scope>
                </dependency>

Best,
Zhendong



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

jbonofre
Hi,

Good catch.

In Karaf, we have our own hibernate feature to avoid such issue:

https://github.com/apache/karaf/blob/master/assemblies/features/enterprise/src/main/feature/feature.xml#L172

Why don't you use Hibernate Karaf provided feature ?

Anyway, if you absolutely want to use the one provided by Hibernate, you
can blacklist part of the feature.

Regards
JB

On 30/01/2020 13:59, Zhendong Chen wrote:

> Hi JB,
>
> I found the problem.
> The new hibernate-osgi feature, see hibernate-osgi-5.3.14.Final-karaf.xml
> has changed compare with 5.2.x
>
> If I remove these two lines, everything is ok.
> <feature>aries-blueprint</feature>
> <bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>
>
> How can I pragmatically remove these dependency?
> We use this dependency since 4.2.7
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-osgi</artifactId>
> <classifier>karaf</classifier>
>                         <version>5.3.14.Final</version>
> <type>xml</type>
> <scope>runtime</scope>
> </dependency>
>
> Best,
> Zhendong
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

jbonofre
In reply to this post by Zhendong Chen
By the way, the compendium bundle should be removed (or at least
dependency flagged) from hibernate features XML.

Regards
JB

On 30/01/2020 13:59, Zhendong Chen wrote:

> Hi JB,
>
> I found the problem.
> The new hibernate-osgi feature, see hibernate-osgi-5.3.14.Final-karaf.xml
> has changed compare with 5.2.x
>
> If I remove these two lines, everything is ok.
> <feature>aries-blueprint</feature>
> <bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>
>
> How can I pragmatically remove these dependency?
> We use this dependency since 4.2.7
> <dependency>
> <groupId>org.hibernate</groupId>
> <artifactId>hibernate-osgi</artifactId>
> <classifier>karaf</classifier>
>                         <version>5.3.14.Final</version>
> <type>xml</type>
> <scope>runtime</scope>
> </dependency>
>
> Best,
> Zhendong
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

Zhendong Chen
Hi JB,

thanks.
We use hibernate-osgi feature until 4.2.2. But after upgrade to 4.2.7 we got
this exception:
Could not find matching feature for hibernate-orm/0.0.0

I through that karaf doesn't provide this feature anymore.


Best,
Zhendong



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

jbonofre
The name of feature is hibernate. And it has been hibernate since the
beginning of Karaf 4.2.x:

https://github.com/apache/karaf/blob/karaf-4.2.2/assemblies/features/enterprise/src/main/feature/feature.xml#L172

The hibernate-orm feature is the one provided directly by Hibernate.
However, this hibernate-orm was not fully good and that's why we wrapped
in Karaf hibernate feature:

https://github.com/apache/karaf/blob/karaf-4.2.2/assemblies/features/enterprise/src/main/feature/feature.xml#L174

Regards
JB

On 30/01/2020 14:23, Zhendong Chen wrote:

> Hi JB,
>
> thanks.
> We use hibernate-osgi feature until 4.2.2. But after upgrade to 4.2.7 we got
> this exception:
> Could not find matching feature for hibernate-orm/0.0.0
>
> I through that karaf doesn't provide this feature anymore.
>
>
> Best,
> Zhendong
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

Zhendong Chen
Thanks JB, I switch to use hibernate of Karaf. But we are using
gemini-blueprint, but the new hibernate version stil using
<feature>aries-blueprint</feature>, this is our problem.

During this configuration, it started, but do you have another way?
<blacklistedFeatures>
    <feature>aries-blueprint</feature>
</blacklistedFeatures>



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
Reply | Threaded
Open this post in threaded view
|

Re: Karaf 4.2.7 shutdown unexpected

jbonofre
Hi,

Ha ok, understood.

You have three options:

1. you create your own hibernate feature using same definition as
hibernate but changing aries-blueprint to gemini
2. the hibernate feature should use dependency=true on aries-blueprint
to avoid "strong" dep
3. blacklisting blueprint should work.

By the way, gemini is deprecated, I would strongly recommend to use
aries-blueprint (it should be transparent for you).

Regards
JB

On 30/01/2020 19:08, Zhendong Chen wrote:

> Thanks JB, I switch to use hibernate of Karaf. But we are using
> gemini-blueprint, but the new hibernate version stil using
> <feature>aries-blueprint</feature>, this is our problem.
>
> During this configuration, it started, but do you have another way?
> <blacklistedFeatures>
>     <feature>aries-blueprint</feature>
> </blacklistedFeatures>
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com