grails-core: 5.1.2-SNAPSHOT does not deploy successfully on Tomcat 9

Expected Behavior

Default Grails 5.1.2.SNAPSHOT project should start successfully on Tomcat 9 Standalone

Actual Behaviour

Default Grails 5.1.2.SNAPSHOT project can’t start successfully on Tomcat 9. Instead you get this partial stacktrace:

Caused by: io.micronaut.context.exceptions.NoSuchBeanException: No bean of type [org.springframework.context.ConfigurableApplicationContext] exists. Make sure the bean is not disabled by bean requirements (enable trace logging for 'io.micronaut.context.condition' to check) and if the bean is enabled then ensure the class is declared a bean and annotation processing is enabled (for Java and Kotlin the 'micronaut-inject-java' dependency should be configured as an annotation processor).
		at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:2795)
		at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:888)
		at grails.boot.GrailsApp.createApplicationContext(GrailsApp.groovy:185)
		at org.springframework.boot.SpringApplication.run(SpringApplication.java:299)
		at grails.boot.GrailsApp.run(GrailsApp.groovy:99)
		at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:175)
		at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:155)
		at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:97)
		at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:174)
		at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

Steps To Reproduce

  1. Create project using Grails 5.1.2.SNAPSHOT
  2. grails war
  3. copy war to <TOMCAT_HOME>/weapps
  4. bin/catalina.sh run

Environment Information

MacOS X BigSur JDK 11

Example Application

No response

Version

5.1.2-SNAPSHOT

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 27 (12 by maintainers)

Most upvoted comments

@borinquenkid I think it is because provided configurations works transitively. If you are using providedCompile then I think you need to add the dependency as:

providedCompile "org.springframework.boot:spring-boot-starter-tomcat:2.6.2@jar"

Please read more information regarding provided in the link in my previous response.