Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 079BB11267 for ; Tue, 24 Jun 2014 12:53:25 +0000 (UTC) Received: (qmail 94295 invoked by uid 500); 24 Jun 2014 12:53:24 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 94262 invoked by uid 500); 24 Jun 2014 12:53:24 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 94251 invoked by uid 99); 24 Jun 2014 12:53:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Jun 2014 12:53:24 +0000 Date: Tue, 24 Jun 2014 12:53:24 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CXF-5815) cxf not unmarshalling parent elements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-5815?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sergey Beryozkin resolved CXF-5815. ----------------------------------- Resolution: Won't Fix Assignee: Sergey Beryozkin This specific issue is not a bug but to do with the lack of the namespace information in the incoming JSON payload > cxf not unmarshalling parent elements > ------------------------------------- > > Key: CXF-5815 > URL: https://issues.apache.org/jira/browse/CXF-5815 > Project: CXF > Issue Type: Bug > Components: JAXB Databinding > Affects Versions: 2.7.11 > Environment: ubuntu 13.10, oracle java 1.7, tomcat 7.0 > Reporter: Michael Lambert > Assignee: Sergey Beryozkin > Attachments: EntityType.java, UserDataType.java, beans.xml, common-v1.xsd, schema-0.0.1-SNAPSHOT-sources.jar, schema-0.0.1-SNAPSHOT.jar, user-data-artifacts-0.0.1-SNAPSHOT-sources.jar, user-data-artifacts-0.0.1-SNAPSHOT.jar, user-data-service-0.0.1-SNAPSHOT-sources.jar, user-data-service-0.0.1-SNAPSHOT.war, user-v1.xsd > > > Base class elements are not being unmarshaled when passed into jax-rs service. For example if I pass: > { > "id": "12", > "name": "mike" > } > Where "id" comes from a base complexType: > > > > > > and "name" comes from a complexType derived from the base type: > > > > > > > > > > The service method does not receive the "id" value when the object is unmarshalled: > @POST > public void get(UserDataType user) { > assert user.getName() != null : "this passes"; > assert user.getId() != null : "this fails"; > } > The elements that belong to the derived class (and not the base class) are passed properly (i.e. they are populated with data). > This happens only when I unmarshall json objects. It works fine with XML. > The project is on github (https://github.com/MacFlecknoe/service-repository-sample). The schema with the parent "entityType" is located at https://github.com/MacFlecknoe/service-repository-sample/blob/master/schema/src/main/resources/schema/common/common-v1.xsd. The schema which contains the derived type is located at: https://github.com/MacFlecknoe/service-repository-sample/blob/master/schema/src/main/resources/schema/entity/user-v1.xsd. The dto classes are generated in the project: https://github.com/MacFlecknoe/service-repository-sample/tree/master/user-data/artifacts. And the service itself (including the cxf configuration which is in beans.xml) is located here: https://github.com/MacFlecknoe/service-repository-sample/tree/master/user-data/service. The marshaller is configured in https://github.com/MacFlecknoe/service-repository-sample/blob/master/user-data/service/src/main/webapp/WEB-INF/beans.xml. -- This message was sent by Atlassian JIRA (v6.2#6252)