Server http:/localhost:8080 requires a user name and a password. The server says: XDB

拈花ヽ惹草 提交于 2019-12-20 09:55:53

问题


I am trying to access localhost:8080 but it is showing me I need to enter user name and pass word. I remember messing up with the server some 4 months ago while I was trying to develop a web application and hosting my domain name on my pc, Unfortunately I become unsuccessful. While working with servlets I was tring some security features and till some time i did not see and of these pop up windows asking for authentication.

I tried to enter the password that I was playing with but non of those are working. Is there anyway i could get out of this problem?


回答1:


This is http authentication. You can find username and password inside users.xml WEB-INF directory if any. otherwise you have to edit or remove security-constraint element from web.xml file

UPDATE Sorry, I haven't noticed XDB. check if Oracle and tomcat using same port. Update anyone of them




回答2:


Some thing other application(like oracle) is using the same port number. So you should change the tomcat port number in apachetomcat/conf/server.xml

Privious--->

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

Updated ---->

<Connector port="8088" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />



回答3:


This is caused because there is a database running on your computer. In my case, it was an Oracle data base. By default, everytime you start your computer, the services of the database automatically starts.

Go to Start >> find Oracle or whatever data-base in the list of programms >> and manually stop the database. It appears that there is a conflict of port.




回答4:


give username as admin

and leave the password empty




回答5:


You can uninstall WAMP/XAMPP and install it again with default port number. It will work properly.




回答6:


I'll assume that uninstall and reinstall Tomcat is not acceptable to you. The screen shot show basic auth challenge screen from browser and on the default app. So most likely you have set up users on the tomcat using the conf/tomcat-users.xml Try going through this guide https://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html#UserDatabaseRealm

There are several other realms that you could have possibly used. Hopefully you will remember when you start reading the doc




回答7:


I was facing the same problem, I just change the jboss7.1 port from 8080 to 9090. and it worked perfectly for me. To change the jboss7.1 port go to jboss-as-7.1.0.Final\standalone\configuration open standalone.xml look for the line <socket-binding name="http" port="8080"/> change 8080 to 9090. save the file and Restart the server. it should work




回答8:


Open the file :

WEB-INF -> web.xml

In my case, it looks like as following. :

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Integration Web Services</web-resource-name>
        <description>Integration Web Services accessible by authorized users</description>
        <url-pattern>/services/*</url-pattern>
        <http-method>GET</http-method>
        <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
        <description>Roles that have access to Integration Web Services</description>
        <role-name>maximouser</role-name>
    </auth-constraint>
    <user-data-constraint>
        <description>Data Transmission Guarantee</description>
        <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
</security-constraint>

Remove or comment these lines.




回答9:


even i faced the same problem. The possibility of this could be usage of same port by two or more application/process. In Some cases you can use different port number which will avoid this problem, but in other case you have to manually kill the process with help of command prompt.

The command to kill is, In your command prompt first enter this command

C:\Users\A611003>tasklist

After this you can able to see list of process running with process ID. For example,

From this select the process you want to stop, for example consider the process id 304 is your server and you have problem with that. Then enter this command.

C:\Users\A611003>Taskkill /PID 304 /F

This will kill that process now you can clean, publish your server and start it.

Note: If you fail to add /F in the above command it does nothing. It is the force kill. you can also try/? for list of available options.




回答10:


I just killed the Oracle processes and re-initiate JBoss. All was fine :)




回答11:


Just change your default port 8080 to something else like below example

SQL> begin
 2   dbms_xdb.sethttpport('9090');
 3   end;
 4  /



回答12:


you can find the username and password details in your {tomcat installation directory}/conf/tomcat-users.xml




回答13:


Add username and password in application propreties files.

When adding spring security every http query must be authentified by login and password.



来源:https://stackoverflow.com/questions/32960741/server-http-localhost8080-requires-a-user-name-and-a-password-the-server-says

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