在Eclipse下run maven tomcat7:deploy出現connection reset by peer錯誤

qq_28260427 2017-11-15 04:01:34
我在Eclipse里建立一個Maven Project, Project Facets是 Dynamic Web Module是3.1, Java是1.8。然後我嘗試run maven tomcat7:deploy的時候出現以下錯誤


[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven.ssm.bike Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) > package @ bike >>>
[WARNING] The POM for commons-io:commons-io:jar:2.4 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] The artifact org.hibernate:hibernate-validator:jar:6.0.2.Final has been relocated to org.hibernate.validator:hibernate-validator:jar:6.0.2.Final
[WARNING] The artifact ant:ant:jar:1.7.0 has been relocated to org.apache.ant:ant:jar:1.7.0
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ bike ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 8 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ bike ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ bike ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ bike ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ bike ---
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ bike ---
[INFO] Packaging webapp
[INFO] Assembling webapp [bike] in [F:\project\java web\homework\bike\target\bike]
[INFO] Processing war project
[INFO] Copying webapp resources [F:\project\java web\homework\bike\src\main\webapp]
[INFO] Webapp assembled in [713 msecs]
[INFO] Building war: F:\project\java web\homework\bike\target\bike.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) < package @ bike <<<
[INFO]
[INFO]
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ bike ---
[INFO] Deploying war to http://localhost:8080/bike
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fbike&update=true

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fbike&update=true

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fbike&update=true

[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: http://localhost:8080/manager/text/deploy?path=%2Fbike&update=true

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.574 s
[INFO] Finished at: 2017-11-15T15:52:29+08:00
[INFO] Final Memory: 17M/256M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy (default-cli) on project bike: 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] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
...全文
295 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
kampoo 2017-11-17
  • 打赏
  • 举报
回复
对于采用 http://localhost:8080/manager/ 来部署war包的情况,应该配置用户名和口令,并跟<tomcat>/conf/tomcat-users.xml中保持一致。注意tomcat-users.xml中的角色应当包括manager:
<user username='admin' password='...' roles='tomcat,manager'/>
在maven的pom.xml类似于:
<build><plugins>
<plugin>
  <groupId>...</groupId>
  <artificialId>...</artificialId>
  <version>...</version>
  <!-- 请查阅相应手册 确认phase和goal -->
  <phase>deploy</phase>
  <goals><goal>deploy</goal></goals>
  <configuration>
    <!-- 具体是不是这个请查阅maven-plugin手册 -->
    <tomcat-user>...</tomcat-user>
  </configuration>
</plugin>
</plugins></build>
繁华终归落尽 2017-11-15
  • 打赏
  • 举报
回复
pom加上service-api试试
<dependency>
		    <groupId>javax.servlet</groupId>
		    <artifactId>servlet-api</artifactId>
		    <version>2.5</version>
		</dependency>

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧