-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Peter,

On 2/2/20 11:31 AM, Peter Rader wrote:
> Hi,
> 
> I am using maven to redeploy a application.
> 
> Maven returning: [ERROR] Failed to execute goal
> org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on
> project xxx: Cannot invoke Tomcat manager: Error writing to server
> -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException:
> Failed to execute goal
> org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on
> project XXX: Cannot invoke Tomcat manager at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:215) at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:156) at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:148) at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
t
> (LifecycleModuleBuilder.java:117) at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
t
> (LifecycleModuleBuilder.java:81) at
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThrea
dedBuilder.build
> (SingleThreadedBuilder.java:56) at
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute
> (LifecycleStarter.java:128) at
> org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at
> org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at
> org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at
> org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at
> org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at
> org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at
> sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:62) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:43) at
> java.lang.reflect.Method.invoke (Method.java:498) at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
> (Launcher.java:282) at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch
> (Launcher.java:225) at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
> (Launcher.java:406) at
> org.codehaus.plexus.classworlds.launcher.Launcher.main
> (Launcher.java:347) Caused by:
> org.apache.maven.plugin.MojoExecutionException: Cannot invoke
> Tomcat manager at
> org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute
> (AbstractCatalinaMojo.java:149) at
> org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute
> (AbstractWarCatalinaMojo.java:70) at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
> (DefaultBuildPluginManager.java:137) at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:210) at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:156) at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:148) at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
t
> (LifecycleModuleBuilder.java:117) at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
t
> (LifecycleModuleBuilder.java:81) at
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThrea
dedBuilder.build
> (SingleThreadedBuilder.java:56) at
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute
> (LifecycleStarter.java:128) at
> org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at
> org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at
> org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at
> org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at
> org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at
> org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at
> sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:62) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:43) at
> java.lang.reflect.Method.invoke (Method.java:498) at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
> (Launcher.java:282) at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch
> (Launcher.java:225) at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
> (Launcher.java:406) at
> org.codehaus.plexus.classworlds.launcher.Launcher.main
> (Launcher.java:347) Caused by: java.io.IOException: Error writing
> to server at
> sun.net.www.protocol.http.HttpURLConnection.writeRequests
> (HttpURLConnection.java:700) at
> sun.net.www.protocol.http.HttpURLConnection.writeRequests
> (HttpURLConnection.java:712) at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream0
> (HttpURLConnection.java:1591) at
> sun.net.www.protocol.http.HttpURLConnection.getInputStream
> (HttpURLConnection.java:1498) at
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream
> (HttpsURLConnectionImpl.java:268) at
> org.codehaus.mojo.tomcat.TomcatManager.invoke
> (TomcatManager.java:604) at
> org.codehaus.mojo.tomcat.TomcatManager.deployImpl
> (TomcatManager.java:662) at
> org.codehaus.mojo.tomcat.TomcatManager.deploy
> (TomcatManager.java:295) at
> org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar
> (AbstractDeployWarMojo.java:85) at
> org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager
> (AbstractDeployMojo.java:85) at
> org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute
> (AbstractCatalinaMojo.java:141) at
> org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute
> (AbstractWarCatalinaMojo.java:70) at
> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
> (DefaultBuildPluginManager.java:137) at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:210) at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:156) at
> org.apache.maven.lifecycle.internal.MojoExecutor.execute
> (MojoExecutor.java:148) at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
t
> (LifecycleModuleBuilder.java:117) at
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProjec
t
> (LifecycleModuleBuilder.java:81) at
> org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThrea
dedBuilder.build
> (SingleThreadedBuilder.java:56) at
> org.apache.maven.lifecycle.internal.LifecycleStarter.execute
> (LifecycleStarter.java:128) at
> org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at
> org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at
> org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at
> org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at
> org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at
> org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at
> sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at
> sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:62) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:43) at
> java.lang.reflect.Method.invoke (Method.java:498) at
> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
> (Launcher.java:282) at
> org.codehaus.plexus.classworlds.launcher.Launcher.launch
> (Launcher.java:225) at
> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
> (Launcher.java:406) at
> org.codehaus.plexus.classworlds.launcher.Launcher.main
> (Launcher.java:347)
> 
> 1. Access log shows the PUT command: 02-Feb-2020 16:57:06.429 FINE
> [http-nio-80-exec-5]
> org.apache.coyote.http11.Http11InputBuffer.parseRequestLine
> Received [PUT /manager/text/deploy?path=xxx&war=&update=true
> HTTP/1.1
> 
> 2. Target-Tomcat's logging identifies the upload-user in this
> line: 02-Feb-2020 16:57:06.433 FINE [http-nio-80-exec-5]
> org.apache.catalina.realm.RealmBase.findSecurityConstraints
> Checking constraint 'SecurityConstraint[Text Manager interface (for
> scripts)]' against PUT /text/deploy --> true
> 
> 3. The user is authenticated in this log-line: 02-Feb-2020
> 16:57:06.446 FINE [http-nio-80-exec-5]
> org.apache.catalina.realm.CombinedRealm.authenticate Authenticated
> user [XXX] with realm
> [org.apache.catalina.realm.UserDatabaseRealm]
> 
> 4. Tomcat is starting deployment: 02-Feb-2020 16:57:06.466 INFO
> [http-nio-80-exec-5]
> org.apache.catalina.core.ApplicationContext.log Manager: deploy:
> Deploying web application 'XXX'
> 
> 5. Tomcat points out the deployment command: 02-Feb-2020
> 16:57:06.610 FINE [http-nio-80-exec-6]
> org.apache.coyote.http11.Http11InputBuffer.parseRequestLine
> Received [PUT /manager/text/deploy?path=XXX&war=&update=true
> HTTP/1.1
> 
> 6. Tomcat show the deployment-request size of ~71 MB 
> Content-Length: 74784695
> 
> 
> 
> Then the socket is closed: 02-Feb-2020 16:57:06.603 FINE
> [http-nio-80-exec-5] org.apache.tomcat.util.net.NioEndpoint.close
> Socket:
> [org.apache.tomcat.util.net.NioChannel@33ae9b28:java.nio.channels.Sock
etChannel[closed]]
> closed
> 
> 7. Access log shows the PUT command (AGAIN!!!): 02-Feb-2020
> 16:57:06.610 FINE [http-nio-80-exec-6]
> org.apache.coyote.http11.Http11InputBuffer.parseRequestLine
> Received [PUT /manager/text/deploy?path=xxx&war=&update=true
> HTTP/1.1
> 
> Please notice the two deployment threads: -6 and -5
> 
> Any ideas?

Does it ever work?

The Tomcat manager has a default limit of 50MiB for uploads. Your WAR
file it larger than that, so it might be failing.

The /second/ upload in your log file might be because the deployer
re-tries when the first attempt fails. It's so fast because Tomcat
rejects the request immediately after looking at the Content-Length,
instead of allowing 71MiB of stream over the network before rejecting
the request.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl44J6IACgkQHPApP6U8
pFjCUw//fQkfVwy/og6LgF2xSiQGkZ5WBf4wXZ7M7GzHHRG+EV5bhhIZllGK4T9K
xMtoO8O2iGiHOaJh4BzVPVf8d53C3tT2ZRyybDX9n1fiG55vMt39Up+7ZcaHow7r
ttH5p1HIgdMOwHGZotCRp63zVFLJogwctVFtFwihj2oA6cSj+T2hFgQepLxuBx9B
C/hcGgT+KY2GM7zcjSexFMCjEAToftaW2fwDAz8Ngpd3Mvzrr4LLr3IHfh0Mui1Z
RF4o47Mq5uThWUogUasNiJdTab+m/xR9dZdAoDPu3IvfkzN1uKIiYwgZ4X1AXAK/
4cdZgpwYCkfQmqYNLzSKQpKJuWwHl/M4TT6+goR7uplA78fvOGNG/CoNvWloXVyn
SvHp++71Yiy3Alel9RNItdy77e03HGEJaYVNvwgv49RyrmcQFjBDC4l6WWVXv92y
HEzP8pRX/WwTLa5JVIn3y4wLRbksv3PmjPiVUWUW0By9nHScE63RRLIUaySHGKgV
I8uWmgGb/KPGhJap5s+s9A0ZzrmOenQCpsE4AFuFKarL7a+1Z2QZSn2ZnOf6MXag
IFkf5Tk322Hz8PAMWxPIKqa36hx9gltYs3ezmKDs6JDHFWcCiST1JM+eU+rRCZhQ
fqSgRzbhIxXEYjVL91wXAMSb/4R8LsPiD0q2tisWKLRbRaunx90=
=xZTo
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to