Note that there are some explanatory texts on larger screens.

plurals
  1. POIn Spring 3.0.5 and coding it to serve JSON, what is this log output trying to tell me?
    primarykey
    data
    text
    <p>Using Spring 3.0.5, I am trying to return a list of strings in JSON format.</p> <ul> <li><p>I read the post <a href="https://stackoverflow.com/questions/4203333/spring-mvc-json-response">spring-mvc-json-response</a></p></li> <li><p>I have available to me jackson-mapper code 1.4.2 and it's on my classpath.</p></li> <li><p>I am also using <code>&lt;context:component-scan base-package="com.funfun.foofoo2" /&gt;</code> which should satisfy the <code>&lt;mvc:annotation-driven&gt;</code> requirement.</p></li> <li><p>I am returning a <code>List&lt;String&gt;</code> although I have tried just a bean too.</p></li> <li><p>When I return raw JSON as a String, it works. </p></li> </ul> <p>What is the following log output telling me? Is it saying it cannot find the Jackson JSON Mapper and thus the <code>MappingJacksonHttpMessageConverter</code> is not loaded? </p> <pre><code>17:19:01,037 DEBUG [AnnotationMethodHandlerExceptionResolver:132] Resolving exception from handler [com.funfun.foofoo2.CarModelsController@181fa4b]: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation 17:19:01,037 DEBUG [ResponseStatusExceptionResolver:132] Resolving exception from handler [com.funfun.foofoo2.CarModelsController@181fa4b]: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation 17:19:01,037 DEBUG [DefaultHandlerExceptionResolver:132] Resolving exception from handler [com.funfun.foofoo2.CarModelsController@181fa4b]: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation 17:19:01,053 DEBUG [DispatcherServlet:824] Null ModelAndView returned to DispatcherServlet with name 'appServlet': assuming HandlerAdapter completed request handling </code></pre> <p><em>Update:</em> I am using jQuery's getJSON. In Firefox Firebug, I see the header coming over as application/json. The Spring method is constrained to only handle requests for JSON.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload