Programming Issues

Issues

ConditionalOnProperty found different open-in-view

If spring boot application is running and any of the property configuration is modified in configuration files like application.properties, This auto configuration report will be shown in console log. Auto Configuration Report Negative matches: JpaBaseConfiguration.JpaWebConfiguration: Did not match: - @ConditionalOnProperty (spring.jpa.open-in-view=true) found different value in property 'open-in-view' (OnPropertyCondition) Positive matches:

spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this

In Spring boot, by default OSIV (Open Session in View) is enabled. As OSIV affects the connection and performance of the database, this warning log will be displayed when starting the spring boot application. Exception 2019-10-05 16:32:06.548 WARN 3840 --- [ restartedMain] aWebConfiguration$JpaWebMvcConfiguration : spring.jpa.open-in-view is enabled by default. Therefore,

java.util.NoSuchElementException: No value present

The java.util.NoSuchElementException: No value present error occurred in spring boot application when an entity object is being attempted to get it from an optional object. If the hibernate returns an empty optional object, this exception Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested

Request method ‘GET’ not supported – Http Status 405

The spring boot exception Request method ‘GET’ not supported exists when the request method is not configured as ‘GET’ in one of the rest controller methods and is requested using the HTTP GET method. The request method is configured in annotation @RequestMapping. In spring boot, all HTTP request methods are

No default constructor for entity

The spring boot error No default constructor for entity occurs in an entity class which does not have a default constructor. The hibernate uses the default constructor method to create a bean class. Hibernate fails to create entity classes unless there is a default constructor. Therefore, throws exception org.hibernate.InstantiationException: No entity default constructor. The default constructor is

Required string parameter is not present

The spring boot error Required string parameter is not present occurs when the request parameter is not stated in the request url and the request parameter is configured as mandatory. The controller method needs to provide a value for the request parameter. The invoked url does not contain the value

template might not exist or might not be accessible by any of the configured Template Resolvers

The spring boot error template might not exist or might not be accessible by any of the configured Template Resolvers occurs when the template files are not available in src/main/resources/templates folder or the file name is incorrect. The exception org.thymeleaf.exceptions.TemplateInputException: Error resolving template is thrown if the template file can

Path with “WEB-INF” or “META-INF”

The spring boot error Path with “WEB-INF” or “META-INF” occurs when the jsp page url is invoked and the tomcat jasper dependency is not configured in the application. The jsp files are compiled and rendered using the tomcat embedded jasper maven dependency. If the maven dependency is not configured in

javax.servlet.ServletException: Circular view path [error]: would dispatch back to the current handler URL [/error] again.

javax.servlet.ServletException: Circular view path [error]: would dispatch back to the current handler URL [/error] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.) The spring boot exception javax.servlet.ServletException: Circular view path [error]: would dispatch back to the current

Ambiguous mapping. Cannot map ‘basicErrorController’ method

Spring boot error Ambiguous mapping. Cannot map ‘basicErrorController’ method occurs when the url ‘/error’ url is configured in the request mapping annotation of the rest controller method. By default, “/error” is mapped in the BasicErrorController class to handle errors and exceptions in the spring boot application. This error occurs when

This application has no explicit mapping for /error, so you are seeing this as a fallback. Whitelabel error page

In this post, we will see about this error “Whitelabel Error page, This application has no explicit mapping for /error, so you are seeing this as a fallback.”. You see this error, because something went wrong in the application. For some reason, Spring boot can not server the web page

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

The spring boot Web server failed to start. Port 8080 was already in use. error occurs because port 8080 is already configured with another application, or port 8080 has not been released yet. The spring boot application is trying to configure port 8080 to start a web server. Since the

java.lang.IllegalArgumentException: Sources must not be empty

The spring boot error java.lang.IllegalArgumentException: Sources must not be empty occurs if the source class name is not specified in the SpringApplicationBuilder. When the spring boot application starts, this error is thrown in the console. SpringApplicationBuilder creates and loads the spring boot application using the name of the source class

Main method not found in class, please define the main method as: public static void main(String[] args) or a JavaFX

The java error: main method not found in the file, please define the main method as: public static void main(string[] args) occurs if the main method not found in class or the main method is not accessible or the main method is invalid. The main method indicates the start of

Continue Statement with example in Java

Continue statements in java is used to terminate the rest of the code in the loop and execute the next iteration. Java Continue statement is used for any type of loop, but is usually used for, while, do-while loops and foreach. The continue statement jumps immediately to the next iteration