Tomcat-Maven 401错误:无法调用Tomcat管理器 [英] Tomcat-Maven 401 Error: Cannot invoke Tomcat manager

查看:114
本文介绍了Tomcat-Maven 401错误:无法调用Tomcat管理器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

经历了StackOverFlow中显示的大多数错误,但仍然无法解决.我正在尝试部署SpringMVC应用程序.但是,我只是无法正常工作.

Went through most of the errors shown in StackOverFlow and still couldn't solve it. I'm trying to deploy a SpringMVC application. But, I just can't get it to work.

Maven部署错误:

Maven Deploy Error:

[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:redeploy (default-cli) on project productmgmt: Cannot invoke Tomcat manager: Server returned HTTP response code: 401 for URL: http://localhost:8080/manager/text/deploy?path=%2Fproductmgmt&war=&update=true -> [Help 1]

Pom.xml:

<build>
        <finalName>productmgmt</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>tomcat-maven-plugin</artifactId>
                <configuration>
                    <url>http://localhost:8080/manager/text</url>
                    <path>/productmgmt</path>
                    <username>admin</username>
                    <password>password</password>
                </configuration>
            </plugin>
        </plugins>
    </build>

Tomcat-Users.xml

Tomcat-Users.xml

<role rolename="admin"/>
  <role rolename="manager"/>
  <user username="admin" password="admin" roles="admin,manager"/>
</tomcat-users>

更多信息:

[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

这对我有用

<role rolename="manager-script"/>
<role rolename="admin-script"/>
<user password="password" roles="manager-script,admin-script" username="admin"/>
</tomcat-users>

推荐答案

您的Maven配置将用户名和密码设置为admin/password.在Tomcat配置中,它们设置为admin/admin.

Your maven configuration has the username and password set as admin/password. In the Tomcat configuration they are set as admin/admin.

将您的pom.xml切换为具有<password>admin</password>.

此外,根据 Tomcat文档.您将希望 manager-gui 角色访问HTML管理器,并希望 manager-script 角色访问文本界面.

Also, the roles need changing for the admin user as per the Tomcat docs. You'll want the manager-gui role to access the HTML manager and the manager-script role to access the text interface.

这篇关于Tomcat-Maven 401错误:无法调用Tomcat管理器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆