Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-5044

Hibernate JPA bundle waits for dependency and fails to create --

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • None
    • Hibernate
    • None
    • % %

      I am trying to deploy a sample bundle to Fuse container. This application uses below versions of hibernate dependency:

      hibernate-core (4.2.19.Final-redhat-1)
      hibernate-osgi (4.2.19.Final-redhat-1)
      hibernate-entitymanager (4.2.19.Final-redhat-1)

      While installing the bundle, it goes to GracePeriod state for few minutes with below log:

      18:20:06,103 | WARN | xFrameworkWiring | container | 282 - org.apache.aries.jpa.container - 1.0.2 | There are no suitable providers for the provider class name org.hibernate.jpa.HibernatePersistenceProvider and version range null to support the bundle wb-svc-reports/1.0.0.SNAPSHOT.
      18:20:06,127 | ERROR | rint Extender: 3 | aries | 351 - org.apache.aries.jpa.blueprint.aries - 1.0.4 | No org.apache.aries.jpa.container.sync.Synchronization service registered.
      18:20:06,127 | ERROR | rint Extender: 3 | aries | 351 - org.apache.aries.jpa.blueprint.aries - 1.0.4 | No org.apache.aries.jpa.container.sync.Synchronization service registered.
      18:20:06,129 | INFO | rint Extender: 3 | BlueprintContainerImpl | 21 - org.apache.aries.blueprint.core - 1.4.2 | Bundle wb-svc-reports is waiting for dependencies [(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=VIEW_REPORTS))(objectClass=javax.persistence.EntityManagerFactory)), (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=VIEW_REPORTS))(objectClass=javax.persistence.EntityManagerFactory))]

      After few minutes the bundle fails to start with below error:

      18:25:06,161 | ERROR | rint Extender: 2 | BlueprintContainerImpl | 21 - org.apache.aries.blueprint.core - 1.4.2 | Unable to start blueprint container for bundle wb-svc-reports due to unresolved dependencies [(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=VIEW_REPORTS))(objectClass=javax.persistence.EntityManagerFactory)), (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=VIEW_REPORTS))(objectClass=javax.persistence.EntityManagerFactory))]
      java.util.concurrent.TimeoutException
      at org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336)[21:org.apache.aries.blueprint.core:1.4.2]
      at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[21:org.apache.aries.blueprint.core:1.4.2]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_25]
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_25]
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_25]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_25]
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_25]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_25]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_25]
      at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]

      Below is the persistence.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
      xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      version="2.0">
      <persistence-unit name="VIEW_REPORTS" transaction-type="JTA">
      <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
      <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/entDS)</jta-data-source>
      <exclude-unlisted-classes>true</exclude-unlisted-classes>
      <properties>
      <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
      <property name="hibernate.hbm2ddl.auto" value="create-drop" />
      </properties>
      </persistence-unit>
      </persistence>

      Snippet from pom.xml:

      <plugin>
      <groupId>org.apache.felix</groupId>
      <artifactId>maven-bundle-plugin</artifactId>
      <extensions>true</extensions>
      <configuration>
      <instructions>
      <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
      <Meta-Persistence>/META-INF/persistence.xml</Meta-Persistence>
      <Import-Package>
      javax.ws.rs.core,
      javax.ws.rs.client,
      org.osgi.service.*,
      com.fasterxml.jackson.databind,
      com.fasterxml.jackson.jaxrs.json,
      org.hibernate.proxy,
      javassist.util.proxy,
      javax.persistence,
      org.slf4j,
      org.apache.commons.lang,
      *;resolution:=optional,
      </Import-Package>
      <Export-Package>
      – My model Classes go here –
      </Export-Package>
      <DynamicImport-Package>*</DynamicImport-Package>
      </instructions>
      </configuration>
      </plugin>

      Please check if it's a known issue and any solution available for this.

              acosenti Andrea Cosentino
              shesadev Shesadev Samal (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: