在 NetbeansIDE 6.0 中运行 jsp 时出现部署错误

发布于 2024-11-07 10:09:17 字数 3168 浏览 0 评论 0原文

Deployment error:
Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager.
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: java.lang.IllegalStateException: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager.
        at org.netbeans.modules.tomcat5.TomcatManagerImpl.list(TomcatManagerImpl.java:390)
        at org.netbeans.modules.tomcat5.TomcatManager.modules(TomcatManager.java:623)
        at org.netbeans.modules.tomcat5.TomcatManager.getAvailableModules(TomcatManager.java:434)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.getAvailableTMIDsMap(TargetServer.java:319)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:275)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:224)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:221)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.processLastTargetModules(TargetServer.java:343)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:131)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:468)
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:148)
        ... 16 more
Caused by: org.netbeans.modules.tomcat5.AuthorizationException
        at org.netbeans.modules.tomcat5.TomcatManagerImpl.list(TomcatManagerImpl.java:391)
        ... 26 more
BUILD FAILED (total time: 20 seconds)
Deployment error:
Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager.
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: java.lang.IllegalStateException: Access to Tomcat server has not been authorized. Set the correct username and password with the "manager" role in the Tomcat customizer in the Server Manager.
        at org.netbeans.modules.tomcat5.TomcatManagerImpl.list(TomcatManagerImpl.java:390)
        at org.netbeans.modules.tomcat5.TomcatManager.modules(TomcatManager.java:623)
        at org.netbeans.modules.tomcat5.TomcatManager.getAvailableModules(TomcatManager.java:434)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.getAvailableTMIDsMap(TargetServer.java:319)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:275)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:224)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.checkUndeployForSharedReferences(TargetServer.java:221)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.processLastTargetModules(TargetServer.java:343)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.init(TargetServer.java:131)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:468)
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:148)
        ... 16 more
Caused by: org.netbeans.modules.tomcat5.AuthorizationException
        at org.netbeans.modules.tomcat5.TomcatManagerImpl.list(TomcatManagerImpl.java:391)
        ... 26 more
BUILD FAILED (total time: 20 seconds)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

此刻的回忆 2024-11-14 10:09:17

编辑 /conf/tomcat-users.xml 并使用您选择的用户名 manager 和密码(manager、tomcat 或其他)添加角色管理器。

如果 Eclipse 要求您输入管理员用户名和密码来进行部署,那么在设置后一定要输入它。

Edit the /conf/tomcat-users.xml and add role manager with username manager and password of your choice (manager, tomcat, or whatever).

If Eclipse requires you to enter the admin username and password to deploy, then by all means enter it once you have it set.

北风几吹夏 2024-11-14 10:09:17

检查“Catalina Base”目录的tomcat-users.xml。
右键单击 Apache Tomcat 6.xx(在服务器下)并查找连接选项卡。
应该有一条叫做卡特琳娜基地的道路。浏览到它并记下凭据集;默认用户名:ide 和密码:tomcat-users。
包括:

确保在该服务器对话框中设置相同的凭据。关闭它,你就可以开始了!

希望这有帮助!

Check the tomcat-users.xml of the "Catalina Base" directory.
Right-click Apache Tomcat 6.xx (under Servers) and look for the connection tab.
There should be a path called Catalina Base. Browse to it and note the credentials set; default is username: ide and password: tomcat-users.
Including:

Make sure you set the same credentials in that Servers dialog. Close it and you are ready to ryme!

Hope this helps!

沙沙粒小 2024-11-14 10:09:17

我更改了 /conf/tomcat-users.xml 时遇到的相同服务器错误

第 1 步:

更改 tomcat-users.xml

<tomcat-users>
<role rolename="tomcat"/>
    <role rolename="role1"/>
    <role rolename="manager-gui"/>
    <user password="tomcat" roles="tomcat,manager-gui" username="tomcat"/>
    <user password="tomcat" roles="tomcat,role1" username="both"/>
    <user password="tomcat" roles="role1" username="role1"/>
    <user password="pass" roles="manager-script,admin" username="me"/>
</tomcat-users>

我添加了两个角色 manager-script 和 admin。

您可以在配置管理器中找到角色的进一步参考

第 2 步:

添加角色后,第 2 步会将这些凭据添加到 Netbeans 服务器配置中。

  1. 转到窗口 ->服务
  2. 选择服务器。

选择您的 tomcat 并右键单击以查看属性。

现在选择连接选项卡。输入“用户名”为“me”,“密码”为“pass”,如下图。

在此处输入图像描述

The same server error I had for which I changed the /conf/tomcat-users.xml

STEP 1:

Changing tomcat-users.xml

<tomcat-users>
<role rolename="tomcat"/>
    <role rolename="role1"/>
    <role rolename="manager-gui"/>
    <user password="tomcat" roles="tomcat,manager-gui" username="tomcat"/>
    <user password="tomcat" roles="tomcat,role1" username="both"/>
    <user password="tomcat" roles="role1" username="role1"/>
    <user password="pass" roles="manager-script,admin" username="me"/>
</tomcat-users>

I added two roles manager-script and admin.

You can find the further reference of the roles at Configure Manager

STEP 2:

After adding the role step 2 will be adding those credentials to Netbeans server configuration.

  1. Go to Window -> Services
  2. Select Servers.

Select your tomcat and Right click to see Properties.

Now select Connection Tab. Enter the "username" as me and "password" as pass, as shown below.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文