Server is returning 406 HTTP Code when XML but working fine in case of JSON. Following are the code snippets and attached logs as well:

**Libraries:**

BlazeDS 4.0, Spring 3.2, JBoss 7.1.1Final, Maven 3.0

**REST MVC Controller:**

```
@Controller
@RequestMapping("/contacts")
public class ContactsController {

    @RequestMapping(method = RequestMethod.GET,produces= {"application/xml","application/json"})
    @ResponseStatus(value=HttpStatus.OK)
    public @ResponseBody List<Contact> find(@RequestParam(required = false) String searchStr) {

```

**Config Spring:**

```
@Configuration
@EnableWebMvc
public class Config extends WebMvcConfigurerAdapter {

    @Override
    public void configureContentNegotiation(
            ContentNegotiationConfigurer configurer) {
        configurer.defaultContentType(MediaType.APPLICATION_XML)
                .mediaType("xml", MediaType.APPLICATION_XML)
                .mediaType("json", MediaType.APPLICATION_JSON);

        }
    }

```

**Spring configuration**

```
<context:component-scan base-package="com.heksa.services"
    use-default-filters="false">
    <context:include-filter expression="org.springframework.stereotype.Controller"
        type="annotation" />
</context:component-scan>
 <bean id="contentNegotiationManager"
    class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
    <property name="defaultContentType" value="application/xml" />

    <property name="mediaTypes">
        <map>
            <entry key="json" value="application/json" />
            <entry key="xml" value="application/xml" />
        </map>
    </property>
</bean>
<bean id="xmlViewer"
    class="org.springframework.web.servlet.view.xml.MarshallingView">
    <constructor-arg>
        <bean class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
            <property name="classesToBeBound">
                <list>
                    <value>com.heksa.bean.Contact</value>
                </list>
            </property>
        </bean>
    </constructor-arg>
</bean>
<mvc:annotation-driven
    content-negotiation-manager="contentNegotiationManager" />

<mvc:default-servlet-handler />

<!-- Flex-specific Configuration -->
<flex:message-broker mapping-order="1">
    <flex:mapping pattern="/messagebroker/*" />
    <flex:message-service
        default-channels="my-streaming-amf,my-longpolling-amf,my-polling-amf" />
    <flex:secured />
</flex:message-broker>

```

**JBoss Logs:**

```
14:13:06,228 INFO  [org.springframework.oxm.jaxb.Jaxb2Marshaller] (MSC service thread 1-8) Creating JAXBContext with classes to be bound [class com.heksa.bean.Contact]
14:13:06,241 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/contacts],methods=[GET],params=[],headers=[],consumes=[],produces=[application/xml || application/json],custom=[]}" onto public java.util.List<com.heksa.bean.Contact> com.heksa.services.ContactsController.find(java.lang.String)
14:13:06,241 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/contacts/{id}],methods=[DELETE],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public void com.heksa.services.ContactsController.delete(int)
14:13:06,242 INFO  [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] (MSC service thread 1-8) Mapped "{[/contacts],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public com.heksa.bean.Contact com.heksa.services.ContactsController.create(com.heksa.bean.Contact)
14:13:06,296 INFO  [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] (MSC service thread 1-8) Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'

```