1

I am building a Spring-MVC application with Spring 3.1.1 and I am using Jackson 2.0.1 and I have a controller that uses the @ResponseBody annotation to return JSON.

@RequestMapping(value="/roleMaint/role/roleTypes", method = RequestMethod.GET)
public @ResponseBody List<Model> getRoleTypes() {

    List<Model> roleModels = new ArrayList<Model>();

    List<RoleType> roleTypes = Arrays.asList(RoleType.values());
    for (RoleType roleType : roleTypes) {
        ExtendedModelMap model  = new ExtendedModelMap();
        model.addAttribute("name", roleType.name());
        roleModels.add(model);
    }
    return roleModels;
}

I have the following items in my servlet configuration

<mvc:annotation-driven/>
<mvc:default-servlet-handler/>

When I execute a GET request, I get an HTTP 406 from WebLogic 10.3.4, which is the Java container I am deploying too - if I deploy the same application to WebLogic 12.0.0.1, the application works and so I am sure this is something to do with WebLogic 10.3.4 and some versions of Jars that are bundled within WebLogic.

Any ideas on thinks I can try here? Thanks in advance.

--Vinny

Vinny Carpenter
  • 565
  • 7
  • 13
  • Might be somewhat related to your `accept` headers. Can you sniff your HTTP headers and post them here? Sometimes a 406 can be related not only to these headers, but to other bad formatting of your request (e.g. http://stackoverflow.com/questions/6055930/getting-http-406-while-calling-external-site-from-within-servlet). It is possible that WL 10 was more restrictive in this specific request. – Viccari Jul 11 '12 at 20:01
  • I've posted the request and response headers here - https://gist.github.com/3093555 – Vinny Carpenter Jul 11 '12 at 21:05

0 Answers0