Uploaded image for project: 'Aries'
  1. Aries
  2. ARIES-1622

NPE at org.apache.aries.jpa.container.impl.ManagedEMF#createAndPublishEMF

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • jpa-2.4.0
    • None
    • JPA
    • None
    • Apache Felix 5.6, Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode), Windows 7, EclipseLink 2.6.3

    Description

      When stopping OSGi Framework NullPointerException is thrown in rare cases (approx. 1/20) at line

      reg = uctx.registerService(EntityManagerFactory.class, emf, props);
      

      Stacktrace:

      *ERROR* [org.osgi.service.cm.ManagedService, id=49, unregistered]: Unexpected problem updating configuration org.apache.aries.jpa.VehicleModel
      java.lang.NullPointerException
      	at org.apache.aries.jpa.container.impl.ManagedEMF.createAndPublishEMF(ManagedEMF.java:132)
      	at org.apache.aries.jpa.container.impl.ManagedEMF.updated(ManagedEMF.java:125)
      	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)
      	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)
      	at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)
      	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1444)
      	at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1400)
      	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:143)
      	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:110)
      	at java.lang.Thread.run(Thread.java:745)
      

      At this point the bundle in the INSTALLED(2) state despite of previous check for that condition and uctx is null. Also I have seen this problem when updating the bundle with EMF using .

      I think there should be a check for uctx == null.

      The exception is followed by the following exception when in process of updating bundle:

      Exception [EclipseLink-7156] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.ValidationException
      Exception Description: Unable to find the class named [com.convista.hfi.example.jpa_osgi.car_model.Vehicle]. Ensure the class name/path is correct and available to the classloader.
      Internal Exception: java.lang.ClassNotFoundException: com.convista.hfi.example.jpa_osgi.car_model.Vehicle not found by org.eclipse.persistence.jpa [40]
      	at org.eclipse.persistence.exceptions.ValidationException.unableToLoadClass(ValidationException.java:2007)
      	at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata.getClass(EntityListenerMetadata.java:227)
      	at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityClassListenerMetadata.process(EntityClassListenerMetadata.java:81)
      	at org.eclipse.persistence.internal.jpa.metadata.accessors.classes.EntityAccessor.processListeners(EntityAccessor.java:1226)
      	at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.addEntityListeners(MetadataProcessor.java:140)
      	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:637)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:205)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:305)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
      	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)
      	at Proxyaf83b3fa_9eaf_4470_a848_4832897607c5.createEntityManager(Unknown Source)
      	at com.convista.hfi.dpr.fips.support.JpaRunner.call(JpaRunner.java:33)
      	at com.convista.hfi.example.jpa_osgi.car_model.CarEntityFactory.create(CarEntityFactory.java:23)
      	at com.convista.hfi.example.jpa_osgi.car_model.CarEntityFactory.create(CarEntityFactory.java:23)
      	at Proxyce6c53da_ebe4_47ad_bfb2_5188dff8be43.create(Unknown Source)
      	at com.confista.hfi.dpr.runner.OsgiRunnerIT.test(OsgiRunnerIT.java:80)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
      Caused by: java.lang.ClassNotFoundException: com.convista.hfi.example.jpa_osgi.car_model.Vehicle not found by org.eclipse.persistence.jpa [40]
      	at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)
      	at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
      	at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1926)
      	at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:978)
      	at org.apache.aries.jpa.eclipselink.adapter.UnionClassLoader.findClass(UnionClassLoader.java:74)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:348)
      	at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:142)
      	at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListenerMetadata.getClass(EntityListenerMetadata.java:224)
      	... 41 more
      
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            const Constantine Plotnikov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: