Difference between Spring MVC and Spring Boot

Spring MVC is a complete HTTP oriented MVC framework managed by the Spring Framework and based in Servlets. It would be equivalent to JSF in the JavaEE stack. The most popular elements in it are classes annotated with @Controller, where you implement methods you can access using different HTTP requests. It has an equivalent @RestController to implement REST-based APIs. … Read more

Web server failed to start. Port 8080 was already in use. Spring Boot microservice

If you don’t want the embedded server to start, just set the following property in you application.properties (or .yml): If your classpath contains the necessary bits to start a web server, Spring Boot will automatically start it. To disable this behaviour configure the WebApplicationType in your application.properties Source: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-web-servers.html If you application really is a Web application, then you can easily … Read more

Web server failed to start. Port 8080 was already in use. Spring Boot microserviceWeb server failed to start. Port 8080 was already in use. Spring Boot microservice

If you don’t want the embedded server to start, just set the following property in you application.properties (or .yml): If your classpath contains the necessary bits to start a web server, Spring Boot will automatically start it. To disable this behaviour configure the WebApplicationType in your application.properties Source: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-web-servers.html If you application really is a Web application, then you can easily … Read more

Spring boot error:java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

The solution can vary based on actual incompatibility root cause. The best way how to investigate such the issue is to follow this line: and put breakpoint into constructor of class ‘TypeNotPresentExceptionProxy’ (there is only one). After execution in debug mode you should see what exactly is wrong and based on your findings you can … Read more

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘demoRestController’

Your DemoApplication class is in the com.ag.digital.demo.boot package and your LoginBean class is in the com.ag.digital.demo.bean package. By default components (classes annotated with @Component) are found if they are in the same package or a sub-package of your main application class DemoApplication. This means that LoginBean isn’t being found so dependency injection fails. There are a couple of ways to solve your problem: Move LoginBean into com.ag.digital.demo.boot or a sub-package. Configure … Read more

Java file outside of source root intelliJ

If you do an ‘import from git’, IntelliJ doesn’t import the project structure from maven (or gradle) automatically. One way to do this afterwards is to right-click on the pom.xml file in the root directory, and select ‘Add as maven project’. Then the folders will be marked correctly, and dependent libraries will be imported. There … Read more

org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set

First remove all of your configuration Spring Boot will start it for you. Make sure you have an application.properties in your classpath and add the following properties. If you really need access to a SessionFactory and that is basically for the same datasource, then you can do the following (which is also documented here although for XML, not JavaConfig). That way … Read more

org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set

First remove all of your configuration Spring Boot will start it for you. Make sure you have an application.properties in your classpath and add the following properties. If you really need access to a SessionFactory and that is basically for the same datasource, then you can do the following (which is also documented here although for XML, not JavaConfig). That way … Read more