As I try to deploy my web application from netbeans, I get the following error :
Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
W:\UnderTest\NetbeansCurrent\WebApplication1\nbproject\build-impl.xml:1033:
Deployment error: Access to Tomcat server has not been authorized.
Set the correct username and password with the "manager-script" role in the
Tomcat customizer in the Server Manager.
See the server log for details.
BUILD FAILED (total time: 14 seconds)
What is that ? Why am I getting this error ?
Following is the snippet from tomcat-users.xml :
<tomcat-users>
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary.
-->
<!--
NOTE: The sample user and role entries below are wrapped in a comment
and thus are ignored when reading this file. Do not forget to remove
<!.. ..> that surrounds them.
-->
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<user username="suhail" password="suhail" roles="manager-gui"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
Following is the snapshot from netbeans server settings :
You have to add the manager-script in order to perform deployment operations.
So in you xml you should have something like
<user username="suhail" password="suhail" roles="manager-gui,manager-script"/>
Related
I successfully installed the tomcat in the linux server I also give the permissions to the tomcat user in the server.
I have followed Tutorial for adding the Tomcat9 in the server
I added the user role and the user for manager-gui and admin-gui
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="admin" password="admin_password" roles="admin-gui,manager-gui"/>
But when I am trying to access the host-manager and the manager its not giving me access with the above creadentials username="admin" password="admin_password"
I am unsure as to why I am unable to login, here are the permissions:
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<role rolename="manager-script"/>
<user username="lamidotijjo" password="s3cr3t" roles="manager-gui,manager-script,admin-gui"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
</tomcat-users>
I installed it from the tomcat official website for Ubuntu yesterday. I thought that all the permissions were correct. Thanks!
All your permissions are correct, and the new user you added is fine. The problem is that you did not set valid passwords on these three pre-configured users in file tomcat-users.xml:
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
Tomcat deliberately configures those users with invalid passwords, forcing you to change them to something valid. If you check the log after starting Tomcat with those settings you probably see several stack traces similar to this:
10-Jun-2018 00:04:35.343 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 902 ms
10-Jun-2018 00:04:35.386 SEVERE [main] org.apache.tomcat.util.digester.Digester.fatalError Parse Fatal Error at line 48 column 34: The value of attribute "password" associated with an element type "user" must not contain the '<' character.
org.xml.sax.SAXParseException; lineNumber: 48; columnNumber: 34; The value of attribute "password" associated with an element type "user" must not contain the '<' character.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
The error message is very explicit:
The value of attribute "password" associated with an element type "user" must not contain the '<' character.
Just replace each instance of "<must-be-changed>" with "password" (or some password of your choice) and restart Tomcat to fix the problem.
Alternatively, you could just remove those three lines from the file (or comment them out) if you don't need those three users.
I'm trying to develop an web app using java. I was using apache tomcat 7 and it was working fine. But today I installed tomcat 8. Then I transferred my web app to the new installation of apache. But now, I can't login to the web app.
Here is my tomcat-users.xml:
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<user username="manager" password="tomcat" roles="manager-gui"/>
<user username="tomcat" password="tomcat" roles="admin,tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
When I tried to access the login example of the apache tomcat using the user name tomcat and password tomcat, it directs to the error page. It says,
Invalid username and/or password, please try again.
Can any one tell me where the error is ?
I am having error 403 access denied on tomcat 7.0.42 while accessing Tomcat Manager App.
This is what I have in tomcat-user.xml file.
I have tried changing roles over and over but did not work.
Note: - I start/stop tomcat from NetBeans 7.3.1
<?xml version="1.0" encoding="UTF-8"?>
<tomcat-users>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-script" />
</tomcat-users>
Remove the manager-script and add "manager-gui,manager-status".
To access the HTML interface, you need to have the manager-gui role, but you must NOT have the manager-script or manager-jmx roles.
<tomcat-users>
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-status"/>
</tomcat-users>
some information for you about roles from http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
manager-gui — Access to the HTML interface.
manager-status — Access to the "Server Status" page only.
manager-script — Access to the tools-friendly plain text interface that is described in this document, and to the "Server
Status" page.
manager-jmx — Access to JMX proxy interface and to the "Server Status" page.
Though the answer is already the correct answer, I think maybe someone will be confused about the usage of "manager-script".
The "manager-script" is for accessing the Tomcat Manager API without using Web pages.
For instance, the command below is for requesting undeploy function instead of clicking the undeploy button on Tomcat Manager web app.
curl http://localhost:8080/manager/text/undeploy?path=/app_name
I tied tomcat7 on ubuntu, and found that if you configure like this:
<user username="admin1" password="admin1" roles="manager-gui,manager-jmx,manager-script,manager-status,admin-gui,admin-script"/>
<user username="admin2" password="admin2" roles="admin-gui,admin-script,manager-gui,manager-jmx,manager-script,manager-status"/>
admin1 will work OK, but admin2 will not have the access.
It seems that the order of the roles matters.
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="admin" roles="manager-gui,manager-status"/>
Add these to end of the tomcat-users.xml before tag located inside conf folder.
This question already has answers here:
What is the default username and password in Tomcat?
(19 answers)
Closed 8 years ago.
Starting web services in Netbeans just Hello World Program , but this Application Manager makes hectic on this to start ,
Facing this alert message in NetBeans also Tomcat Application Manager Message with user name and password
I gave the admin and password as credentials it returns invalid username
Enter password to unlock your login keyring
The password you use to log in to your computer no longer matches that of your login keyring.
What should be default values for user name password in Tomcat Application Manager ?
First navigate to below location and open it in a text editor
<TOMCAT_HOME>/conf/tomcat-users.xml
For tomcat 7, Add the following xml code somewhere between <tomcat-users> I find the following solution.
<role rolename="manager-gui"/>
<user username="username" password="password" roles="manager-gui"/>
Now restart the tomcat server.
The admin and manager apps are two separate things. Here's a snapshot of a tomcat-users.xml file that works, try this:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="USERNAME" password="PASSWORD" roles="manager,tomcat,role1"/>
</tomcat-users>
It works for me very well
To reset your keyring.
Go into your home folder.
Press ctrl & h to show your hidden folders.
Now look in your .gnome2/keyrings directory.
Find the default.keyring file.
Move that file to a different folder.
Once done, reboot your computer.