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

unable to reference "javax.persistence.EntityManagerFactory" from another bundle.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • jboss-fuse-6.3
    • Hibernate
    • None
    • % %
    • Hide

      Restart the bundle

      Show
      Restart the bundle
    • Hide

      Refer Step_to_reproduce.txt in the attachment

      Show
      Refer Step_to_reproduce.txt in the attachment

      An issue with reference "javax.persistence.EntityManagerFactory" from another bundle.

      I have attached the sample reproducer, Only way to make this work is by restarting the bundle manually.

      If I remove availability="optional" like below

      <reference id="entityManagerFactory" interface="javax.persistence.EntityManagerFactory"
      		filter="(osgi.unit.name=VehicleJPA)"  />
      

      The exception is thrown while deploying the profile.

      2017-11-20 21:52:13,102 | ERROR | 4.0.1-1-thread-1 | DeploymentAgent                  | 174 - io.fabric8.fabric-agent - 1.2.0.redhat-630283 | Unable to update agent
      org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=testHibernate; type=karaf.feature; filter:="(&(osgi.identity=testHibernate)(type=karaf.feature))" [caused by: Unable to resolve testHibernate/1.0.0: missing requirement [testHibernate/1.0.0] osgi.identity; osgi.identity=com.test.Hibernate-Client; type=osgi.bundle; version="[0.0.1,0.0.1]"; resolution:=mandatory [caused by: Unable to resolve com.test.Hibernate-Client/0.0.1: missing requirement [com.test.Hibernate-Client/0.0.1] osgi.service; effective:=active; filter:="(&(objectClass=javax.persistence.EntityManagerFactory)(osgi.unit.name=VehicleJPA))"]]
      	at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:236)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:159)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at io.fabric8.agent.region.SubsystemResolver.resolve(SubsystemResolver.java:190)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at io.fabric8.agent.service.Deployer.deploy(Deployer.java:276)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at io.fabric8.agent.service.Agent.provision(Agent.java:366)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at io.fabric8.agent.service.Agent.provision(Agent.java:199)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at io.fabric8.agent.DeploymentAgent.doUpdate(DeploymentAgent.java:736)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at io.fabric8.agent.DeploymentAgent$4.run(DeploymentAgent.java:287)[174:io.fabric8.fabric-agent:1.2.0.redhat-630283]
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_45]
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_45]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_45]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_45]
      	at java.lang.Thread.run(Thread.java:745)[:1.8.0_45]
      
      

            ggrzybek Grzegorz Grzybek
            rhn-support-shsingh Shailendra Singh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: