JBoss Community

Re: Resteasy jboss7 jackson configuration

created by Harald Pehl in JBoss AS 7 Development - View the full discussion

I found a way to use both CDI and a custom jackson configuration. The trick is to exclude the configuration from weld in beans.xml:

 

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xmlns:weld="http://jboss.org/schema/weld/beans"

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://docs.jboss.org/cdi/beans_1_0.xsd

    http://jboss.org/schema/weld/beans http://jboss.org/schema/weld/beans_1_1.xsd">

          <weld:scan>

    <weld:exclude name="your.custom.JacksonConfigurator" />

          </weld:scan>

</beans>

 

In case your jackson configuration is not recognized, add the following context parameter to your web.xml

 

<context-param>

  <param-name>resteasy.providers</param-name>

  <param-value>your.custom.JacksonConfigurator</param-value>

</context-param>

Reply to this message by going to Community

Start a new discussion in JBoss AS 7 Development at Community