NetBeans 7.0.1: Access to Tomcat server has not been authorized

巧了我就是萌 提交于 2019-12-03 15:05:15
Jack Harkness

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 further references to roles at Configure Manager

STEP 2:

After adding the role you will need to add those credentials to Netbeans server configuration.

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

Select your tomcat instance and Right click to see Properties.

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

Check the proxy settings under Tools > Options in the IDE.

Selecting No Proxy resolved this issue for me.

change the xml file as:

<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>

if you are running windows goto:

C:\Users\Apostolis\AppData\Roaming\NetBeans\8.0\apache-tomcat-8.0.3.0_base\conf

and there change the tomcat-users accordingly e.g

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

After that from Netbeans, when asked enter the username and pass e.g ide,Vh4fsrwh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!