/*
 * ProActive Parallel Suite(TM):
 * The Open Source library for parallel and distributed
 * Workflows & Scheduling, Orchestration, Cloud Automation
 * and Big Data Analysis on Enterprise Grids & Clouds.
 *
 * Copyright (c) 2007 - 2017 ActiveEon
 * Contact: contact@activeeon.com
 *
 * This library is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Affero General Public License
 * as published by the Free Software Foundation: version 3 of
 * the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 *
 * If needed, contact us to obtain a release under GPL Version 2 or 3
 * or a different license than the AGPL.
 */
package org.ow2.proactive_grid_cloud_portal.webapp;

import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;

import org.codehaus.jackson.map.AnnotationIntrospector;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.xc.JaxbAnnotationIntrospector;


/**
 * Configuration class that allows to specialize the behaviour of
 * the JSon serialization made by the Jackson Provicer
 * Loaded by reflection somewhere in RestEasy.
 */

@Provider
public class JacksonProvider implements ContextResolver<ObjectMapper> {

    public ObjectMapper getContext(Class<?> arg0) {
        ObjectMapper mapper = new ObjectMapper();
        AnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
        mapper.getDeserializationConfig().setAnnotationIntrospector(introspector);
        mapper.getSerializationConfig().setAnnotationIntrospector(introspector);
        mapper.getSerializationConfig().disable(SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS);
        return mapper;
    }

}

@@ -1069,16 +1069,80 @@
 ebapp;%0A%0A
+import javax.ws.rs.Produces;%0Aimport javax.ws.rs.core.MediaType;%0A
 import j
@@ -1362,16 +1362,90 @@
 Config;%0A
+import org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector;%0A
 import o
@@ -1673,17 +1673,16 @@
 sy.%0A */%0A
-%0A
 @Provide
@@ -1683,16 +1683,54 @@
 rovider%0A
+@Produces(MediaType.APPLICATION_JSON)%0A
 public c
@@ -1803,62 +1803,27 @@
    p
-ublic ObjectMapper getContext(Class%3C?%3E arg0) %7B%0A       
+rivate static final
  Obj
@@ -1856,24 +1856,56 @@
 ectMapper();
+%0A%0A    public JacksonProvider() %7B
 %0A        Ann
@@ -1985,69 +1985,65 @@
     
-mapper.getDeserializationConfig().setAnnotationIntrospector(i
+AnnotationIntrospector secondary = new JacksonAnnotationI
 ntro
@@ -2041,32 +2041,33 @@
 tionIntrospector
+(
 );%0A        mappe
@@ -2072,36 +2072,38 @@
 per.
-getSerializationConfig().set
+setAnnotationIntrospector(new 
 Anno
@@ -2120,16 +2120,21 @@
 ospector
+.Pair
 (introsp
@@ -2138,16 +2138,28 @@
 ospector
+, secondary)
 );%0A     
@@ -2172,39 +2172,16 @@
 per.
-getSerializationConfig().disabl
+configur
 e(Se
@@ -2225,18 +2225,98 @@
 TY_BEANS
-);
+, false);%0A    %7D%0A%0A    @Override%0A    public ObjectMapper getContext(Class%3C?%3E arg0) %7B
 %0A       

fix the system test bug. Use correclty a configured jackson provider