javax.persistence.PersistenceException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I have a property of generic type with an array parameter like this one: public static class J<T> {} private J<Object[]> e; @Transient public J<Object[]> getE() { return e; } public void setE(J<Object[]> e) { this.e = e; } When starting the entity manager, I get the following exception: javax.persistence.PersistenceException: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:258) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83) at org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.createEntityManagerFactory(AbstractEntityManagerTest.java:85) at org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.setUp(AbstractEntityManagerTest.java:44) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164) at org.hibernate.annotations.common.reflection.java.JavaXProperty.create(JavaXProperty.java:20) at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXProperty(JavaReflectionManager.java:117) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethodProperties(JavaXClass.java:91) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:106) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:98) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:984) at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:833) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:645) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:186) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:246) ... 17 more The following property makes no problem: private J<Object> f; @Transient public J<Object> getF() { return f; } public void setF(J<Object> f) { this.f = f; } So I believe it's the arrayd type which is problematic. From the stack trace, I believe the problem is with hibernate-commons-annotations. I also attach the class that reproduces the problem.
    via by Aleksei Valikov,
  • I have a property of generic type with an array parameter like this one: public static class J<T> {} private J<Object[]> e; @Transient public J<Object[]> getE() { return e; } public void setE(J<Object[]> e) { this.e = e; } When starting the entity manager, I get the following exception: javax.persistence.PersistenceException: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:258) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83) at org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.createEntityManagerFactory(AbstractEntityManagerTest.java:85) at org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.setUp(AbstractEntityManagerTest.java:44) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164) at org.hibernate.annotations.common.reflection.java.JavaXProperty.create(JavaXProperty.java:20) at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXProperty(JavaReflectionManager.java:117) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethodProperties(JavaXClass.java:91) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:106) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:98) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:984) at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:833) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:645) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:186) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:246) ... 17 more The following property makes no problem: private J<Object> f; @Transient public J<Object> getF() { return f; } public void setF(J<Object> f) { this.f = f; } So I believe it's the arrayd type which is problematic. From the stack trace, I believe the problem is with hibernate-commons-annotations. I also attach the class that reproduces the problem.
    via by Aleksei Valikov,
  • The following source: @javax.persistence.Entity public class TestEntity { @javax.persistence.Id public int Id; public java.util.ArrayList<Object[]> badMethod() { return null; } public static void main(String args[]) { new org.hibernate.cfg.AnnotationConfiguration().addAnnotatedClass(TestEntity .class).configure().buildSessionFactory(); } } will cause: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164)^M at org.hibernate.annotations.common.reflection.java.JavaXMethod.create(JavaXMethod.java:18) at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXMethod(JavaReflectionManager.java:128) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethods(JavaXClass.java:114) at org.hibernate.validator.ClassValidator.initValidator(ClassValidator.java:214) at org.hibernate.validator.ClassValidator.<init>(ClassValidator.java:133) at org.hibernate.validator.event.ValidateEventListener.initialize(ValidateEventListener.java:91) at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:356) at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1304) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294) Changing the return type to List<Object[]> avoids the bug. Attached is a tgz of an ant-buildable project; typing "ant run" will illustrate the bug.
    via by Clint Popetz,
    • javax.persistence.PersistenceException: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:258) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83) at org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.createEntityManagerFactory(AbstractEntityManagerTest.java:85) at org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.setUp(AbstractEntityManagerTest.java:44) at junit.framework.TestCase.runBare(TestCase.java:125) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164) at org.hibernate.annotations.common.reflection.java.JavaXProperty.create(JavaXProperty.java:20) at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXProperty(JavaReflectionManager.java:117) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethodProperties(JavaXClass.java:91) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:106) at org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:98) at org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:984) at org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:833) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:645) at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277) at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115) at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269) at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:186) at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:246) ... 17 more
    No Bugmate found.