| With configuration: <?xml version="1.0"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- Database connection settings --> <property name="hibernate.ogm.datastore.provider"> org.hibernate.ogm.datastore.infinispan.impl.InfinispanDatastoreProvider </property> <!-- defines which JTA Transaction we plan to use --> <!--property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" --> <property name="hibernate.search.default.indexBase">./lucene-ispn"</property> <mapping class="chapter12.Person"/> </session-factory> </hibernate-configuration> getting a sessionfactory fails with the following stack trace: org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null java.lang.reflect.InvocationTargetException 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:498) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Caused by: org.testng.TestNGException: Cannot instantiate class chapter12.hibernate.InfinispanTest at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:40) at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:377) at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:290) at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:125) at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:190) at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:130) at org.testng.TestRunner.initMethods(TestRunner.java:424) at org.testng.TestRunner.init(TestRunner.java:247) at org.testng.TestRunner.init(TestRunner.java:217) at org.testng.TestRunner.<init>(TestRunner.java:161) at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:556) at org.testng.SuiteRunner.init(SuiteRunner.java:168) at org.testng.SuiteRunner.<init>(SuiteRunner.java:117) at org.testng.TestNG.createSuiteRunner(TestNG.java:1319) at org.testng.TestNG.createSuiteRunners(TestNG.java:1306) at org.testng.TestNG.runSuitesLocally(TestNG.java:1160) at org.testng.TestNG.run(TestNG.java:1064) at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:77) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:159) at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:99) at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:106) ... 9 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29) ... 29 more Caused by: java.lang.NoClassDefFoundError: org/hibernate/resource/transaction/TransactionCoordinatorBuilder at org.hibernate.ogm.boot.impl.OgmServiceRegistryInitializer.contribute(OgmServiceRegistryInitializer.java:71) at org.hibernate.boot.registry.StandardServiceRegistryBuilder.applyServiceContributors(StandardServiceRegistryBuilder.java:305) at org.hibernate.boot.registry.StandardServiceRegistryBuilder.build(StandardServiceRegistryBuilder.java:273) at chapter12.hibernate.BaseHibernateOGMTest.<init>(BaseHibernateOGMTest.java:43) at chapter12.hibernate.InfinispanTest.<init>(InfinispanTest.java:10) ... 34 more Caused by: java.lang.ClassNotFoundException: org.hibernate.resource.transaction.TransactionCoordinatorBuilder at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 39 more I've also included the JPA implementation of the OGM configuration and it has no problem. There is a org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder class, which makes me think there's an incorrect bit of data in the Hibernate SessionFactory configuration somewhere. |