Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-6662

Problem with Karaf 4.3.0 RC1 and Hibernate 5.4.13.Final

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 4.3.0
    • None
    • karaf

    Description

      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>
      

       

       

      Attachments

        Activity

          People

            jbonofre Jean-Baptiste Onofré
            jherkel Jakub Herkel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: