Exception while deploying the java application to tomcat using cargo plugin and the task is cargoDeployRemote


(KrishnaPrasad Govardhanam) #1

Hi,

I am getting the following exception while running the task cargoDeployRemote task to deploy my app to tomcat server.
Here is my build.gradle,
buildscript {
ext {
springBootVersion = ‘1.3.5.RELEASE’
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath(“org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}”)
classpath(“com.bmuschko:gradle-tomcat-plugin:2.0”)
classpath(“com.bmuschko:gradle-cargo-plugin:2.2.2”)
classpath(‘org.hidetake:gradle-ssh-plugin:0.1.7’)
}
}

apply plugin: 'java’
apply plugin: 'eclipse’
apply plugin: 'spring-boot’
apply plugin: 'war’
apply plugin: 'com.bmuschko.tomcat’
apply plugin: 'com.bmuschko.cargo’
cargoDeployRemote.dependsOn war
cargoRedeployRemote.dependsOn war
war{
baseName = 'mytest’
version = ‘0.0.1-SNAPSHOT’
}

jar {
baseName = 'mytest’
version = ‘0.0.1-SNAPSHOT’
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
mavenCentral()
}

configurations {
providedRuntime
}

dependencies {
compile(‘org.springframework.boot:spring-boot-starter-data-jpa’)
compile(‘org.springframework.boot:spring-boot-starter-web’)
runtime(‘com.h2database:h2’)
testCompile(‘org.springframework.boot:spring-boot-starter-test’)
providedRuntime(‘org.springframework.boot:spring-boot-starter-tomcat’)
def tomcatVersion = '7.0.57’
def cargoVersion = '1.4.5’
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’
}
cargo (“org.codehaus.cargo:cargo-core-uberjar:$cargoVersion”,
“org.codehaus.cargo:cargo-ant:$cargoVersion”)
}

eclipse {
classpath {
containers.remove(‘org.eclipse.jdt.launching.JRE_CONTAINER’)
containers ‘org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8’
}
}
tomcatRun.contextPath = '/'
tomcatRunWar.contextPath = ‘/’

cargo {
containerId = 'tomcat7x’
port = 8080

deployable {
    context = '/'
}

remote {
	protocol = 'http'
    hostname = 'xxx.xxx.xx.xxx'
    username = 'admin'
    password = 'admin'
}    

}
Here is the exception,

Caused by: org.codehaus.cargo.container.ContainerException: Failed to deploy [C:\Users\krishg\jpa\mytest\build\libs\mytest-0.0.1-SNAPSHOT.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:111)
at org.codehaus.cargo.ant.CargoTask.executeActions(CargoTask.java:603)
at org.codehaus.cargo.ant.CargoTask.execute(CargoTask.java:513)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
… 71 more
Caused by: java.io.IOException: Error writing request body to server
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.pipe(TomcatManager.java:647)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:538)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:611)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:291)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:102)
… 75 more

I appreciate your help in this issue.

Thanks!


(KrishnaPrasad Govardhanam) #2

Just fyi…for the same build script cargoRedeployRemote works fine. I am just curious what is wrong in cargoDeployRemote!