servlet 2.5 - Doesn't work Spring Boot legacy in my project -
i new in spring boot , trying use in project configured servlet 2.5. when run eclipse maven plugin goal "spring-boot:run" execution returns following error:
`[tomcat-startstop-1] error o.apache.catalina.core.containerbase - child container failed during start java.util.concurrent.executionexception: org.apache.catalina.lifecycleexception: failed start component [standardengine[tomcat].standardhost[localhost].tomcatembeddedcontext[]] @ java.util.concurrent.futuretask.report(futuretask.java:122) [na:1.8.0_60] @ java.util.concurrent.futuretask.get(futuretask.java:192) [na:1.8.0_60] @ org.apache.catalina.core.containerbase.startinternal(containerbase.java:939) ~[tomcat-embed-core-8.5.11.jar:8.5.11] @ org.apache.catalina.core.standardhost.startinternal(standardhost.java:872) [tomcat-embed-core-8.5.11.jar:8.5.11] @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) [tomcat-embed-core-8.5.11.jar:8.5.11] @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1419) [tomcat-embed-core-8.5.11.jar:8.5.11] @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1409) [tomcat-embed-core-8.5.11.jar:8.5.11] @ java.util.concurrent.futuretask.run(futuretask.java:266) [na:1.8.0_60] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) [na:1.8.0_60] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) [na:1.8.0_60] @ java.lang.thread.run(thread.java:745) [na:1.8.0_60]
my project has parent , 3 modules, 1 of childs web project.
my configuration following:
in parent pom:
<parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.5.2.release</version> </parent>
...<properties> <springboot.version>1.5.2.release</springboot.version> </properties>
...</dependencymanagement> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> <version>${springboot.version}</version> </dependency>
<dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-tomcat</artifactid>
<version>${springboot.version}</version> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-legacy</artifactid> <version>1.1.0.release</version> </dependency> </dependencies> </dependencymanagement>
-in web child pom:
` <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> <dependency> <groupid>org.apache.tomcat.embed</groupid> <artifactid>tomcat-embed-jasper</artifactid> <scope>provided</scope> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-security</artifactid> </dependency> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-legacy</artifactid> </dependency> </dependencies> ` ... ` <plugins> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> </plugin> </plugins> `
- in web.xml:
<listener>
<listener-class>org.springframework.boot.legacy.context.web.springbootcontextloaderlistener</listener-class> </listener>
spring-boot-legacy, 1.1.0.release guaranteed work spring boot, 1.4.2.release.
not works in usual spring boot work. programatically defined servlet filters , servlets (e.g. using filterregistrationbean or servletregistrationbean) not work, think due limitations in servlet 2.5. servlet 3.0 annotations not work either (e.g. @webservlet)
tomcat 6 supports servlet 2.5. spring boot legacy app should work fine using like:
mvn tomcat6:run
<plugin> <artifactid>tomcat6-maven-plugin</artifactid> <groupid>org.apache.tomcat.maven</groupid> <version>2.0</version> </plugin>
also important give springbootcontextloaderlistener clue find "application" class (the class containing @springbootapplication), e.g.:
your web.xml contain like:
<context-param> <param-name>contextconfiglocation</param-name> <param-value>demo.application</param-value> </context-param>
once understand limitations, amazing work!
Comments
Post a Comment