-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when running application NoClassDef jakarta/persistance/EntityManager #872
Comments
Grails 6 is not compatible with Hibernate 6. |
Ok, how do I get around this error from hibernate 5.6.15.Final? This is what I was getting before Hibernate 6.4.18 2024-05-03 07:35:01,564 [main] [] ERROR org.apache.tomcat.jdbc.pool.ConnectionPool | parent-span: | trace: | span: |: Unable to create initial connections of pool. |
Can you show your |
jdbc:sqlserver://WN4747.corp.mutualofomaha.com;databaseName=QUALITY_WORK_REVIEW |
MVCC is not in my code at all. |
Ok, but even if you say that "hikari is involved", you have a tomcat jdbc connection pool trying to create a H2 jdbc connection with the MVCC parameter. I cannot say why with the information you have given. |
Any of this help? Here are the yaml settings
hibernate: gradle
} dependencies {
} |
Commenting out runtimeOnly "org.apache.tomcat:tomcat-jdbc" gives this error 2024-05-03 09:40:03,409 [main] [] ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper | parent-span: | trace: | span: |: Unsupported connection setting "MVCC" [90113-224] |
It looks like your using the Spring way to declare a datasource (not the Grails way). I would start with a new project and setup the database connection according to the Grails configuration docs to try and get it working. There is an example of using HikariCP there. Then map that over to your existing application. |
Running Grails 6.2.0, JDK 11, Springboot 2.7.18, Hibernate core 6.4.18, hibernate5 8.1.0, hikari is involved, Gradle 7.6.2
Got through an error with MVCC by upgrading to Hibernate core 6.4.18.Final and now I'm getting an error about jakarta/persistance/EntityManger is not found. What library or setting am I missing?
2024-05-02 15:47:43,927 [main] [] ERROR org.springframework.boot.SpringApplication | parent-span: | trace: | span: |: Application run failed
java.lang.IllegalStateException: Failed to introspect Class [org.grails.orm.hibernate.HibernateDatastore] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@5c29bfd]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:361)
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:418)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:765)
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:764)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:703)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:674)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1685)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:570)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:542)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:132)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:756)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:573)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
at grails.boot.GrailsApp.run(GrailsApp.groovy:99)
at grails.boot.GrailsApp.run(GrailsApp.groovy:458)
at grails.boot.GrailsApp.run(GrailsApp.groovy:445)
at qwr.Application.main(Application.groovy:11)
Caused by: java.lang.NoClassDefFoundError: jakarta/persistence/EntityManager
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3166)
at java.base/java.lang.Class.getDeclaredMethods(Class.java:2309)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467)
... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: jakarta.persistence.EntityManager
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 34 common frames omitted
The text was updated successfully, but these errors were encountered: