title: Java and Hibernate error. Could not instantiate persister org.hibernate.persister.entity.SingleTableEntityPersister
body: <p>I try to use Hibernate 6.0 in Java 8 with Postgres, but I got this error: Could not access Unsafe class: sun.misc.Unsafe
  How can I solve it?</p>
  <pre><code>org.hibernate.MappingException: Could not instantiate persister 
  Caused by: java.lang.IllegalArgumentException: Could not create type
      at net.bytebuddy/net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:154)
      at net.bytebuddy/net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:365)
      at net.bytebuddy/net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:174)
      at net.bytebuddy/net.bytebuddy.TypeCache$WithInlineExpunction.findOrInsert(TypeCache.java:376)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.load(ByteBuddyState.java:175)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.loadProxy(ByteBuddyState.java:99)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyHelper.buildProxy(ByteBuddyProxyHelper.java:56)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.proxy.pojo.bytebuddy.ByteBuddyProxyFactory.postInstantiate(ByteBuddyProxyFactory.java:61)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.metamodel.internal.StandardPojoEntityRepresentationStrategy.createProxyFactory(StandardPojoEntityRepresentationStrategy.java:225)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.metamodel.internal.StandardPojoEntityRepresentationStrategy.&lt;init&gt;(StandardPojoEntityRepresentationStrategy.java:120)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.metamodel.internal.StandardManagedTypeRepresentationResolver.resolveStrategy(StandardManagedTypeRepresentationResolver.java:54)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.persister.entity.AbstractEntityPersister.&lt;init&gt;(AbstractEntityPersister.java:695)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.persister.entity.SingleTableEntityPersister.&lt;init&gt;(SingleTableEntityPersister.java:141)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
      at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
      at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:97)
      ... 10 more
  Caused by: java.lang.UnsupportedOperationException: Could not access Unsafe class: sun.misc.Unsafe
      at net.bytebuddy/net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe$Dispatcher$Unavailable.initialize(ClassInjector.java:2006)
      at net.bytebuddy/net.bytebuddy.dynamic.loading.ClassInjector$UsingUnsafe.injectRaw(ClassInjector.java:1738)
      at net.bytebuddy/net.bytebuddy.dynamic.loading.ClassInjector$AbstractBase.inject(ClassInjector.java:110)
      at net.bytebuddy/net.bytebuddy.dynamic.loading.ClassLoadingStrategy$ForUnsafeInjection.load(ClassLoadingStrategy.java:567)
      at net.bytebuddy/net.bytebuddy.dynamic.TypeResolutionStrategy$Passive.initialize(TypeResolutionStrategy.java:100)
      at net.bytebuddy/net.bytebuddy.dynamic.DynamicType$Default$Unloaded.load(DynamicType.java:6156)
      at org.hibernate.orm.core@6.0.0.Alpha6/org.hibernate.bytecode.internal.bytebuddy.ByteBuddyState.lambda$load$0(ByteBuddyState.java:179)
      at net.bytebuddy/net.bytebuddy.TypeCache.findOrInsert(TypeCache.java:152)
      ... ```
  </code></pre>