Hi, Great to see such good progress on Grails rece...
# questions
u
Hi, Great to see such good progress on Grails recently! I'm quite far along with converting our large Grails app to V7 and it's running well in development. We build a war which is deployed in Tomcat but i'm getting some kind of issue with logging. I've tried searching and AI but i've been struggling to find the solution. The app doesn't start up and gives this error, which seems to be coming from Spring data jpa (from what I can tell) which we use as well as GORM. It looks like possibly an issue with the jboss-logging version. We use logback for our app logging and want as much logging as possible to go through there. I'm a bit stuck at the moment so wondered if anyone could help? Thanks
Copy code
dashboard-1  | org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': null
dashboard-1  |  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1826)
dashboard-1  |  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:607)
dashboard-1  |  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:529)
dashboard-1  |  at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:339)
dashboard-1  |  at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:373)
dashboard-1  |  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:337)
dashboard-1  |  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
dashboard-1  |  at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:970)
dashboard-1  |  at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627)
dashboard-1  |  at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
dashboard-1  |  at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
dashboard-1  |  at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439)
dashboard-1  |  at org.springframework.boot.SpringApplication.run(SpringApplication.java:318)
dashboard-1  |  at grails.boot.GrailsApp.run(GrailsApp.groovy:102)
dashboard-1  |  at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:194)
dashboard-1  |  at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:174)
dashboard-1  |  at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:102)
dashboard-1  |  at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:171)
dashboard-1  |  at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4464)
dashboard-1  |  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
dashboard-1  |  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:599)
dashboard-1  |  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:571)
dashboard-1  |  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:655)
dashboard-1  |  at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:632)
dashboard-1  |  at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1881)
dashboard-1  |  at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
dashboard-1  |  at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
dashboard-1  |  at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
dashboard-1  |  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
dashboard-1  |  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
dashboard-1  |  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)
dashboard-1  |  at java.base/java.lang.Thread.run(Unknown Source)
dashboard-1  | Caused by: java.lang.ExceptionInInitializerError: null
dashboard-1  |  at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:54)
dashboard-1  |  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:390)
dashboard-1  |  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:419)
dashboard-1  |  at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:400)
dashboard-1  |  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:366)
dashboard-1  |  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1873)
dashboard-1  |  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1822)
dashboard-1  |  ... 31 common frames omitted
dashboard-1  | Caused by: java.lang.IllegalArgumentException: The given lookup does not have access to the implementation class constructor
dashboard-1  |  at org.jboss.logging.Logger.doGetMessageLogger(Logger.java:2641)
dashboard-1  |  at org.jboss.logging.Logger.getMessageLogger(Logger.java:2570)
dashboard-1  |  at org.jboss.logging.Logger.getMessageLogger(Logger.java:2552)
dashboard-1  |  at org.hibernate.internal.HEMLogging.messageLogger(HEMLogging.java:28)
dashboard-1  |  at org.hibernate.internal.HEMLogging.messageLogger(HEMLogging.java:24)
dashboard-1  |  at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<clinit>(EntityManagerFactoryBuilderImpl.java:144)
u
It seems likely that this error is related to a known incompatibility between certain logging libraries (like JBoss Logging) and the module system or classloader restrictions in newer servlet containers or JDKs. Specifically, the "The given lookup does not have access to the implementation class constructor" from JBoss Logging is often seen when the logging implementation is not compatible with the environment, or when a required logging dependency is missing or shaded incorrectly. This is especially common when deploying Grails 7 (or Spring Boot 3+) WARs to Tomcat, as the logging setup differs from the embedded mode and may require explicit configuration or dependency adjustments. My understanding is that you should review your dependencies to ensure you are not excluding or shading JBoss Logging, SLF4J, or Log4j2 in a way that breaks Hibernate or Spring Boot logging. Also, make sure you are not mixing incompatible versions of these libraries. If you have custom logging configuration or exclusions in your
build.gradle
, try removing them and use the default Grails 7 logging setup. If you are using a custom
logback.xml
or
log4j2.xml
, ensure it is compatible with the versions bundled with Grails 7 and Spring Boot 3. For more on similar issues, see the discussion in Grails 7 support and Grails 6 &amp; earlier only support the older javax.* packages. Grails 7 is intended to be compatible with the javax -&gt; jakarta conversion. Would you like a step-by-step checklist for troubleshooting WAR logging issues in Grails 7? Sources: - https://github.com/apache/grails-core/discussions/14673 - Grails 7 support 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
u
A message from kapa.ai
u
I'm sorry, but the knowledge sources provided do not contain explicit information about the specific error you're encountering with the
entityManagerFactory
and the logging/JBoss/Hibernate integration in Grails 7 when deploying a WAR to Tomcat. Most of the errors in the sources relate to issues with Hibernate, GORM, or Spring bean creation, but none mention the
IllegalArgumentException: The given lookup does not have access to the implementation class constructor
or the JBoss logging/Hibernate integration problem you are seeing. Based on the stack trace, the root cause appears to be related to Hibernate's use of JBoss Logging and Java module access restrictions, but without more direct information from the knowledge sources, I cannot provide a Grails-specific solution or workaround. If you can provide more details or if there are updates to the knowledge sources, I would be happy to take another look. For now, the knowledge sources do not contain enough information to answer your question with confidence.
j
run ./gradlew dependencies and look for hibernate-core vs hibernate-core-jakarta, that may be the culprit It could be coming from one of these situations https://grails.apache.org/docs/latest/guide/upgrading.html#_12_5_hibernate_ehcache https://grails.apache.org/docs/snapshot/guide/upgrading.html#_12_19_hibernate_cache_region_factory_class
👍 2