Access to Tomcat server has not been authorized

后端 未结 8 2004
遇见更好的自我
遇见更好的自我 2021-01-04 03:01

I have used glassfish server in netbeans, now I changed to tomcat and when I run my web application that I have created in glassfish gives me the error :

D         


        
相关标签:
8条回答
  • 2021-01-04 03:41
    1. Add below lines in tomcat-users.xml.

       <user username="admin" password="password" roles="tomcat,role1,manager-script,manager-gui"/
      
    2. Restart tomcat/service.

    0 讨论(0)
  • 2021-01-04 03:47

    If you are going to run you web but it shows the above error , then it is due to no user information in tomcat_user.xml file(C:\apache-tomcat-7.0.33\conf ), so go there open this file and just write this sentence in the end of the " ...."

    <user password="123" roles="manager-script,admin" username="pir fahim" />
    

    like

    <tomcat-users>
       .
       .
       .
    <user password="123" roles="manager-script,admin" username="pir fahim" /> ///write this at this place in the file
    </tomcat-users>
    

    now copy the above sentence and paste it in your file just change your name and password, no changes with roles

    0 讨论(0)
  • 2021-01-04 03:49

    I really should make this a comment if have enough reputation:

    PLEASE the first comment by @Satya advicing to remove should be ignored (at least on windows - which am sure of). check this if don't believe me

    After many hours on SO I resolved the issue by:

    1. Making sure IDE and text editors (notepad++) are launched with Admin rights
    2. Edit the %TOMCAT INSTALL DIR%\conf\tomcat-users.xml as directed in earlier answers especially this one on a duplicated question and this too
    3. Check that xml file again, I mean properly for syntax errors. Use a good editor for xml, notepad++ help me figured out my error. Thanks to this SO answer

    4. Save the file and start Tomcat

    0 讨论(0)
  • 2021-01-04 03:50

    Remove your existing registered server instance in netbeans and register a new server instance with a user. Steps:

    1. Remove your existing tomcat server instance in from Services ->Servers
    2. Then right click on Servers and click Add Server
    3. Create a new server instance with a user
    0 讨论(0)
  • 2021-01-04 03:52

    NB will try to connect to the Tomcat instance through the proxy if one is specified in IDE settings (Tools|Options|General tab).

    So, if you still get this after making the relevant modifications in tomcat-users.xml, check your proxy configuration. Try setting the proxy settings to "No proxy" and then try again. If it works, you have bad proxy settings. "localhost" must be in the "No Proxy Hosts" list. Correct accordingly.

    0 讨论(0)
  • 2021-01-04 03:53

    check the proxy settings under tools > options in the ide.

    selecting no proxy resolved this issue for me.

    0 讨论(0)
提交回复
热议问题