Uploaded image for project: 'Unitils'
  1. UNI-229

Hibernate-entitymanager is incorrectly marked as optional

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: jpa
    • Labels:
      None
    • Environment:
      Maven 3.0.3

      Description

      Hello,

      Even with the option "jpa.persistenceProvider" set to "openjpa", the hibernate-entitymanager dependency is required and not optional as indicated in unitils-orm pom.

      If not explicitly added the following error is returned:
      org.unitils.core.UnitilsException: An exception occured during the loading of core module hibernate with module class name org.unitils.orm.hibernate.HibernateModule
      at org.unitils.core.ModulesLoader.createAndInitializeModules(ModulesLoader.java:154)
      at org.unitils.core.ModulesLoader.loadModules(ModulesLoader.java:121)
      at org.unitils.core.Unitils.createModulesRepository(Unitils.java:222)
      at org.unitils.core.Unitils.init(Unitils.java:118)
      at org.unitils.core.Unitils.init(Unitils.java:105)
      at org.unitils.core.Unitils.initSingletonInstance(Unitils.java:74)
      at org.unitils.core.Unitils.getInstance(Unitils.java:52)
      at org.unitils.UnitilsJUnit4TestClassRunner.getUnitils(UnitilsJUnit4TestClassRunner.java:214)
      at org.unitils.UnitilsJUnit4TestClassRunner.getTestListener(UnitilsJUnit4TestClassRunner.java:204)
      at org.unitils.UnitilsJUnit4TestClassRunner.run(UnitilsJUnit4TestClassRunner.java:67)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
      at $Proxy0.invoke(Unknown Source)
      at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
      at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
      Caused by: org.unitils.core.UnitilsException: Could not load class with name org.hibernate.cfg.AnnotationConfiguration
      at org.unitils.util.ReflectionUtils.getClassWithName(ReflectionUtils.java:482)
      at org.unitils.orm.hibernate.HibernateModule.init(HibernateModule.java:86)
      at org.unitils.core.ModulesLoader.createAndInitializeModules(ModulesLoader.java:151)
      ... 21 more
      Caused by: java.lang.ClassNotFoundException: org.hibernate.cfg.AnnotationConfiguration
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:169)
      at org.unitils.util.ReflectionUtils.getClassWithName(ReflectionUtils.java:479)
      ... 23 more

      The solution is to make the hibernate-entitymanager really optional (preferred) or make it a required dependency.

      Kind regards,
      Bryan.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              xbbrck Bryan Brouckaert
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: