Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat keeps asking for password and username

Hi I am not sure I am trying to connect to apache server, this is a class I am taking, but now after I removed the code and restored it back to default, it keeps asking for the password now.

This is what I have in my tomcat-users.xml

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<user username="ide" password="EiWnNlBG" roles="manager-script,admin"/>
</tomcat-users>

also this is in tools ---> server ---> pass and user name.

and error i get in output

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: 6 seconds)

Only thing I changed was tomcat-users.xml and web.xml but I restored everything back to normal and still asking for username and password.

like image 709
user2805313 Avatar asked Nov 11 '22 21:11

user2805313


1 Answers

This drove me nuts for ages. I jumped through all the hoops of modifying XML files to no avail. Driven to the point of distraction I killed all Apache/Tomcat processes and services but still http://localhost:8080 kept asking me for a username and password. So I figured something else must be using port 8080. But what? Time to go old school, to go back to CMD (remembering to run CMD as administrator).

netstat -aon | findstr 8080

TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 3472
TCP [::]:8080 [::]:0 LISTENING 3472

So, process id 3472 is using the port. But what is process id 3472?

tasklist | findstr 3472

TNSLSNR.EXE 3472 Services 0 13,256 K

So, a quick Google search for TNSLSNR reveals that it's an Oracle listener. Do I need it right now. No. So I killed it.

taskkill /F /PID 3472

SUCCESS: The process with PID 3472 has been terminated.

Yay! Now free of interference from non Apache/Tomcat processes and/or services I can concentrate on getting the Apache config right.

like image 164
Clarius Avatar answered Nov 15 '22 05:11

Clarius