Using Hibernate 3.2, I get the following error:
javax.persistence.PersistenceException: java.lang.IllegalArgumentException: No PropertyTypeExtractor available for type void
After some debugging, I was able to narrow it down to the following method declaration that is inside an entity class:
protected ArrayList<Integer[][]> splitEventTimes(Integer[][] eventTimes)
The exception is thrown as well for the following declaration:
protected ArrayList<Integer[]> splitEventTimes(Integer[][] eventTimes)
The exception is not thrown for the following declarations:
protected ArrayList<Integer> splitEventTimes(Integer[][] eventTimes)
protected ArrayList<ArrayList<Integer>> splitEventTimes(Integer[][] eventTimes)
It appears that when the EntityManagerFactory is being initialized and "visiting" each entity class, it does not recognize collections of arrays. I don't know whether this qualifies as a bug or not, but is there any way I can force the reflector to ignore or skip over this particular method declaration? I could rewrite it to do a three-dimensional array instead if necessary, but would appreciate advice first.
I also notice there are a few other people who seem to have had this problem when I googled for this exception, but none of them were able to resolve it. It would probably be nice to add a more informative error message if you decide this is not a "bug" so that they know what needs to be done to fix it.
If you need additional information, please let me know!
The stacktrace is as follows:
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:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at epl.physiology.TCTest.persist(TCTest.java:82)
at epl.physiology.TCTest.testPersistence(TCTest.java:75)
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.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.ejb.event.CallbackResolver.resolveCallback(CallbackResolver.java:56)
at org.hibernate.ejb.event.EntityCallbackHandler.addCallback(EntityCallbackHandler.java:92)
at org.hibernate.ejb.event.EntityCallbackHandler.add(EntityCallbackHandler.java:37)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:158)
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)
|