简体   繁体   中英

Spring STS Spring Tools Suite port issue Tomcat on Windows 10

I am doing the following tutorial:

http://spring.io/guides/tutorials/bookmarks/

I have everything running, but I can't seem to login at the ReST end points.

http://localhost:8080/jlong/bookmarks

I get a popup for login: " http://localhost:8080 is requesting your username and password. The site says: “Spring”"

For example, when the username/password pops up, I enter "jlong"/"password" and it refuses access. The STS console provides no useful info after displaying start.

"Starting Application on MYPC with PID 19842

I have 2 questions for which searching did not seem to provide good answers. As a precaution I searched (netstat -anob) for all applications that may be using port 8080 and killed them and restarted my app on STS. Taskmanager details or connecting with JavaConsole to the jvm also did not yield anything useful.

  1. Where can I find a detailed Tomcat or other log to see what happened?
  2. How can I change the built-in port number within STS? I can see server.xml etc, but cannot seem to find the setting.

This seems to be hugely related to this question on SO: What is username and password when starting Spring Boot with Tomcat?

There at least is the answer for the authentication question. Short answer is: the default user name is "user" and the default password is the one that gets printed to the console by Spring Security when starting up the app in a line that is called Using default security password: .

If you start the app in STS as a Spring Boot app (using the boot dashboard, for example), you can see the port of the app directly in the boot dashboard once the app got started and is running fine. If you want to change that port, you can use the property "server.port" in an application.properties file, application.yml file, define it in the Boot app launch config or as a system property in the launch config, as described here: Spring Boot: Change Port for Web Application

Hope this helps!!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM