Problem with Karaf 4.3.0 RC1 and Hibernate 5.4.13

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

Problem with Karaf 4.3.0 RC1 and Hibernate 5.4.13

Jakub Herkel-2
I have tried Karaf 4.3.0 RC1 with the latest hibernate 5.4.13 but I have got this exception :

java.lang.NoClassDefFoundError: org/ops4j/pax/logging/spi/support/FormattingTriple                                                          
at org.ops4j.pax.logging.spi.support.DefaultServiceLog.error(DefaultServiceLog.java:409)
at org.ops4j.pax.logging.internal.TrackingLogger.error(TrackingLogger.java:322)
at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(Slf4jLogger.java:1019)
at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(Activator.java:90)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.callListeners(FeaturesServiceImpl.java:321)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1064)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.ops4j.pax.logging.spi.support.FormattingTriple' because the bundle wiring for org.ops4j.pax.logging.pax-logging-api is no longer valid.

I tried to find out where the problem is and after some investigation I think that real problem is this line from hibernate features.xml :
<bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>

when this line was included it caused restart of many bundles because org.apache.karaf.event was stopped
 Stopping bundles:
2020-04-05T10:39:43,317 | INFO  | features-3-thread-1 | FeaturesServiceImpl              | 11 - org.apache.karaf.features.core - 4.3.0.RC1 |   org.apache.karaf.event/4.3.0.RC1
after this line

I would like to know if there is a way how I can blacklist some bundles from feature because from my point of view hibernate features xml expects OSGI R6 not R7.


My features.xml:
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0"
          name="test43">

  <repository>mvn:org.apache.aries.jpa/jpa-features/2.7.2/xml/features</repository>
<!--  <repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.5/xml/features</repository>-->
  <repository>mvn:org.hibernate/hibernate-osgi/5.4.13.Final/xml/karaf</repository>
<!-- copy from hibernate 5.4.13.Final -->
  <feature name="hibernate-orm2" description="Combines all Hibernate core dependencies and required modules into a single feature">
    <feature prerequisite="true">wrap</feature>
    <feature>transaction-api</feature>
    <feature>aries-blueprint</feature>
    <bundle>mvn:org.jboss.logging/jboss-logging/3.3.2.Final</bundle>
    <bundle>wrap:mvn:antlr/antlr/2.7.7</bundle>
    <bundle>mvn:javax.persistence/javax.persistence-api/2.2</bundle>
    <bundle>mvn:org.javassist/javassist/3.24.0-GA</bundle>
    <bundle>mvn:net.bytebuddy/byte-buddy/1.10.7</bundle>
    <bundle>
      mvn:org.jboss.spec.javax.transaction/jboss-transaction-api_1.2_spec/1.1.1.Final
    </bundle>
    <bundle>mvn:org.jboss/jandex/2.1.1.Final</bundle>
    <bundle>mvn:com.fasterxml/classmate/1.5.1</bundle>
    <bundle>wrap:mvn:org.dom4j/dom4j/2.1.1</bundle>
    <bundle>
      mvn:org.hibernate.common/hibernate-commons-annotations/5.1.0.Final
    </bundle>
    <bundle>mvn:org.hibernate/hibernate-core/5.4.13.Final</bundle>
    <bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
    <bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>
    <bundle>mvn:javax.interceptor/javax.interceptor-api/1.2</bundle>
    <bundle>mvn:org.hibernate/hibernate-osgi/5.4.13.Final</bundle>
  </feature>
  <feature name="hibernate-envers2" description="Feature for easily adding Envers support to hibernate-orm">
    <feature>hibernate-orm2</feature>
    <bundle>mvn:org.hibernate/hibernate-envers/5.4.13.Final</bundle>
  </feature>

  <feature name="test43" description="test43" version="${project.version}">
    <!--    <feature prerequisite="true">wrap</feature>-->
    <!--    <feature>pax-jdbc</feature>
    <feature>pax-jdbc-config</feature>
    <feature>pax-jdbc-pool-dbcp2</feature>-->
    <!--    <bundle>mvn:org.postgresql/postgresql/42.2.11</bundle>-->
    <!--    <feature>transaction</feature>-->
    <feature>transaction-api</feature>
    <feature>transaction</feature>
    <feature version="2.7.2">jpa</feature>
<!--    <feature>hibernate-validator</feature>-->
    <feature>hibernate-envers2</feature>
  </feature>

</features>
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Karaf 4.3.0 RC1 and Hibernate 5.4.13

jbonofre
Hi Jakub,

I guess that it works fine with Karaf 4.2.x right ?

The hibernate feature (the one provided by hibernate) doesn’t seem to have been updated to OSGi R7. In any case, it should not install compendium (as it’s already provided).

Can you please create a Jira ? I will propose a fix at Hibernate.

Regards
JB

Le 5 avr. 2020 à 19:21, Jakub Herkel <[hidden email]> a écrit :

I have tried Karaf 4.3.0 RC1 with the latest hibernate 5.4.13 but I have got this exception :

java.lang.NoClassDefFoundError: org/ops4j/pax/logging/spi/support/FormattingTriple                                                          
at org.ops4j.pax.logging.spi.support.DefaultServiceLog.error(DefaultServiceLog.java:409)
at org.ops4j.pax.logging.internal.TrackingLogger.error(TrackingLogger.java:322)
at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(Slf4jLogger.java:1019)
at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(Activator.java:90)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.callListeners(FeaturesServiceImpl.java:321)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1064)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.ops4j.pax.logging.spi.support.FormattingTriple' because the bundle wiring for org.ops4j.pax.logging.pax-logging-api is no longer valid.

I tried to find out where the problem is and after some investigation I think that real problem is this line from hibernate features.xml :
<bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>

when this line was included it caused restart of many bundles because org.apache.karaf.event was stopped
 Stopping bundles:
2020-04-05T10:39:43,317 | INFO  | features-3-thread-1 | FeaturesServiceImpl              | 11 - org.apache.karaf.features.core - 4.3.0.RC1 |   org.apache.karaf.event/4.3.0.RC1
after this line

I would like to know if there is a way how I can blacklist some bundles from feature because from my point of view hibernate features xml expects OSGI R6 not R7.


My features.xml:
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0"
          name="test43">

  <repository>mvn:org.apache.aries.jpa/jpa-features/2.7.2/xml/features</repository>
<!--  <repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.5/xml/features</repository>-->
  <repository>mvn:org.hibernate/hibernate-osgi/5.4.13.Final/xml/karaf</repository>
<!-- copy from hibernate 5.4.13.Final -->
  <feature name="hibernate-orm2" description="Combines all Hibernate core dependencies and required modules into a single feature">
    <feature prerequisite="true">wrap</feature>
    <feature>transaction-api</feature>
    <feature>aries-blueprint</feature>
    <bundle>mvn:org.jboss.logging/jboss-logging/3.3.2.Final</bundle>
    <bundle>wrap:mvn:antlr/antlr/2.7.7</bundle>
    <bundle>mvn:javax.persistence/javax.persistence-api/2.2</bundle>
    <bundle>mvn:org.javassist/javassist/3.24.0-GA</bundle>
    <bundle>mvn:net.bytebuddy/byte-buddy/1.10.7</bundle>
    <bundle>
      mvn:org.jboss.spec.javax.transaction/jboss-transaction-api_1.2_spec/1.1.1.Final
    </bundle>
    <bundle>mvn:org.jboss/jandex/2.1.1.Final</bundle>
    <bundle>mvn:com.fasterxml/classmate/1.5.1</bundle>
    <bundle>wrap:mvn:org.dom4j/dom4j/2.1.1</bundle>
    <bundle>
      mvn:org.hibernate.common/hibernate-commons-annotations/5.1.0.Final
    </bundle>
    <bundle>mvn:org.hibernate/hibernate-core/5.4.13.Final</bundle>
    <bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
    <bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>
    <bundle>mvn:javax.interceptor/javax.interceptor-api/1.2</bundle>
    <bundle>mvn:org.hibernate/hibernate-osgi/5.4.13.Final</bundle>
  </feature>
  <feature name="hibernate-envers2" description="Feature for easily adding Envers support to hibernate-orm">
    <feature>hibernate-orm2</feature>
    <bundle>mvn:org.hibernate/hibernate-envers/5.4.13.Final</bundle>
  </feature>

  <feature name="test43" description="test43" version="${project.version}">
    <!--    <feature prerequisite="true">wrap</feature>-->
    <!--    <feature>pax-jdbc</feature>
    <feature>pax-jdbc-config</feature>
    <feature>pax-jdbc-pool-dbcp2</feature>-->
    <!--    <bundle>mvn:org.postgresql/postgresql/42.2.11</bundle>-->
    <!--    <feature>transaction</feature>-->
    <feature>transaction-api</feature>
    <feature>transaction</feature>
    <feature version="2.7.2">jpa</feature>
<!--    <feature>hibernate-validator</feature>-->
    <feature>hibernate-envers2</feature>
  </feature>

</features>

Reply | Threaded
Open this post in threaded view
|

Re: Problem with Karaf 4.3.0 RC1 and Hibernate 5.4.13

Jakub Herkel-2
I haven't tried 4.2.x version yet. I would like to migrate one project from servicemix 7.0.1 so I tried the latest version.


best regards

jakub



On Mon, Apr 6, 2020 at 7:22 AM Jean-Baptiste Onofre <[hidden email]> wrote:
Hi Jakub,

I guess that it works fine with Karaf 4.2.x right ?

The hibernate feature (the one provided by hibernate) doesn’t seem to have been updated to OSGi R7. In any case, it should not install compendium (as it’s already provided).

Can you please create a Jira ? I will propose a fix at Hibernate.

Regards
JB

Le 5 avr. 2020 à 19:21, Jakub Herkel <[hidden email]> a écrit :

I have tried Karaf 4.3.0 RC1 with the latest hibernate 5.4.13 but I have got this exception :

java.lang.NoClassDefFoundError: org/ops4j/pax/logging/spi/support/FormattingTriple                                                          
at org.ops4j.pax.logging.spi.support.DefaultServiceLog.error(DefaultServiceLog.java:409)
at org.ops4j.pax.logging.internal.TrackingLogger.error(TrackingLogger.java:322)
at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(Slf4jLogger.java:1019)
at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(Activator.java:90)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.callListeners(FeaturesServiceImpl.java:321)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1064)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.ops4j.pax.logging.spi.support.FormattingTriple' because the bundle wiring for org.ops4j.pax.logging.pax-logging-api is no longer valid.

I tried to find out where the problem is and after some investigation I think that real problem is this line from hibernate features.xml :
<bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>

when this line was included it caused restart of many bundles because org.apache.karaf.event was stopped
 Stopping bundles:
2020-04-05T10:39:43,317 | INFO  | features-3-thread-1 | FeaturesServiceImpl              | 11 - org.apache.karaf.features.core - 4.3.0.RC1 |   org.apache.karaf.event/4.3.0.RC1
after this line

I would like to know if there is a way how I can blacklist some bundles from feature because from my point of view hibernate features xml expects OSGI R6 not R7.


My features.xml:
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0"
          name="test43">

  <repository>mvn:org.apache.aries.jpa/jpa-features/2.7.2/xml/features</repository>
<!--  <repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.5/xml/features</repository>-->
  <repository>mvn:org.hibernate/hibernate-osgi/5.4.13.Final/xml/karaf</repository>
<!-- copy from hibernate 5.4.13.Final -->
  <feature name="hibernate-orm2" description="Combines all Hibernate core dependencies and required modules into a single feature">
    <feature prerequisite="true">wrap</feature>
    <feature>transaction-api</feature>
    <feature>aries-blueprint</feature>
    <bundle>mvn:org.jboss.logging/jboss-logging/3.3.2.Final</bundle>
    <bundle>wrap:mvn:antlr/antlr/2.7.7</bundle>
    <bundle>mvn:javax.persistence/javax.persistence-api/2.2</bundle>
    <bundle>mvn:org.javassist/javassist/3.24.0-GA</bundle>
    <bundle>mvn:net.bytebuddy/byte-buddy/1.10.7</bundle>
    <bundle>
      mvn:org.jboss.spec.javax.transaction/jboss-transaction-api_1.2_spec/1.1.1.Final
    </bundle>
    <bundle>mvn:org.jboss/jandex/2.1.1.Final</bundle>
    <bundle>mvn:com.fasterxml/classmate/1.5.1</bundle>
    <bundle>wrap:mvn:org.dom4j/dom4j/2.1.1</bundle>
    <bundle>
      mvn:org.hibernate.common/hibernate-commons-annotations/5.1.0.Final
    </bundle>
    <bundle>mvn:org.hibernate/hibernate-core/5.4.13.Final</bundle>
    <bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
    <bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>
    <bundle>mvn:javax.interceptor/javax.interceptor-api/1.2</bundle>
    <bundle>mvn:org.hibernate/hibernate-osgi/5.4.13.Final</bundle>
  </feature>
  <feature name="hibernate-envers2" description="Feature for easily adding Envers support to hibernate-orm">
    <feature>hibernate-orm2</feature>
    <bundle>mvn:org.hibernate/hibernate-envers/5.4.13.Final</bundle>
  </feature>

  <feature name="test43" description="test43" version="${project.version}">
    <!--    <feature prerequisite="true">wrap</feature>-->
    <!--    <feature>pax-jdbc</feature>
    <feature>pax-jdbc-config</feature>
    <feature>pax-jdbc-pool-dbcp2</feature>-->
    <!--    <bundle>mvn:org.postgresql/postgresql/42.2.11</bundle>-->
    <!--    <feature>transaction</feature>-->
    <feature>transaction-api</feature>
    <feature>transaction</feature>
    <feature version="2.7.2">jpa</feature>
<!--    <feature>hibernate-validator</feature>-->
    <feature>hibernate-envers2</feature>
  </feature>

</features>

Reply | Threaded
Open this post in threaded view
|

Re: Problem with Karaf 4.3.0 RC1 and Hibernate 5.4.13

jbonofre
Yes, I saw the Jira thanks.

You are migrating from SMX 7.0.1 to "pure" Karaf ?

Regards
JB

Le 6 avr. 2020 à 09:45, Jakub Herkel <[hidden email]> a écrit :

I haven't tried 4.2.x version yet. I would like to migrate one project from servicemix 7.0.1 so I tried the latest version.


best regards

jakub



On Mon, Apr 6, 2020 at 7:22 AM Jean-Baptiste Onofre <[hidden email]> wrote:
Hi Jakub,

I guess that it works fine with Karaf 4.2.x right ?

The hibernate feature (the one provided by hibernate) doesn’t seem to have been updated to OSGi R7. In any case, it should not install compendium (as it’s already provided).

Can you please create a Jira ? I will propose a fix at Hibernate.

Regards
JB

Le 5 avr. 2020 à 19:21, Jakub Herkel <[hidden email]> a écrit :

I have tried Karaf 4.3.0 RC1 with the latest hibernate 5.4.13 but I have got this exception :

java.lang.NoClassDefFoundError: org/ops4j/pax/logging/spi/support/FormattingTriple                                                          
at org.ops4j.pax.logging.spi.support.DefaultServiceLog.error(DefaultServiceLog.java:409)
at org.ops4j.pax.logging.internal.TrackingLogger.error(TrackingLogger.java:322)
at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(Slf4jLogger.java:1019)
at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(Activator.java:90)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.callListeners(FeaturesServiceImpl.java:321)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1064)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.ops4j.pax.logging.spi.support.FormattingTriple' because the bundle wiring for org.ops4j.pax.logging.pax-logging-api is no longer valid.

I tried to find out where the problem is and after some investigation I think that real problem is this line from hibernate features.xml :
<bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>

when this line was included it caused restart of many bundles because org.apache.karaf.event was stopped
 Stopping bundles:
2020-04-05T10:39:43,317 | INFO  | features-3-thread-1 | FeaturesServiceImpl              | 11 - org.apache.karaf.features.core - 4.3.0.RC1 |   org.apache.karaf.event/4.3.0.RC1
after this line

I would like to know if there is a way how I can blacklist some bundles from feature because from my point of view hibernate features xml expects OSGI R6 not R7.


My features.xml:
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0"
          name="test43">

  <repository>mvn:org.apache.aries.jpa/jpa-features/2.7.2/xml/features</repository>
<!--  <repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.5/xml/features</repository>-->
  <repository>mvn:org.hibernate/hibernate-osgi/5.4.13.Final/xml/karaf</repository>
<!-- copy from hibernate 5.4.13.Final -->
  <feature name="hibernate-orm2" description="Combines all Hibernate core dependencies and required modules into a single feature">
    <feature prerequisite="true">wrap</feature>
    <feature>transaction-api</feature>
    <feature>aries-blueprint</feature>
    <bundle>mvn:org.jboss.logging/jboss-logging/3.3.2.Final</bundle>
    <bundle>wrap:mvn:antlr/antlr/2.7.7</bundle>
    <bundle>mvn:javax.persistence/javax.persistence-api/2.2</bundle>
    <bundle>mvn:org.javassist/javassist/3.24.0-GA</bundle>
    <bundle>mvn:net.bytebuddy/byte-buddy/1.10.7</bundle>
    <bundle>
      mvn:org.jboss.spec.javax.transaction/jboss-transaction-api_1.2_spec/1.1.1.Final
    </bundle>
    <bundle>mvn:org.jboss/jandex/2.1.1.Final</bundle>
    <bundle>mvn:com.fasterxml/classmate/1.5.1</bundle>
    <bundle>wrap:mvn:org.dom4j/dom4j/2.1.1</bundle>
    <bundle>
      mvn:org.hibernate.common/hibernate-commons-annotations/5.1.0.Final
    </bundle>
    <bundle>mvn:org.hibernate/hibernate-core/5.4.13.Final</bundle>
    <bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
    <bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>
    <bundle>mvn:javax.interceptor/javax.interceptor-api/1.2</bundle>
    <bundle>mvn:org.hibernate/hibernate-osgi/5.4.13.Final</bundle>
  </feature>
  <feature name="hibernate-envers2" description="Feature for easily adding Envers support to hibernate-orm">
    <feature>hibernate-orm2</feature>
    <bundle>mvn:org.hibernate/hibernate-envers/5.4.13.Final</bundle>
  </feature>

  <feature name="test43" description="test43" version="${project.version}">
    <!--    <feature prerequisite="true">wrap</feature>-->
    <!--    <feature>pax-jdbc</feature>
    <feature>pax-jdbc-config</feature>
    <feature>pax-jdbc-pool-dbcp2</feature>-->
    <!--    <bundle>mvn:org.postgresql/postgresql/42.2.11</bundle>-->
    <!--    <feature>transaction</feature>-->
    <feature>transaction-api</feature>
    <feature>transaction</feature>
    <feature version="2.7.2">jpa</feature>
<!--    <feature>hibernate-validator</feature>-->
    <feature>hibernate-envers2</feature>
  </feature>

</features>


Reply | Threaded
Open this post in threaded view
|

Re: Problem with Karaf 4.3.0 RC1 and Hibernate 5.4.13

Jakub Herkel-2
Probably we will use custom distribution. What we need is packaging karaf with our application and also to add some additional  customizations (additional JVM options, environment variables).
But for development we will use "pure" karaf because this custom distribution we need only for deployment and tests.


On Mon, Apr 6, 2020 at 9:53 AM Jean-Baptiste Onofre <[hidden email]> wrote:
Yes, I saw the Jira thanks.

You are migrating from SMX 7.0.1 to "pure" Karaf ?

Regards
JB

Le 6 avr. 2020 à 09:45, Jakub Herkel <[hidden email]> a écrit :

I haven't tried 4.2.x version yet. I would like to migrate one project from servicemix 7.0.1 so I tried the latest version.


best regards

jakub



On Mon, Apr 6, 2020 at 7:22 AM Jean-Baptiste Onofre <[hidden email]> wrote:
Hi Jakub,

I guess that it works fine with Karaf 4.2.x right ?

The hibernate feature (the one provided by hibernate) doesn’t seem to have been updated to OSGi R7. In any case, it should not install compendium (as it’s already provided).

Can you please create a Jira ? I will propose a fix at Hibernate.

Regards
JB

Le 5 avr. 2020 à 19:21, Jakub Herkel <[hidden email]> a écrit :

I have tried Karaf 4.3.0 RC1 with the latest hibernate 5.4.13 but I have got this exception :

java.lang.NoClassDefFoundError: org/ops4j/pax/logging/spi/support/FormattingTriple                                                          
at org.ops4j.pax.logging.spi.support.DefaultServiceLog.error(DefaultServiceLog.java:409)
at org.ops4j.pax.logging.internal.TrackingLogger.error(TrackingLogger.java:322)
at org.ops4j.pax.logging.slf4j.Slf4jLogger.error(Slf4jLogger.java:1019)
at org.apache.karaf.deployer.features.osgi.Activator$DeploymentFinishedListener.deploymentEvent(Activator.java:90)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.callListeners(FeaturesServiceImpl.java:321)
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1064)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062)
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.ops4j.pax.logging.spi.support.FormattingTriple' because the bundle wiring for org.ops4j.pax.logging.pax-logging-api is no longer valid.

I tried to find out where the problem is and after some investigation I think that real problem is this line from hibernate features.xml :
<bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>

when this line was included it caused restart of many bundles because org.apache.karaf.event was stopped
 Stopping bundles:
2020-04-05T10:39:43,317 | INFO  | features-3-thread-1 | FeaturesServiceImpl              | 11 - org.apache.karaf.features.core - 4.3.0.RC1 |   org.apache.karaf.event/4.3.0.RC1
after this line

I would like to know if there is a way how I can blacklist some bundles from feature because from my point of view hibernate features xml expects OSGI R6 not R7.


My features.xml:
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.3.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.3.0"
          name="test43">

  <repository>mvn:org.apache.aries.jpa/jpa-features/2.7.2/xml/features</repository>
<!--  <repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/1.4.5/xml/features</repository>-->
  <repository>mvn:org.hibernate/hibernate-osgi/5.4.13.Final/xml/karaf</repository>
<!-- copy from hibernate 5.4.13.Final -->
  <feature name="hibernate-orm2" description="Combines all Hibernate core dependencies and required modules into a single feature">
    <feature prerequisite="true">wrap</feature>
    <feature>transaction-api</feature>
    <feature>aries-blueprint</feature>
    <bundle>mvn:org.jboss.logging/jboss-logging/3.3.2.Final</bundle>
    <bundle>wrap:mvn:antlr/antlr/2.7.7</bundle>
    <bundle>mvn:javax.persistence/javax.persistence-api/2.2</bundle>
    <bundle>mvn:org.javassist/javassist/3.24.0-GA</bundle>
    <bundle>mvn:net.bytebuddy/byte-buddy/1.10.7</bundle>
    <bundle>
      mvn:org.jboss.spec.javax.transaction/jboss-transaction-api_1.2_spec/1.1.1.Final
    </bundle>
    <bundle>mvn:org.jboss/jandex/2.1.1.Final</bundle>
    <bundle>mvn:com.fasterxml/classmate/1.5.1</bundle>
    <bundle>wrap:mvn:org.dom4j/dom4j/2.1.1</bundle>
    <bundle>
      mvn:org.hibernate.common/hibernate-commons-annotations/5.1.0.Final
    </bundle>
    <bundle>mvn:org.hibernate/hibernate-core/5.4.13.Final</bundle>
    <bundle>mvn:org.osgi/org.osgi.core/6.0.0</bundle>
    <bundle>mvn:org.osgi/org.osgi.compendium/5.0.0</bundle>
    <bundle>mvn:javax.interceptor/javax.interceptor-api/1.2</bundle>
    <bundle>mvn:org.hibernate/hibernate-osgi/5.4.13.Final</bundle>
  </feature>
  <feature name="hibernate-envers2" description="Feature for easily adding Envers support to hibernate-orm">
    <feature>hibernate-orm2</feature>
    <bundle>mvn:org.hibernate/hibernate-envers/5.4.13.Final</bundle>
  </feature>

  <feature name="test43" description="test43" version="${project.version}">
    <!--    <feature prerequisite="true">wrap</feature>-->
    <!--    <feature>pax-jdbc</feature>
    <feature>pax-jdbc-config</feature>
    <feature>pax-jdbc-pool-dbcp2</feature>-->
    <!--    <bundle>mvn:org.postgresql/postgresql/42.2.11</bundle>-->
    <!--    <feature>transaction</feature>-->
    <feature>transaction-api</feature>
    <feature>transaction</feature>
    <feature version="2.7.2">jpa</feature>
<!--    <feature>hibernate-validator</feature>-->
    <feature>hibernate-envers2</feature>
  </feature>

</features>