你好,我注册了MiraiHibernateRecorder,但是调用的时候报错了,好像是实例化的问题,能帮忙看下吗
Exception in thread "DefaultDispatcher-worker-2" java.lang.RuntimeException: Exception while trying to handle coroutine exception
at kotlinx.coroutines.CoroutineExceptionHandlerKt.handlerException(CoroutineExceptionHandler.kt:38)
at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:29)
at kotlinx.coroutines.StandaloneCoroutine.handleJobException(Builders.common.kt:196)
at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:229)
at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:906)
at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:863)
at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:828)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Suppressed: kotlin.UninitializedPropertyAccessException: lateinit property factory has not been initialized
at xyz.cssxsh.mirai.hibernate.MiraiHibernateUtilsKt.getFactory(MiraiHibernateUtils.kt:74)
at xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder.merge(MiraiHibernateRecorder.kt:30)
at xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder.access$merge(MiraiHibernateRecorder.kt:28)
at xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder$record$11.invokeSuspend(MiraiHibernateRecorder.kt:152)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
... 5 more
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [net.mamoe.mirai.event.SimpleListenerHost$special$$inlined$CoroutineExceptionHandler$1@58551237, StandaloneCoroutine{Cancelling}@6e8d0dfb, Dispatchers.Default]
Caused by: java.lang.NoClassDefFoundError: jakarta/persistence/PersistenceException
at xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder.handleException(MiraiHibernateRecorder.kt:545)
at net.mamoe.mirai.event.SimpleListenerHost$special$$inlined$CoroutineExceptionHandler$1.handleException(CoroutineExceptionHandler.kt:111)
at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:25)
... 12 more
Caused by: java.lang.ClassNotFoundException: jakarta.persistence.PersistenceException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 15 more
Exception in thread "DefaultDispatcher-worker-7" java.lang.RuntimeException: Exception while trying to handle coroutine exception
at kotlinx.coroutines.CoroutineExceptionHandlerKt.handlerException(CoroutineExceptionHandler.kt:38)
at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:29)
at kotlinx.coroutines.StandaloneCoroutine.handleJobException(Builders.common.kt:196)
at kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:229)
at kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:906)
at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:863)
at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:828)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Suppressed: kotlin.UninitializedPropertyAccessException: lateinit property factory has not been initialized
at xyz.cssxsh.mirai.hibernate.MiraiHibernateUtilsKt.getFactory(MiraiHibernateUtils.kt:74)
at xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder.merge(MiraiHibernateRecorder.kt:30)
at xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder.access$merge(MiraiHibernateRecorder.kt:28)
at xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder$record$1.invokeSuspend(MiraiHibernateRecorder.kt:44)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
... 5 more
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [net.mamoe.mirai.event.SimpleListenerHost$special$$inlined$CoroutineExceptionHandler$1@58551237, StandaloneCoroutine{Cancelling}@2e304ce3, Dispatchers.Default]
Caused by: java.lang.NoClassDefFoundError: jakarta/persistence/PersistenceException
at xyz.cssxsh.mirai.hibernate.MiraiHibernateRecorder.handleException(MiraiHibernateRecorder.kt:545)
at net.mamoe.mirai.event.SimpleListenerHost$special$$inlined$CoroutineExceptionHandler$1.handleException(CoroutineExceptionHandler.kt:111)
at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:25)
... 12 more
Caused by: java.lang.ClassNotFoundException: jakarta.persistence.PersistenceException
... 15 more
2023-11-28 19:43:16.075 [SpringApplicationShutdownHook] INFO o.s.orm.jpa.LocalContainerEntityManagerFactoryBean - Closing JPA EntityManagerFactory for persistence unit 'default'
N
nannanness 发布的帖子
-
RE: 获取回复消息(QuoteReply)指向原文的实现思路
-
RE: 获取回复消息(QuoteReply)指向原文的实现思路
您好,请教一下,我启动后MiraiHibernateRecorder.INSTANCE是null,然后我看readme里面说需要手动对 xyz.cssxsh.mirai.hibernate.factory 进行初始化,和对 MiraiHibernateRecorder 进行注册,但是我没找到factory,也不知道怎么初始化