The above posted exception is what I got when trying to run unit tests. Interestingly, if I use the eclipse plugin Hibernate Console Configuration and try to create a session factory, I get the following exception:
Quote:
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of com.something.user.entity.User.userUuid
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:119)
at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:42)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:108)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:87)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:222)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:77)
at org.hibernate.console.ConsoleConfiguration.initSessionFactory(ConsoleConfiguration.java:220)
at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:51)
at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:47)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3058)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:365)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:105)
at org.hibernate.engine.UnsavedValueFactory.getUnsavedIdentifierValue(UnsavedValueFactory.java:44)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:42)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:108)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:87)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:211)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:222)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:77)
at org.hibernate.console.ConsoleConfiguration.initSessionFactory(ConsoleConfiguration.java:220)
at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:51)
at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:47)
at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3058)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:365)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
Notice that this exception goes through org.hibernate.persister.entity.JoinedSubclassEntityPersister. This makes me think that it might be caused by the same problem as the exception I posted previously. Something must be wrong with the way I am doing joined-subclass, but I'm following the docs!
One thing to note is that I'm joining across java packages, and db schemas. Maybe that is confusing Hibernate?? I am able to generate POJOs and DDL using the Hibernate Tools without any complaints, and it all seems to be generated correctly.