tomcatRunWar child container failed during start error comes when i give command "gradle tomcatRunWar"


(saket kumar) #1

While starting the tomcat server on build gradle tomcatRunWar i get:

tomcatRunWar

child container failed during start ava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]


(saket kumar) #2

i am using the below build file and i had tried few things like using the local tomcat to avoid downloading jar files every time. When i reverted back the changes i have started facing the issue.

I tried to few thing like deleting the .gradle folder under the users, That also did not work.

apply plugin: ‘war’ apply plugin: ‘tomcat’ apply plugin: ‘java’ apply plugin: ‘propdeps’ apply plugin: ‘propdeps-maven’ apply plugin: ‘propdeps-idea’ apply plugin: ‘propdeps-eclipse’ apply plugin: ‘eclipse-wtp’ //apply plugin: ‘cargo’

//tomcat_home=‘D:/apache-tomcat/apache-tomcat-7.0.53’ //tomcat_bin=tomcat_home + ‘/bin’ //tomcat_start=tomcat_bin + ‘/startup.bat’ //tomcat_stop=tomcat_bin + ‘/shutdown.bat’ //tomcat_webapps = tomcat_home + ‘/webapps’

println “PROJECT=” + project.name

buildscript {

repositories {

maven {

url “D:/maven_repository_jars”

}

}

dependencies {

classpath ‘org.gradle.api.plugins:gradle-tomcat-plugin:0.9.8’

classpath ‘org.springframework.build.gradle:propdeps-plugin:0.0.1’

} }

//{!begin repos} repositories {

mavenCentral()

maven {

url “D:/maven_repository_jars”

}

//maven { url ‘http://repo.spring.io/milestone/’} } //{!end repos}

dependencies {

def tomcatVersion = ‘7.0.42’ tomcat “org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}”,

“org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}” tomcat(“org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}”) {

exclude group: ‘org.eclipse.jdt.core.compiler’, module: ‘ecj’ }

compile files(‘D:/maven_repository_jars/validation-api-1.1.0.Final.jar’)

compile files (‘D:/maven_repository_jars/hibernate-validator-5.0.1.Final.jar’)

compile files (‘D:/maven_repository_jars/spring-core-3.2.3.RELEASE.jar’)

compile files(‘D:/maven_repository_jars/spring-webmvc-3.2.3.RELEASE.jar’)

//{!begin deps}

compile files(‘D:/maven_repository_jars/spring-security-web-3.2.0.M2.jar’)

compile files(‘D:/maven_repository_jars/spring-security-core-3.2.0.M2.jar’)

compile files(‘D:/maven_repository_jars/spring-security-config-3.2.0.M2.jar’)

//{!end deps}

compile files(‘D:/maven_repository_jars/slf4j-api-1.7.5.jar’)

runtime files(‘D:/maven_repository_jars/slf4j-log4j12-1.7.5.jar’)

compile files(‘D:/maven_repository_jars/thymeleaf-spring3-2.0.18.jar’)

compile fileTree(‘D:/maven_repository_jars’)

testCompile ‘org.springframework:spring-test:3.2.3.RELEASE’

testCompile ‘junit:junit:4.11’

testCompile “org.mockito:mockito-core:1.9.5”

testCompile “org.hamcrest:hamcrest-library:1.3”

provided files(‘D:/maven_repository_jars/javax.servlet-api-3.0.1.jar’) }

test {

testLogging {

// Show that tests are run in the command-line output

events ‘started’, ‘passed’

} }

task wrapper(type: Wrapper) { gradleVersion = ‘1.6’ }

tomcatRunWar.contextPath = ‘’


(saket kumar) #3

tomcatRunWar

child container failed during start ava.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]

at java.util.concurrent.FutureTask.report(FutureTask.java:122)

at java.util.concurrent.FutureTask.get(FutureTask.java:188)

at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)

at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:800)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:744) aused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Tomcat].StandardHost[localhost].StandardContext[]]

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

… 6 more aused by: java.lang.NoSuchMethodError: org.springframework.web.filter.DelegatingFilterProxy.(Ljava/lang/String;)V

at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.insertSpringSecurityFilterChain(AbstractSecurityWebApplicationInitializer.java:104)

at org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer.onStartup(AbstractSecurityWebApplicationInitializer.java:83)

at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:180)

at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

… 6 more


(Benjamin Muschko) #4

I am pretty sure you have a version conflict on the ‘spring-web’ JAR. The version that was selected does not provide the specific method mentioned in the stack trace above. You will need to analyze your dependencies and figure out the version you need.


(saket kumar) #5

I looked under my local repository, and there i could see older version of Spring-web.jar present which was not part of my build file.I removed that jar and kept the spring-web-3.2.3.RELEASE.jar file. I am now able to SUCCESSFULLY start the tomact.

Thanks for your accurate analysis!!