Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate NoSuchMethodError in Byte buddy when Building Session Factory

I've been searching all night and I can't seem to find a solution anywhere. Every time I try and log into the database from my application, I get this:

    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1774) ~[jfxrt.jar:?]
    at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1657) ~[jfxrt.jar:?]
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) ~[jfxrt.jar:?]
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) ~[jfxrt.jar:?]
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) ~[jfxrt.jar:?]
    at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) ~[jfxrt.jar:?]
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) ~[jfxrt.jar:?]
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) ~[jfxrt.jar:?]
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) ~[jfxrt.jar:?]
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) ~[jfxrt.jar:?]
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) ~[jfxrt.jar:?]
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) ~[jfxrt.jar:?]
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) ~[jfxrt.jar:?]
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) ~[jfxrt.jar:?]
    at javafx.event.Event.fireEvent(Event.java:198) ~[jfxrt.jar:?]
    at javafx.scene.Scene$ClickGenerator.postProcess(Scene.java:3470) ~[jfxrt.jar:?]
    at javafx.scene.Scene$ClickGenerator.access$8100(Scene.java:3398) ~[jfxrt.jar:?]
    at javafx.scene.Scene$MouseHandler.process(Scene.java:3766) ~[jfxrt.jar:?]
    at javafx.scene.Scene$MouseHandler.access$1500(Scene.java:3485) ~[jfxrt.jar:?]
    at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1762) ~[jfxrt.jar:?]
    at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2494) ~[jfxrt.jar:?]
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:394) ~[jfxrt.jar:?]
    at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295) ~[jfxrt.jar:?]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_181]
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$353(GlassViewEventHandler.java:432) ~[jfxrt.jar:?]
    at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) ~[jfxrt.jar:?]
    at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:431) ~[jfxrt.jar:?]
    at com.sun.glass.ui.View.handleMouseEvent(View.java:555) ~[jfxrt.jar:?]
    at com.sun.glass.ui.View.notifyMouse(View.java:937) ~[jfxrt.jar:?]
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) ~[jfxrt.jar:?]
    at com.sun.glass.ui.win.WinApplication.lambda$null$147(WinApplication.java:177) ~[jfxrt.jar:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_181]
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_181]
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771) ~[jfxrt.jar:?]
    ... 31 more
Caused by: java.lang.ExceptionInInitializerError
    at com.my.package.persistence.util.HibernateConnection.<init>(HibernateConnection.java:93) ~[classes/:?]
    at com.my.package.persistence.util.HibernateConnection.connect(HibernateConnection.java:118) ~[classes/:?]
    at sc.database.DatabaseController.initializeDatabase(DatabaseController.java:191) ~[classes/:?]
    at sc.ui.UserLoginController.verifyCredentials(UserLoginController.java:98) ~[classes/:?]
    at sc.ui.UserLoginController.moveToChooseNewOrExistingSession(UserLoginController.java:83) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_181]
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_181]
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771) ~[jfxrt.jar:?]
    ... 31 more
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.JoinedSubclassEntityPersister
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:123) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:154) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at com.my.package.persistence.util.HibernateConnection.<init>(HibernateConnection.java:90) ~[classes/:?]
    at com.my.package.persistence.util.HibernateConnection.connect(HibernateConnection.java:118) ~[classes/:?]
    at sc.database.DatabaseController.initializeDatabase(DatabaseController.java:191) ~[classes/:?]
    at sc.ui.UserLoginController.verifyCredentials(UserLoginController.java:98) ~[classes/:?]
    at sc.ui.UserLoginController.moveToChooseNewOrExistingSession(UserLoginController.java:83) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_181]
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_181]
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771) ~[jfxrt.jar:?]
    ... 31 more
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:91) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:116) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:382) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:551) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:135) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:154) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at com.my.package.persistence.util.HibernateConnection.<init>(HibernateConnection.java:90) ~[classes/:?]
    at com.my.package.persistence.util.HibernateConnection.connect(HibernateConnection.java:118) ~[classes/:?]
    at sc.database.DatabaseController.initializeDatabase(DatabaseController.java:191) ~[classes/:?]
    at sc.ui.UserLoginController.verifyCredentials(UserLoginController.java:98) ~[classes/:?]
    at sc.ui.UserLoginController.moveToChooseNewOrExistingSession(UserLoginController.java:83) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_181]
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_181]
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771) ~[jfxrt.jar:?]
    ... 31 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:88) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:116) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:382) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:551) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:135) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:154) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at com.my.package.persistence.util.HibernateConnection.<init>(HibernateConnection.java:90) ~[classes/:?]
    at com.my.package.persistence.util.HibernateConnection.connect(HibernateConnection.java:118) ~[classes/:?]
    at sc.database.DatabaseController.initializeDatabase(DatabaseController.java:191) ~[classes/:?]
    at sc.ui.UserLoginController.verifyCredentials(UserLoginController.java:98) ~[classes/:?]
    at sc.ui.UserLoginController.moveToChooseNewOrExistingSession(UserLoginController.java:83) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_181]
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_181]
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771) ~[jfxrt.jar:?]
    ... 31 more
Caused by: java.lang.IllegalArgumentException: Could not create type
    at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:140) ~[byte-buddy-1.7.4.jar:?]
    at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:346) ~[byte-buddy-1.7.4.jar:?]
    at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:161) ~[byte-buddy-1.7.4.jar:?]
    at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:355) ~[byte-buddy-1.7.4.jar:?]
    at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.load(ByteBuddyState.java:181) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.loadProxy(ByteBuddyState.java:107) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper.buildProxy(ByteBuddyProxyHelper.java:54) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyFactory.postInstantiate(ByteBuddyProxyFactory.java:62) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:156) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:58) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:88) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:116) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:382) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:551) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:135) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:154) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at com.my.package.persistence.util.HibernateConnection.<init>(HibernateConnection.java:90) ~[classes/:?]
    at com.my.package.persistence.util.HibernateConnection.connect(HibernateConnection.java:118) ~[classes/:?]
    at sc.database.DatabaseController.initializeDatabase(DatabaseController.java:191) ~[classes/:?]
    at sc.ui.UserLoginController.verifyCredentials(UserLoginController.java:98) ~[classes/:?]
    at sc.ui.UserLoginController.moveToChooseNewOrExistingSession(UserLoginController.java:83) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_181]
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_181]
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771) ~[jfxrt.jar:?]
    ... 31 more
Caused by: java.lang.NoSuchMethodError: net.bytebuddy.dynamic.loading.ClassInjector$UsingLookup.isAvailable()Z
    at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.resolveClassLoadingStrategy(ByteBuddyState.java:227) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.lambda$load$0(ByteBuddyState.java:185) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:138) ~[byte-buddy-1.7.4.jar:?]
    at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:346) ~[byte-buddy-1.7.4.jar:?]
    at net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:161) ~[byte-buddy-1.7.4.jar:?]
    at net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:355) ~[byte-buddy-1.7.4.jar:?]
    at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.load(ByteBuddyState.java:181) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.loadProxy(ByteBuddyState.java:107) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper.buildProxy(ByteBuddyProxyHelper.java:54) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyFactory.postInstantiate(ByteBuddyProxyFactory.java:62) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:162) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:156) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:58) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:88) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:116) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:382) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:551) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:135) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_181]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_181]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.metamodel.internal.MetamodelImpl.initialize(MetamodelImpl.java:154) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:467) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708) ~[hibernate-core-5.3.6.Final.jar:5.3.6.Final]
    at com.my.package.persistence.util.HibernateConnection.<init>(HibernateConnection.java:90) ~[classes/:?]
    at com.my.package.persistence.util.HibernateConnection.connect(HibernateConnection.java:118) ~[classes/:?]
    at sc.database.DatabaseController.initializeDatabase(DatabaseController.java:191) ~[classes/:?]
    at sc.ui.UserLoginController.verifyCredentials(UserLoginController.java:98) ~[classes/:?]
    at sc.ui.UserLoginController.moveToChooseNewOrExistingSession(UserLoginController.java:83) ~[classes/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) ~[?:1.8.0_181]
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181]
    at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275) ~[?:1.8.0_181]
    at javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1771) ~[jfxrt.jar:?]
    ... 31 more

This occurs when sessionFactory is set below:

private HibernateConnection(HibernateConfig config) {
        try {    
Configuration cfg = new Configuration()
                        .addPackage("com.my.package.persistence.entity")
                        .setProperty("hibernate.connection.url", config.getUrl())
                            .setProperty("hibernate.connection.username", config.getUsername())
                            .setProperty("hibernate.connection.password", config.getPassword())
                            .setProperty("hibernate.dialect", config.getDialect())
                            .setProperty("hibernate.hbm2ddl.auto", config.getMode())
                            .setProperty("hibernate.validator.autoregister_listeners", "false")
                            .setProperty("hibernate.validator.apply_to_ddl", "false")
                    .addAnnotatedClass(AbstractPerson.class)
                        .addAnnotatedClass(Address.class)
                        .addAnnotatedClass(Dependent.class)
                        .addAnnotatedClass(Person.class)
                        .addAnnotatedClass(Session.class)
                        .addAnnotatedClass(SessionField.class)
                        .addAnnotatedClass(SessionFieldEntry.class);

            ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
            .applySettings(cfg.getProperties()).build();

            sessionFactory = cfg.buildSessionFactory(serviceRegistry);
} catch (Exception e) {
            throw new ExceptionInInitializerError(e);
        }

And my dependencies:

    <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>

    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.4.197</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.3.6.Final</version>
    </dependency>

    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>

I've removed hibernate annotations 3.5.6 from my pom, I've dug into the class files to try and understand what's happening, and I've browsed so many similar issues, but they usually seem to have a missing getter or something simple like that. This appears to be in something Hibernate relies upon. Any help is appreciated.

like image 744
jysk131 Avatar asked Oct 17 '22 11:10

jysk131


1 Answers

Check the comment by samabcde above for the answer. As noted there, the testing frameworks in the main package were interfering with the version of byte buddy that was supposed to be used from the persistence package.

like image 137
jysk131 Avatar answered Oct 20 '22 06:10

jysk131