I have a problem when deploying my web application to tomcat manager using maven-tomcat7-plugin. The problem appears to have something to do with the transfer but is not triggered until the transfer is done. The transfere returns an ok status but the transferred file is 0kb and should be about 50Mb.
If I manually place the war file in the webapps folder it is automatically launched. However if I use the manager gui or the plugin I get this error.
INFO: Manager: Uploading WAR file to C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\spa-test.war.tmp
jan 13, 2016 9:52:13 FM org.apache.catalina.core.ApplicationContext log
SEVERE: Manager: managerServlet.check[/spa-test]
java.lang.IllegalArgumentException: Header message of length [65,532] received but the packetSize is only [8,192]
at org.apache.coyote.ajp.AjpProcessor.readMessage(AjpProcessor.java:383)
at org.apache.coyote.ajp.AjpProcessor.receive(AjpProcessor.java:334)
at org.apache.coyote.ajp.AbstractAjpProcessor$SocketInputBuffer.doRead(AbstractAjpProcessor.java:1188)
at org.apache.coyote.Request.doRead(Request.java:438)
at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:290)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:449)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:315)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:167)
at org.apache.catalina.manager.ManagerServlet.uploadWar(ManagerServlet.java:1609)
at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:723)
at org.apache.catalina.manager.ManagerServlet.doPut(ManagerServlet.java:456)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:653)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:190)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Any ideas what to do about this?
This is what my stderr log says:
13-Jan-2016 09:50:49.901 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\manager has finished in 47 ms
13-Jan-2016 09:50:49.901 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-bio-8080"]
13-Jan-2016 09:50:49.948 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-bio-8009"]
13-Jan-2016 09:50:49.948 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 37024 ms
13-Jan-2016 09:52:13.949 SEVERE [ajp-bio-8009-exec-1] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 65530
This is what my access log says:
10.23.73.76 - userName [13/Jan/2016:10:33:13 +0100] "POST /manager/html/upload?org.apache.catalina.filters.CSRF_NONCE=<EditedOut> HTTP/1.1" 500 3840
Here is my server config file:
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
If you need more info about configuration please ask.
Thank you!
The problem was that I'm using tomcat_iis_connector isapimodule to connect the tomcatmanager behind IIS. This manager was configured to use a packet size of 65536. Thus I had to change my tomcat server configuration for the AJP connector like so.
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" packetSize="65536"/>
This sets the max accepted packet size to the same as the iis connectors instead of the default of 8MB. Here is a referance to the tomcat docs for packet size.
This attribute sets the maximum AJP packet size in Bytes. The maximum value is 65536. It should be the same as the max_packet_size directive configured for mod_jk. Normally it is not necessary to change the maximum packet size. Problems with the default value have been reported when sending certificates or certificate chains. The default value is 8192.