java.lang.reflect.InvocationTargetException

Hibernate JIRA | Joseph Ottinger | 2 months ago
  1. 0

    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.

    Hibernate JIRA | 2 months ago | Joseph Ottinger
    java.lang.reflect.InvocationTargetException
  2. 0

    Maven test fails if parent test class is in depenedncy

    Stack Overflow | 2 years ago | Aniruddh Joshi
    java.lang.reflect.InvocationTargetException
  3. 0

    Truncating takes too much time hsqldb

    Stack Overflow | 2 years ago
    java.lang.reflect.InvocationTargetException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Re: [powermock] SLF4J issue with powermock

    Google Groups | 4 years ago | Johan Haleby
    java.lang.reflect.InvocationTargetException
  6. 0

    "No free nodes found in:[DynamicGraph" and group-by-instances="true"

    Google Groups | 5 years ago | Ryszard
    java.lang.reflect.InvocationTargetException

  1. bmacedo 8 times, last 2 weeks ago
  2. aldrinleal 1 times, last 1 month ago
  3. ajinkya_w 96 times, last 2 months ago
  4. davidvanlaatum 4 times, last 2 months ago
  5. Handemelindo 2 times, last 3 months ago
17 more registered users
78 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.reflect.InvocationTargetException

    No message provided

    at sun.reflect.NativeMethodAccessorImpl.invoke0()
  2. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:498)
    4 frames
  3. SureFire
    ForkedBooter.main
    1. org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    2. org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    3. org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    4. org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    5. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
    5 frames