What is username and password when starting Spring Boot with Tomcat?

I think that you have Spring Security on your class path and then spring security is automatically configured with a default user and generated password Please look into your pom.xml file for: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> If you have that in your pom than you should have a log console message like this: Using default … Read more

Spring Boot: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean

The scheduling guide isn’t a web app so you probably have some mouldy stuff in your pom.xml from the REST guide? If you follow the instructions closely it should work. Another potential issue with the code you posted above is that your @EnableAutoConfiguration class is not used in the context, only as a main method … Read more

Spring Boot REST service exception handling

New answer (2016-04-20) Using Spring Boot 1.3.1.RELEASE New Step 1 – It is easy and less intrusive to add the following properties to the application.properties: spring.mvc.throw-exception-if-no-handler-found=true spring.resources.add-mappings=false Much easier than modifying the existing DispatcherServlet instance (as below)! – JO’ If working with a full RESTful Application, it is very important to disable the automatic mapping … Read more

How do I tell Spring Boot which main class to use for the executable jar?

Add your start class in your pom: <properties> <!– The main class to start by executing java -jar –> <start-class>com.mycorp.starter.HelloWorldApplication</start-class> </properties> or <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <mainClass>com.mycorp.starter.HelloWorldApplication</mainClass> </configuration> </plugin> </plugins> </build>

Spring Boot not serving static content

Not to raise the dead after more than a year, but all the previous answers miss some crucial points: @EnableWebMvc on your class will disable org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration. That’s fine if you want complete control but otherwise, it’s a problem. There’s no need to write any code to add another location for static resources in addition to … Read more

Spring Boot – parent pom when you already have a parent pom

You can use the spring-boot-starter-parent like a “bom” (c.f. Spring and Jersey other projects that support this feature now), and include it only in the dependency management section with scope=import.That way you get a lot of the benefits of using it (i.e. dependency management) without replacing the settings in your actual parent. The 2 main … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)