Cannot deploy anymore with maven plugin if Tomcat is behind Apache mod_proxy

92 views
Skip to first unread message

Massimiliano

unread,
Oct 2, 2015, 4:30:01 AM10/2/15
to Codehaus Cargo
Hi,
if I try to deploy a .war through port 80 (instead of the usual 8080) with maven plugin I get:


[java] Caused by: org.codehaus.cargo.container.
ContainerException:
 
Failed to deploy [/mypath/mywebapp.war]
     
[java]     at
 org
.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:106)
     
[java]     at
 org
.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:184)
     
[java]     at
 org
.codehaus.cargo.maven2.DeployerRedeployMojo.performDeployerActionOnSingleDeployable(DeployerRedeployMojo.java:49)
     
[java]     at
 org
.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionOnAllDeployables(AbstractDeployerMojo.java:165)
     
[java]     at
 org
.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDeployerMojo.java:96)
     
[java]     at
 org
.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:436)
     
[java]     at
 org
.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
     
[java]     ... 21 more
     
[java] Caused by:
 org
.codehaus.cargo.container.tomcat.internal.TomcatManagerException:
 HTTP
/1.1 200 OK
     
[java] Date: Wed, 30 Sep 2015 10:27:52 GMT
     
[java] Server: Apache-Coyote/1.1
     
[java] Pragma: No-cache
     
[java] Cache-Control: no-cache
     
[java] Expires: Thu, 01 Jan 1970 01:00:00 GMT
     
[java] Content-Type: text/plain;charset=utf-8
     
[java] Connection: close
     
[java] Transfer-Encoding: chunked
     
[java] 42
     
[java] OK - Deployed application at context path /mywebapp
     
[java] 0
     
[java]     at
 org
.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:715)
     
[java]     at
 org
.codehaus.cargo.container.tomcat.internal.TomcatManager.deployImpl(TomcatManager.java:760)
     
[java]     at
 org
.codehaus.cargo.container.tomcat.internal.TomcatManager.deploy(TomcatManager.java:312)
     
[java]     at
 org
.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.deploy(AbstractTomcatManagerDeployer.java:101)
     
[java]     ... 27 more

I'm using mod_proxy and tomcat. The source code at line 715 of org.codehaus.cargo.container.tomcat.internal.TomcatManager is:

if (!response.startsWith("OK -"))
 
{
     
throw new TomcatManagerException(response);
 
}

But my response is "HTTP/1.1 200 OK", instead of "OK -....".
The deploy ends, but the build fails. I notice this behavior from release 1.4.15.

Thanks

Massimiliano

S. Ali Tokmen

unread,
Oct 6, 2015, 4:36:31 PM10/6/15
to codehau...@googlegroups.com
Hi Massimiliano

This is a bit weird ... Normally the code is supposed to check the response string from the Tomcat Manager, whereas in your case the HTTP/1.1 200 OK is clearly an HTTP response code and not a response.

Can you do the following please:
  1. Follow the instructions on https://codehaus-cargo.github.io/cargo/Debugging.html to start Maven in a "verbose logging" mode (-X option) and send back the output from Maven (as a text attachment perhaps)
  2. Wait c.a. 24 hours from this e-mail and try with the latest SNAPSHOT version https://codehaus-cargo.github.io/cargo/Maven2+Plugin+Installation.html#Maven2PluginInstallation-snapshots - The version won't solve the issue, but will give details about what's happening

Thank you

S. Ali Tokmen
http://ali.tokmen.com/
http://contact.ali.tokmen.com/
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/codehaus-cargo/cb2b8f49-75f8-419d-8968-67801321651a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Massimiliano

unread,
Oct 8, 2015, 9:52:04 AM10/8/15
to Codehaus Cargo
Hi,
see attachment for the output log. The -e and -X options were used. Just replaced some "privacy" infos.

Regards
Massimiliano
maven-cargo-log-20151008.txt

S. Ali Tokmen

unread,
Oct 9, 2015, 3:33:27 AM10/9/15
to codehau...@googlegroups.com
Hi Massimiliano

Thanks, what you reported looks scaringly similar to the Java bug described in http://stackoverflow.com/questions/6189440/httpurlconnection-getinputstream-sometimes-contains-response-headers - I filed this as https://codehaus-cargo.atlassian.net/browse/CARGO-1342 and also implemented a workaround which I think would address the issue.

Can you please again wait c.a. 24 hours from this e-mail (for the CI to automatically build and deploy the latest version) and try with the latest SNAPSHOT version https://codehaus-cargo.github.io/cargo/Maven2+Plugin+Installation.html#Maven2PluginInstallation-snapshots - Alternatively you can also build the latest MASTER version yourself.
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.

Massimiliano

unread,
Oct 9, 2015, 7:16:08 AM10/9/15
to Codehaus Cargo
Notice that cargo 1.4.14 is working in the same enviroment. I see some small differences in the latest class, like:

connection.setRequestProperty("Expect", "100-continue");

Maybe this is an openjdk bug related to [1].

[1] https://bugs.openjdk.java.net/browse/JDK-8012625

Regards

Massimiliano

S. Ali Tokmen

unread,
Oct 10, 2015, 5:30:40 AM10/10/15
to codehau...@googlegroups.com
Hi Massimiliano

That bug looks similar, but not the exact same... And we actually need to 100-continue header for some of the authentication mechanisms.

Did you have time to try the latest SNAPSHOT yet?

Please advise

Massimiliano

unread,
Oct 13, 2015, 4:38:19 AM10/13/15
to Codehaus Cargo
Hi Ali,
sorry for the delay: I was busy. The result now is BUILD SUCCESS with the latest 1.4.17-SNAPSHOT.
I can provide further info If you need.

Thank you
Massimiliano

S. Ali Tokmen

unread,
Oct 13, 2015, 8:13:05 AM10/13/15
to codehau...@googlegroups.com
Hi Massimiliano

Thanks for the feedback.

Since the system is now working as expected and the bug https://codehaus-cargo.atlassian.net/browse/CARGO-1342 is closed, no further action is required from your side ... Apart from waiting for our official 1.4.17 release :)

Regards

Massimiliano

unread,
Oct 15, 2015, 3:55:24 AM10/15/15
to Codehaus Cargo
Oh yes!
We are waiting for the 1.4.17 release to upgrade our systems.

Thank you again
Massimiliano


Il giorno martedì 13 ottobre 2015 14:13:05 UTC+2, Savaş Ali Tokmen ha scritto:
Hi Massimiliano

S. Ali Tokmen

unread,
Oct 17, 2015, 2:48:11 AM10/17/15
to codehau...@googlegroups.com
Hi Massimiliano

We typically have one Codehaus Cargo release every 3 months - So most likelt 1.4.17 will be released sometime in November / December.

If this is crucial, we can of course try to squeeze in another intermediate release :)

Thank you
--
You received this message because you are subscribed to the Google Groups "Codehaus Cargo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codehaus-carg...@googlegroups.com.

Massimiliano

unread,
Oct 17, 2015, 11:58:14 AM10/17/15
to Codehaus Cargo
We can survive until december  ;-)

Regards

Massimiliano


Il giorno sabato 17 ottobre 2015 08:48:11 UTC+2, Savaş Ali Tokmen ha scritto:
Hi Massimiliano

Reply all
Reply to author
Forward
0 new messages