Category Archives: exception

javax.servlet.ServletException: Circular view path

Problem :

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

Solution :

You’ve annotated the controller method as producing JSON or String or any other object . You probably want to annotate the method with @ResponseBody and change its return type to allow you to return an object representation of the JSON that you want to include in the response

  @RequestMapping(value="latestOrders",method = RequestMethod.GET)
public @ResponseBody List<Order> listProducts(Model model) throws JMSException{
List<Order> list=new ArrayList();
return list;

103 total views, no views today

Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;

Problem :

Caused by: java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;

Solution :

getContextPath() was added with Servlet 2.5, does your version of Jetty supports that ? 

Might also want to check that you do not have some older or duplicate version of j2ee around.

Indicates that Jetty 6.1.x supports Servlet 2.5 , make sure you don’t have a pre-2.5 servlet version around. If this gets loaded before the 2.5 version, the entire classpath sees only Servlet 2.0 API (the 2.5 doesn’t even gets loaded).

so exclude it from the maven pom.xml

Exclusion entry

76 total views, 1 views today

Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.2.3.RELEASE:repackage failed: Unable to find main class


Solution 1 :

You needed to change the packaging parameter to jar from pom. Also, the repositories, pluginRepositories, the maven-compiler-plugin and the spring-boot-maven-plugin’s version and executions weren’t needed.

Solution 2: 

Try mvn install and see if it works

Solution 3:

    <!-- The main class to start by executing java -jar -->
Solution 4:

Enable the main() method in your

Configure spring-boot-maven-plugin to specify the class with the main class (Spring should find it anyway if you have one, but good to be explicit):


72 total views, no views today

Required request body content is missing: org.springframework.web.method.HandlerMethod

You can’t send a request body with an HTTP GET request. You should modify your call so that it only supports POST, and POST your JSON to that endpoint.

If you want to GET information about a bean, you should create a separate controller method that does that (and does not require a request body).

Also, double-check your endpoint definitions  in the $.ajax call.

74 total views, no views today

exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.json.JSONObject

Could not write content: No serializer found for class org.json.JSONObject and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) )

controller methods return simple POJOs – Collection<Bookmark>, and Bookmark, etc., 

When an HTTP request comes in that specifies an Accept header, Spring MVC loops through the configured HttpMessageConverter until it finds one that can convert from the POJO domain model types into the content-type specified in the Accept header, if so configured.

Spring Boot automatically wires up an HttpMessageConverter that can convert generic Object’s to JSON, absent any more specific converter. HttpMessageConverter s work in both directions: incoming requests bodies are converted to Java objects, and Java objects are converted into HTTP response bodies.

To solve Exception just override the default behaivour of the HttpMessageConverter provided by spring.

public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter();
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
return jsonConverter;

This will do the trick for you.

76 total views, no views today

Exception at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(OneToOneSecondPass)

You might end up with this exception while doing your one to one ,or many to one relationship in hibernate.

Exception in thread "main" java.lang.NullPointerException
at org.hibernate.cfg.OneToOneSecondPass.doSecondPass(
at org.hibernate.cfg.Configuration.secondPassCompile(
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(
at org.hibernate.cfg.Configuration.buildSessionFactory(
at com.javatpoint.Test.main(

To fix correct this exception Check following :

1. Your one to one mapping bean is pointing to correct column.
2. You have configured both table correctly.

Once you have correct these your exception will go away.

75 total views, no views today