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

JPA Hibernate application does not perform operation after undeploy/deploy of bundles, only re-installing feature 'hibernate' make operations possible.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • jboss-fuse-6.2.1
    • jboss-fuse-6.1, jboss-fuse-6.2
    • Hibernate
    • None
    • % %
    • Hide
      • There are three bundles:
        1. database-services(exposes datasource).
        2. fuse-pocs-blueprint-hibernate42-bundle(actual implementation having entities and methods)
        3. service-consumer(act as a client consuming services exposed by 2)
        
      • If we install these bundles in following manner:
        #features:
        features:install transaction
        features:install jndi
        features:install jpa
        # in earlier versions features:install jpa-hibernate
        features:install hibernate
        #bundles:
        install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.4_3
        install -s wrap:mvn:oracle/ojdbc5/11.2.0.2.0
        install -s mvn:org.redhat.support/database-pool/1.0.4-SNAPSHOT
        install -s mvn:fuse-pocs/fuse-pocs-blueprint-hibernate42-bundle/666.0-SNAPSHOT
        install -s mvn:org.redhat.support/service-consumer/1.0-SNAPSHOT
        
      • Everythings works normally, in table one can find the data inserted.
      • If we uninstall and than install any of two bundles 'database-services', 'fuse-pocs-blueprint-hibernate42-bundle', the operations performed by 'service-consumer' like insertion does not happen. Even reinstalling of these bundles do not help.
      • If we remove feature 'hibernate' and again install it with other three custom bundles, than services are again up and operations are performed.
      Show
      There are three bundles: 1. database-services(exposes datasource). 2. fuse-pocs-blueprint-hibernate42-bundle(actual implementation having entities and methods) 3. service-consumer(act as a client consuming services exposed by 2) If we install these bundles in following manner: #features: features:install transaction features:install jndi features:install jpa # in earlier versions features:install jpa-hibernate features:install hibernate #bundles: install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.4_3 install -s wrap:mvn:oracle/ojdbc5/11.2.0.2.0 install -s mvn:org.redhat.support/database-pool/1.0.4-SNAPSHOT install -s mvn:fuse-pocs/fuse-pocs-blueprint-hibernate42-bundle/666.0-SNAPSHOT install -s mvn:org.redhat.support/service-consumer/1.0-SNAPSHOT Everythings works normally, in table one can find the data inserted. If we uninstall and than install any of two bundles 'database-services', 'fuse-pocs-blueprint-hibernate42-bundle', the operations performed by 'service-consumer' like insertion does not happen. Even reinstalling of these bundles do not help. If we remove feature 'hibernate' and again install it with other three custom bundles, than services are again up and operations are performed.

    Description

      • Attached is the example. I have tested this implementaion for two different applications and found that reinstalling feature 'hibernate' is only possible workaround.
      • Most of the time this message is received while installing service-consumer bundle:
        11:37:16,502 | INFO  | rint Extender: 2 | BlueprintContainerImpl           | 21 - org.apache.aries.blueprint.core - 1.4.2 | Bundle service-consumer is waiting for dependencies [(objectClass=fuse.pocs.blueprint.openjpa.PersonService)]
        
      • Sometime even below message is encountered. There is another custom application where in place of service-consumer, there is a different cxf consumer which always gives following exception.
        Caused by: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of ch.suisa.test.fuse.entity.Person.id
        	at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:187)
        	at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:344)
        	at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:4550)
        	at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:4271)
        	at org.hibernate.engine.internal.ForeignKeys.isTransient(ForeignKeys.java:209)
        	at org.hibernate.event.internal.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:497)
        	at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:118)
        	at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:78)
        	at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:772)
        	at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:746)
        	at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:750)
        	at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:875)
        	... 57 more
        Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_55]
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_55]
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_55]
        	at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_55]
        	at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:164)
        	... 68 more
        
        
      • Both of the problem resolves after reinstalling the hibernate feature.

      Attachments

        1. dbcp-xa-fuse.zip
          20 kB
        2. step-1.png
          step-1.png
          55 kB
        3. step-2.png
          step-2.png
          30 kB

        Issue Links

          Activity

            People

              ggrzybek Grzegorz Grzybek
              rhn-support-cpandey Chandra Shekhar Pandey (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: