【问题标题】:Tomcat return http status error: 401, Reason Phrase: Unauthorized [duplicate]Tomcat返回http状态错误:401,原因短语:未经授权[重复]
【发布时间】:2018-09-09 15:27:17
【问题描述】:

我将 Intellij IDEA 与 Tomcat 和 Maven 一起使用。当我运行重新部署时,我收到以下错误。我如何解决它?我试着查了一下,似乎没有一个答案适合。

[ERROR] Tomcat return http status error: 401, Reason Phrase: Unauthorized
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.498 s
[INFO] Finished at: 2018-09-09T11:23:27-04:00
[INFO] Final Memory: 15M/50M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:redeploy (default-cli) on project SimpleWeb: Tomcat return http status error: 401, Reason Phrase: Unauthorized: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
[ERROR] <HTML><HEAD>
[ERROR] <TITLE>401 Unauthorized</TITLE>
[ERROR] </HEAD><BODY><H1>Unauthorized</H1>
[ERROR] </BODY></HTML>
[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

【问题讨论】:

    标签: java maven tomcat jakarta-ee intellij-idea


    【解决方案1】:

    尝试在你的 maven 的 .m2/settings.xml 或 conf/senttings.xml 中定义你的 tomcat 的凭据

    <server>
            <id>TomcatSever</id>
            <username>admin</username>
            <password>admin</password> 
    </server>
    

    【讨论】:

      猜你喜欢
      • 2018-10-21
      • 2020-08-12
      • 1970-01-01
      • 2020-02-26
      • 2014-06-24
      • 2014-02-26
      • 1970-01-01
      • 2017-12-20
      • 2012-05-30
      相关资源
      最近更新 更多