wildfly-maven-plugin deployment over SSL works once then "connection error" - wildfly

I'm getting a weird behavior after securing Wildfly Admin console to use HTTPS, and configuring my pom.xml to deploy over https. (I tried on versions 8.2.1 and 10.1.0, standalone mode).
I can only (re)deploy once successfully. After that, I get the error below, and I have to restart the server to (re)deploy again:
Change in pom.xml:
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.2.Final</version>
<configuration>
<protocol>https-remoting</protocol>
<port>9993</port>
</configuration>
</plugin>
In my standalone-full-ha.xml, I added the server-identities and edited the socket-binding
<management>
<security-realms>
<security-realm name="ManagementRealm">
<server-identities>
<ssl>
<keystore path="server-keystore.jks" relative-to="jboss.server.config.dir" keystore-password="mypassword"/>
</ssl>
</server-identities>
...
<management-interfaces>
<http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
<socket-binding http="management-http" https="management-https"/>
</http-interface>
</management-interfaces>
I added the truststore, prior to executing mvn:
> set MAVEN_OPTS=-Djavax.net.ssl.trustStore=C:/pathto/client-truststore -Djavax.net.ssl.trustStorePassword=mypassword
The connection is timing out on succeeding executions. Here's the error:
> mvn wildfly:deploy -e (OR mvn wildfly:redeploy -e)
[INFO] BUILD FAILURE
...
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:redeploy (default-cli) on project xyz-project-web: Could not execute goal redeploy on C:\projects\abc\xyz-project\trunk\xyz-project-web\target\xyz-project-web-0-SNAPSHOT.war. Reason: I/O Error could not execute operation '{
[ERROR] "operation" => "read-attribute",
[ERROR] "address" => [],
[ERROR] "name" => "launch-type"
[ERROR] }': java.net.ConnectException: JBAS012144: Could not connect to https-remoting://172.31.100.26:9993.
The connection timed out
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.2.Final:redeploy (default-cli)
on project xyz-project-web: Could not execute goal redeploy on C:\projects\abc\xyz-project\trunk\xyz-project-web\target\xyz-project-web-0-SNAPSHOT.war. Reason: I/O
Error could not execute operation '{
"operation" => "read-attribute",
"address" => [],
"name" => "launch-type"
}'
...
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not execute goal redeploy on C:\projects\abc\xyz-project\trunk\xyz-project-web\target\
test-project-web-0-SNAPSHOT.war. Reason: I/O Error could not execute operation '{
"operation" => "read-attribute",
"address" => [],
"name" => "launch-type"
}'
...
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: java.lang.IllegalStateException: I/O Error could not execute operation '{
"operation" => "read-attribute",
"address" => [],
"name" => "launch-type"
}'
...
at org.wildfly.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:136)
... 24 more
Caused by: java.io.IOException: java.net.ConnectException: JBAS012144: Could not connect to https-remoting://172.31.100.26:9993. The connection timed out
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129)
... 28 more
Caused by: java.net.ConnectException: JBAS012144: Could not connect to https-remoting://172.31.100.26:9993. The connection timed out
at org.jboss.as.protocol.ProtocolConnectionUtils.connectSync(ProtocolConnectionUtils.java:119)
...
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
... 30 more
I can't find anything relevant changing after the first execution.

It looks like a bug in the older version. I upgraded to wildfly-maven-plugin 1.2.1.Final, and it works fine now.

Related

Java EE WFLYCTL0412 Required services that are not installed

Hi im trying to deploy a javaEE application in my wildfly server and when i try to run my server it throws me an exception about services that are not installed this happened any ideas what can be in conflict? Here is the output:
Deploying C:\wildfly-26.1.0.Final\standalone\deployments\ProyectoServidor.ear
{
"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"ProyectoServidor.ear\".\"ProyectoEJB-ejb.jar\".POST_MODULE" => "WFLYSRV0153: Failed to process phase POST_MODULE of subdeployment \"ProyectoEJB-ejb.jar\" of deployment \"ProyectoServidor.ear\"
Caused by: java.lang.RuntimeException: WFLYSRV0177: Error getting reflective information for class com.fannog.proyectoservidor.utils.Encryptor with ClassLoader ModuleClassLoader for Module \"deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar\" from Service Module Loader
Caused by: java.lang.NoClassDefFoundError: org/jasypt/util/password/StrongPasswordEncryptor
Caused by: java.lang.ClassNotFoundException: org.jasypt.util.password.StrongPasswordEncryptor from [Module \"deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar\" from Service Module Loader]"},
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.deployment.unit.\"ProyectoServidor.ear\".WeldStartService",
"jboss.deployment.unit.\"ProyectoServidor.ear\".beanmanager"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"ProyectoServidor.ear\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"ProyectoServidor.ear\".beanmanager, jboss.deployment.unit.\"ProyectoServidor.ear\".WeldStartService]"]
}
C:\Users\facun\git\servidor\nbproject\build-impl.xml:330: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 6 seconds)
Your ejb is using org.jasypt.util.password.StrongPasswordEncryptor which is not provided in your application thus you are getting a ClassNotFoundException:
java.lang.ClassNotFoundException: org.jasypt.util.password.StrongPasswordEncryptor from [Module "deployment.ProyectoServidor.ear.ProyectoEJB-ejb.jar" from Service Module Loader]"},

Debugging JHipster application throws: java.lang.ClassNotFoundException: org.h2.server.web.WebServlet

I've generated an application using JHipster 7.0.0. It has "monolith" as applicationType, "postgressql" as prodDatabaseType and "h2Disk" as devDatabaseType.
When I run command line "./mwnw", the applications launches perfectly.
The problem comes when I try to debug the application in the VSCode IDE following these instructions:https://www.jhipster.tech/development/. I right-click the file of Application class (the one with #SpringBootApplication annotation), click "Debug Java" menu, and during the launch I get this exception:
2021-04-02 18:51:36.143 DEBUG 46054 --- [ main] br.gov.mypackage.config.WebConfigurer : Initialize H2 console
2021-04-02 18:51:36.145 WARN 46054 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Failed to load and initialize org.h2.server.web.WebServlet
2021-04-02 18:51:36.251 ERROR 46054 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is java.lang.RuntimeException: java.lang.RuntimeException: Failed to load and initialize org.h2.server.web.WebServlet
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:577)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:769)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
at br.gov.ancine.JhipsterLearnApp.main(JhipsterLearnApp.java:69)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Failed to load and initialize org.h2.server.web.WebServlet
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:257)
at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.createManager(UndertowServletWebServerFactory.java:345)
at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory.getWebServer(UndertowServletWebServerFactory.java:314)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:181)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:159)
... 7 common frames omitted
Caused by: java.lang.RuntimeException: Failed to load and initialize org.h2.server.web.WebServlet
at tech.jhipster.config.h2.H2ConfigurationHelper.initH2Console(H2ConfigurationHelper.java:128)
at br.gov.ancine.config.WebConfigurer.initH2Console(WebConfigurer.java:119)
at br.gov.ancine.config.WebConfigurer.onStartup(WebConfigurer.java:52)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:234)
at org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory$Initializer.onStartup(UndertowServletWebServerFactory.java:504)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:204)
at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:187)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:255)
... 11 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.h2.server.web.WebServlet
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at tech.jhipster.config.h2.H2ConfigurationHelper.initH2Console(H2ConfigurationHelper.java:119)
... 20 common frames omitted
It looks like if VSCode doesn't include the h2database in the classpath.
It might not be the perfect solution, but it should at least get you started.
In your pom.xml file, in the dependencies section, change h2 scope, from test to compile.
<dependencies>
...
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>compile</scope>
</dependency>
....
<!-- jhipster-needle-maven-add-dependency -->
</dependencies>
Launch your debug session from VSCode and the previously missing h2 classes should be there (if you comment out the call to H2ConfigurationHelper.initH2Console you will see that some other h2 classes are missing).
If you set scope back to test, it keeps running fine within VSCode.
Here is the answer:
run at the root application folder:
mvn spring-boot:run -D"spring-boot.run.jvmArguments"="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"
https://stackoverflow.com/a/68069089/1184154
run at vscode launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"mainClass": "",
"args": ""
},
{
"type": "java",
"name": "Debug (Attach)",
"request": "attach",
"hostName": "localhost",
"port": 8000
}
]
}
https://stackoverflow.com/a/46841712/1184154

How to fix error 'Failed to initialize connector [Connector[HTTP/1.1-443]]' when starting tomcat

I'm trying to deploy my java backstage on a remote tomcat server (8.5.39). In order to use https, I changed these lines on /conf/server.xml
<Connector port="80" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="443" />
<Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" keystoreFile="xxx" keystorePass="xxx">
</Connector>
<Connector port="8009" protocol="AJP/1.3" redirectPort="443" />
I can run the tomcat on remote server and I can access it by domain name(https). But when I use eclipse to run java code on remote server, it comes with error like
SEVERE: Failed to initialize connector [Connector[HTTP/1.1-443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-443]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:112)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:552)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:875)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
at org.apache.catalina.startup.Catalina.load(Catalina.java:639)
at org.apache.catalina.startup.Catalina.load(Catalina.java:662)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:309)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:995)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107)
... 12 more
Caused by: java.lang.IllegalArgumentException: C:\Users\Administrator\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\cert\server.jks (No such file or directory)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:100)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:72)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:244)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1105)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.init(AbstractJsseEndpoint.java:224)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581)
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:68)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:993)
... 13 more
Caused by: java.io.FileNotFoundException: C:\Users\Administrator\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\cert\server.jks (No such file or directory)
at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:213)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:155)
at java.base/java.io.FileInputStream.<init>(FileInputStream.java:110)
at java.base/sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:86)
at java.base/sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:184)
at org.apache.tomcat.util.file.ConfigFileLoader.getInputStream(ConfigFileLoader.java:89)
at org.apache.tomcat.util.net.SSLUtilBase.getStore(SSLUtilBase.java:190)
at org.apache.tomcat.util.net.SSLHostConfigCertificate.getCertificateKeystore(SSLHostConfigCertificate.java:206)
at org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers(SSLUtilBase.java:272)
at org.apache.tomcat.util.net.SSLUtilBase.createSSLContext(SSLUtilBase.java:239)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:98)
... 20 more
Someone told me to stop tomcat on remote server and run the code. I tried but it doesn't work.
Your most deep exception cause is:
Caused by: java.io.FileNotFoundException: C:\Users\Administrator\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\cert\server.jks (No such file or directory)
Which is trying to find certificate to start service with SSL enabled.
In order to do that you'll have to either provide certificate file for SSL or remove https enpoint to start without any encription

Deployment issue of spring with JAX-WS WAR in JBOSS

I am using Spring, Maven and creating a web service in eclipse. While deploying the WAR in JBOSS I am getting following error-
Internal Server Error
{
"outcome" => "failed",
"failure-description" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"NextGen-web1.war\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"NextGen-web1.war\".INSTALL: JBAS018733: Failed to process phase INSTALL of deployment \"NextGen-web1.war\"
Caused by: javax.xml.ws.WebServiceException: java.lang.reflect.UndeclaredThrowableException
Caused by: java.lang.reflect.UndeclaredThrowableException
Caused by: java.lang.NoSuchMethodException: org.objectweb.asm.MethodWriter.visitLabel(org.objectweb.asm.Label)"}},
"rolled-back" => true
}
you must include this library in your pom.xml:
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.3.1.redhat-9</version>
</dependency>

Failed to execute goal tomcat:deploy Error writing to server

I'm trying to test a spring-mvc tutorial here.
I would like to deploy the generated war on tomcat 7 using eclipse-maven.
The war works fine when deployed manually on tomcat.
Steps to follow :
import project on eclipse
add this plugin to the existing POM:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<mode>war</mode>
<url>http://localhost:8080/manager/html/</url>
<server>TomcatServer</server>
<path>/springexample</path>
</configuration>
configure a new tomcat server in eclipse with the name TomcatServer
modify the tomcat-users.xml file:
include an admin user:
<tomcat-users>
<role rolename="admin"/>
<role rolename="standard"/>
<role rolename="manager-gui"/>
<role rolename="manager"/>
<role rolename="tomcat"/>
<role rolename="manager-script"/>
<user password="password" roles="standard,manager,admin,manager-gui,manager-script,tomcat" username="admin"/>
</tomcat-users>
Add the server configuration to the setting.xml config file under .m2
user folder:
TomcatServer
admin
password
Strat tomcat server
When I execute the following goals :
Maven generate-sources : to generate the war file
then Run configuration --> with the goal :
tomcat:deploy
the error is :
[
ERROR] Failed to execute goal
org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on
project springexample: 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 springexample: Cannot invoke Tomcat manager
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
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:101)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more Caused by: java.io.IOException: Error writing to server
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source) 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)
... 22 more [ERROR] [ERROR] [ERROR] For more information about the
errors and possible solutions, please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
In my case, using the tomcat7 command for deployment worked :
tomcat7:deploy
And you should not use :
tomcat:deploy
My issue was related to the fact the WAR file was over 50mb. You need to set the config in web.xml from the tomcat manager.
The file will normally be in %tomcat installation%\webapps\manager\WEB-INF\web.xml
<multipart-config>
<!-- 50MB max -->
<max-file-size>52428800</max-file-size>
<max-request-size>52428800</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>
You should focus your effors on
Caused by: java.io.IOException: Error writing to server
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:604)
Look at the source for TomcatManager (http://mojo.codehaus.org/tomcat-maven-plugin/xref/org/codehaus/mojo/tomcat/TomcatManager.html#672)
The maven plugin cannot read from the server. It connects, line 597, it writes the data, line 601, but fails when it reads the response, line 604
I would try to deploy at the server first (to get rid of network problems) and see if the problem persists.