javax.persistence.PersistenceException: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void

Hibernate JIRA | Aleksei Valikov | 10 years ago
  1. 0

    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.

    Hibernate JIRA | 10 years ago | Aleksei Valikov
    javax.persistence.PersistenceException: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void
  2. 0

    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.

    Hibernate JIRA | 10 years ago | Aleksei Valikov
    javax.persistence.PersistenceException: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void
  3. 0

    Why JPA @Transient does not work with array properties when using Hibernate

    Stack Overflow | 2 months ago | user3114230
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/spring/applicationContext-hibernate.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    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.

    Hibernate JIRA | 9 years ago | Clint Popetz
    java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164)^M
  6. 0

    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.

    Hibernate JIRA | 9 years ago | Clint Popetz
    java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164)^M

    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.IllegalArgumentException

      No PropertyTypeExtractor available for type void

      at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType()
    2. Hibernate Commons Annotations
      JavaXClass.getDeclaredProperties
      1. org.hibernate.annotations.common.reflection.java.JavaReflectionManager.toXType(JavaReflectionManager.java:164)
      2. org.hibernate.annotations.common.reflection.java.JavaXProperty.create(JavaXProperty.java:20)
      3. org.hibernate.annotations.common.reflection.java.JavaReflectionManager.getXProperty(JavaReflectionManager.java:117)
      4. org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethodProperties(JavaXClass.java:91)
      5. org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:106)
      6. org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:98)
      6 frames
    3. Hibernate
      Configuration.buildMappings
      1. org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:984)
      2. org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:833)
      3. org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:645)
      4. org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:498)
      5. org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:277)
      6. org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
      6 frames
    4. Hibernate EJB
      HibernatePersistence.createEntityManagerFactory
      1. org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1269)
      2. org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:150)
      3. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:888)
      4. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:186)
      5. org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:246)
      6. org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
      6 frames
    5. JavaEE 7
      Persistence.createEntityManagerFactory
      1. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
      1 frame
    6. org.jvnet.hyperjaxb3
      AbstractEntityManagerTest.setUp
      1. org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.createEntityManagerFactory(AbstractEntityManagerTest.java:85)
      2. org.jvnet.hyperjaxb3.ejb.test.AbstractEntityManagerTest.setUp(AbstractEntityManagerTest.java:44)
      2 frames
    7. JUnit
      TestSuite.run
      1. junit.framework.TestCase.runBare(TestCase.java:125)
      2. junit.framework.TestResult$1.protect(TestResult.java:106)
      3. junit.framework.TestResult.runProtected(TestResult.java:124)
      4. junit.framework.TestResult.run(TestResult.java:109)
      5. junit.framework.TestCase.run(TestCase.java:118)
      6. junit.framework.TestSuite.runTest(TestSuite.java:208)
      7. junit.framework.TestSuite.run(TestSuite.java:203)
      7 frames
    8. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
      2. org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
      4. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
      5. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
      6. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      6 frames