Answer the question
In order to leave comments, you need to log in
Why can't deploy war file on Tomcat 8 via Maven?
There is a JSF project. You need to run it on the Tomcat 8 server. I
wrote POM:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>alexiuscrow</groupId>
<artifactId>LabJSF</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>LabJSF</name>
<dependencies>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>2.2.6</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>JavaSource</sourceDirectory>
<finalName>LabJSF</finalName>
<resources>
<resource>
<directory>JavaSource</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>TomcatServer</server>
<path>/jsflearning</path>
</configuration>
</plugin>
</plugins>
</build>
</project>
<?xml version='1.0' encoding='cp1251'?>
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<role rolename="manager-script"/>
<role rolename="manager"/>
<user username="admin" password="password" roles="manager-gui,admin-gui,mmanager-script,manager" />
</tomcat-users>
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<servers>
<server>
<id>TomcatServer</id>
<username>admin</username>
<password>password</password>
</server>
</servers>
...
</settings>
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ----- -------------------------------------------------- -----------------
[INFO] Building LabJSF 0.0.1-SNAPSHOT
[INFO] -------------------- -------------------------------------------------- --
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:deploy (default-cli) @ LabJSF >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default -resources)@LabJSF---
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, ie build is platform dependent!
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ LabJSF ---
[INFO] Nothing to compile - all classes are up to date
[ INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ LabJSF ---
[WARNING] Using platform encoding (Cp1251 actually) to copy filtered resources, ie build is platform dependent!
[INFO] skip non existing resourceDirectory D:\alexiuscrow\workspace\LabJSF\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ LabJSF -- -
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ LabJSF ---
[INFO]
[INFO] - -- maven-war-plugin:2.4:war (default-war) @ LabJSF ---
[INFO] Packaging webapp
[INFO] Assembling webapp [LabJSF] in [D:\alexiuscrow\workspace\LabJSF\target\LabJSF]
[ INFO] Processing war project
[INFO] Copying webapp resources [D:\alexiuscrow\workspace\LabJSF\WebContent]
[INFO] Webapp assembled in [1995 msecs]
[INFO] Building war: D:\alexiuscrow\workspace\LabJSF\target\ LabJSF.war
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:deploy (default-cli) @ LabJSF <<<
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:deploy (default-cli) @ LabJSF ---
[INFO] Deploying war to localhost:8080/jsflearning Uploading
: localhost:8080/manager/text/deploy?path= %2Fjsflearning
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request Uploading
: localhost:8080/manager/text/deploy?path=%2Fjsflearning
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request Uploading
: localhost:8080/manager/text/deploy?path=%2Fjsflearning
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request Uploading
: localhost:8080/manager/text/deploy?path=%2Fjsflearning
[INFO] ]------------------------------------------------ -----------------------
[INFO] BUILD FAILURE
[INFO] ------------------- -------------------------------------------------- ---
[INFO] Total time: 31.470 s
[INFO] Finished at: 2014-12-21T11:38:47+02:00
[INFO] Final Memory: 10M/24M
[INFO] -------- -------------------------------------------------- -------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project LabJSF: Cannot invoke Tomcat manager: Connection reset by peer: socket write error -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] cwiki.apache.org/confluence/display/MAVEN/MojoExec...
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<localRepository>D:\alexiuscrow\mvn-repo</localRepository>
...
</settings>
Answer the question
In order to leave comments, you need to log in
Problem solved.
An error was made in the %TOMCAT7_PATH%/conf/tomcat-users.xml file in the line
...
<user username="admin" password="password" roles="manager-gui,admin-gui,mmanager-script,manager" />
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question