web-dev-qa-db-fra.com

mvn Tomcat7: deploy - Impossible d'appeler le gestionnaire Tomcat: canal rompu

Je reçois une erreur en essayant de déployer le fichier CLIFF .war sur mon serveur Tomcat7 .  enter image description here

 enter image description here

[ERREUR] Impossible d'exécuter le but org.Apache.Tomcat.maven: Tomcat7-maven-plugin: 2.1: deploy (default-cli) sur la falaise du projet: Impossible d'appeler le gestionnaire Tomcat: Connexion à http: // localhost: 8080 refusé: connexion refusée

OS X 10.10.5 Apache Tomcat/8.0.24 JVM 1.8.0_05-b13

David-Laxers-MacBook-Pro:CLIFF davidlaxer$ mvn -version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)
Maven home: /Users/davidlaxer/Downloads/Apache-maven-3.2.1
Java version: 1.8.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", Arch: "x86_64", family: "mac"
David-Laxers-MacBook-Pro:CLIFF davidlaxer$ 


David-Laxers-MacBook-Pro:CLIFF davidlaxer$ Sudo mvn Tomcat7:deploy -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] CLIFF
[INFO] common
[INFO] stanford-entity-extractor
[INFO] cliff
[INFO] 
[INFO] Using the builder org.Apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building CLIFF 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> Tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF >>>
[INFO] 
[INFO] <<< Tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF <<<
[INFO] 
[INFO] --- Tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building common 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> Tomcat7-maven-plugin:2.1:deploy (default-cli) @ common >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/common/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ common ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/common/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ common ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ common ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ common ---
[INFO] 
[INFO] <<< Tomcat7-maven-plugin:2.1:deploy (default-cli) @ common <<<
[INFO] 
[INFO] --- Tomcat7-maven-plugin:2.1:deploy (default-cli) @ common ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building stanford-entity-extractor 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> Tomcat7-maven-plugin:2.1:deploy (default-cli) @ stanford-entity-extractor >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ stanford-entity-extractor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 14 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ stanford-entity-extractor ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ stanford-entity-extractor ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 23 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ stanford-entity-extractor ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ stanford-entity-extractor ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ stanford-entity-extractor ---
[INFO] 
[INFO] <<< Tomcat7-maven-plugin:2.1:deploy (default-cli) @ stanford-entity-extractor <<<
[INFO] 
[INFO] --- Tomcat7-maven-plugin:2.1:deploy (default-cli) @ stanford-entity-extractor ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cliff 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> Tomcat7-maven-plugin:2.1:deploy (default-cli) @ cliff >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ cliff ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 12 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ cliff ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ cliff ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/webapp/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ cliff ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ cliff ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.2:war (default-war) @ cliff ---
[INFO] Packaging webapp
[INFO] Assembling webapp [cliff] in [/Users/davidlaxer/CLIFF/webapp/target/cliff-2.3.0]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/davidlaxer/CLIFF/webapp/src/main/webapp]
[INFO] Webapp assembled in [1345 msecs]
[INFO] Building war: /Users/davidlaxer/CLIFF/webapp/target/cliff-2.3.0.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] 
[INFO] <<< Tomcat7-maven-plugin:2.1:deploy (default-cli) @ cliff <<<
[INFO] 
[INFO] --- Tomcat7-maven-plugin:2.1:deploy (default-cli) @ cliff ---
[INFO] Deploying war to http://localhost:8080/cliff-2.3.0  
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] CLIFF ............................................. SUCCESS [  1.728 s]
[INFO] common ............................................ SUCCESS [  1.883 s]
[INFO] stanford-entity-extractor ......................... SUCCESS [  0.265 s]
[INFO] cliff ............................................. FAILURE [ 11.384 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.717 s
[INFO] Finished at: 2015-08-26T08:07:32-08:00
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.Apache.Tomcat.maven:Tomcat7-maven-plugin:2.1:deploy (default-cli) on project cliff: Cannot invoke Tomcat manager: Connection to http://localhost:8080 refused: Connection refused -> [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] http://cwiki.Apache.org/confluence/display/MAVEN/ConnectException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cliff

pom.xml:

               <plugin>
                        <groupId>org.Apache.Tomcat.maven</groupId>
                        <artifactId>Tomcat7-maven-plugin</artifactId>
                        <version>2.1</version>
                        <configuration>
                                <server>CliffTomcatServer</server>
                                <path>/${project.build.finalName}</path>
                        </configuration>
                </plugin>

~/.m2/settings.xml:

   <server>
      <id>CliffTomcatServer</id>
      <username>cliff</username>
      <password>beer</password>
    </server>

/usr/local/Apache-Tomcat-8.0.24/conftomcat_users.xml:

<Tomcat-users>
<role rolename="manager"/>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <user username="cliff" password="beer" roles="manager,manager-gui,manager-script"/>

Ajouté à pom.xlm: http: // localhost: 8080/manager/text

[INFO] Deploying war to http://localhost:8080/cliff-2.3.0  
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2052/127150 KB   
[INFO] I/O exception (Java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2356/127150 KB   
[INFO] I/O exception (Java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2052/127150 KB   
[INFO] I/O exception (Java.net.SocketException) caught when processing request: Broken pipe
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fcliff-2.3.0
2156/127150 KB   
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] CLIFF ............................................. SUCCESS [  1.523 s]
[INFO] common ............................................ SUCCESS [  1.718 s]
[INFO] stanford-entity-extractor ......................... SUCCESS [  0.359 s]
[INFO] cliff ............................................. FAILURE [ 12.664 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.735 s
[INFO] Finished at: 2015-08-26T11:04:23-08:00
[INFO] Final Memory: 12M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.Apache.Tomcat.maven:Tomcat7-maven-plugin:2.1:deploy (default-cli) on project cliff: Cannot invoke Tomcat manager: Broken pipe -> [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] http://cwiki.Apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cliff
David-Laxers-MacBook-Pro:CLIFF davidlaxer$ 
12
dbl001

Le rôle de déploiement sur/manager/text est "manager-script" et le Guide de procédures du gestionnaire Apache Tomcat indique qu'il ne doit pas être appliqué à un utilisateur doté du rôle manager-gui. J'utilise un utilisateur de déploiement avec uniquement le rôle manager-script et aucun autre, et qui télécharge le fichier WAR sans le message de canal cassé. Si j'ajoute le rôle manager-gui à mon utilisateur de déploiement, je reçois le message de pipe cassé que vous rencontrez. Essayez de changer votre Tomcat-users.xml pour limiter le rôle de Cliff à un seul rôle de script de gestionnaire. J'espère que ça aide.

http://Tomcat.Apache.org/Tomcat-7.0-doc/manager-howto.html

11
Mark Hattrup

Lorsque je configure le fichier ~/.m2/settings.xml, cela ne fonctionne pas. Je me suis donc mis dans le pom.xml, comme ceci:

<plugin>
    <groupId>org.Apache.Tomcat.maven</groupId>
    <artifactId>Tomcat7-maven-plugin</artifactId>
    <version>${Tomcat7-maven-plugin.version}</version>
    <configuration>
        <url>http://localhost:8080/manager/text</url>
        <server>Tomcat</server>
        <username>admin1</username>
        <password>admin1</password>
        <path>/${project.artifactId}</path>
        <update>true</update>
     </configuration>
</plugin>

Et dans le fichier $ CATALINA_HOME/conf/Tomcat-users.xml, dans l'élément <Tomcat-users>, ajoutez ce qui suit:

<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user username="admin" password="admin" roles="manager-gui"/>
<user username="admin1" password="admin1" roles="manager-script"/>

Alors ça marche pour moi. :)

8
Goroyal

Vous devrez peut-être ajouter ceci 

<configuration>
   ..
   <update>true</update>
   ..
</configuration>

dans votre fichier pom.xml à exécuter 

mvn Tomcat7:deploy
2
mceviker

J'ai eu cette erreur en exécutant mvn Tomcat7:deploy au lieu de mvn Tomcat7:redeploy.

1
Jofsey

Si vous utilisez CentOS, vous devrez peut-être installer des bibliothèques de gestion supplémentaires:

yum install Tomcat-webapps Tomcat-admin-webapps

Sur d'autres plateformes, la solution peut être similaire.

1
fresheed

si vous avez déjà la même application déployée sur le serveur Tomcat, vous devez d'abord annuler son déploiement. Si vous le déployez à nouveau, cela peut entraîner une erreur de connexion.

0
AllanXing

Je n'ai pas été en mesure d'utiliser le raccourci de redéploiement de MVN depuis que j'ai fusionné le code qui le scindait en quelques modules MVN. Je recommande de copier le fichier .war de webapp/target dans le répertoire Tomcat webapps sur votre ordinateur/serveur.

0
rbot

Peut-être devriez-vous vérifier le fichier webapps/manager/WEB-INF/web.xml pour vous assurer que votre fichier .war est inférieur à la valeur configurée.

  <max-file-size>152428800</max-file-size>
  <max-request-size>152428800</max-request-size>

Voir cette question: Echec de l'installation de Tomcat dans IBM MobileFirst Platform 6.3 Operational Analytics

0
Muxiang Yang