Reputation: 1021
I want to upgrade the JDK Version from 8 to 11 in my grails project. I am using
IntelliJ version 2021.3.1
Grails: 4.0.10
Gradle: : 5.6.4
Springframework 2.1.18
When I startup my application, I get many exceptions, all like:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workflowService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'emailService': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mailService': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:514)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:321)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:319)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByName(AbstractAutowireCapableBeanFactory.java:1443)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1382)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:591)
... 206 common frames omitted
When I set a breakpoint on the AbstractAutowireCapableBeanFactory.doCreateBean, I see this error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultTransactionService': Cannot resolve reference to bean 'hibernateDatastore' while setting bean property 'targetObject'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'hibernateDatastore': Requested bean is currently in creation: Is there an unresolvable circular reference?
In JDK8 everything works fine.
Upvotes: 1
Views: 262
Reputation: 1021
After debugging, I finally found the error: In my build.gradle, I had this dependency: compile 'org.grails.plugins:mail:2.0.0'
Changed it to: compile 'org.grails.plugins:mail:3.0.0'
Now everything works fine.
Upvotes: 1