moxy

Moxy error with Karaf

流过昼夜 提交于 2019-11-28 02:04:12
I'm using MOXy under fuse ESB (based on karaf), I converted org.eclipse.persistence.jar to a bundle, I deployed this bundle under fuse ESB and I got this error Error : "org.apache.cxf.interceptor.Fault: property "eclipselink-oxm-xml" is not supported" When trying to create new instance of JAXBContext my code is trying to convert Java model to XML, and the model is deployed in a separate bundle under fuse ESB and I added jaxb.properties file in the same package of the model Note: The same code runs successfully without problems when running from a main method in a main class. The following is

JAXB Compiling Issue - [ERROR] Property “Any” is already defined

情到浓时终转凉″ 提交于 2019-11-28 01:19:13
I am trying to create JAXB binding for xccdf-1.1.4.xsd which is a standard schema that can be obtain from XCCDF Schema Location I am currently using EclipseLink MOXy as my JAXB implementation since I like the fact that it can also generate JSON bindings as well. I fixed couple of occasion where I hit the infamous "[ERROR] Property "value" is already defined" error using an external binding XML, and now I am hitting an error on [ERROR] Property "Any" is already defined. Use <jaxb:property> to resolve this conflict. line 441 of file:/home/dchu/Playground/Java/eclipselink_moxy/xccdf_1.1.4/xccdf-1

EclipseLink MOXy @XmlPath support for axes/parent

♀尐吖头ヾ 提交于 2019-11-28 01:09:04
Are any of the following XPath expressions acceptable? Using version 2.3.1 of eclipselink @XmlPath("../header/@type") @XmlPath("/root/header/@type") @XmlPath("parent::*/header/@type") Basically this is in a class which repeats within the XML document ( /root/tag ), if that isn't clear I'll elaborate. I'm trying to traverse up the tree rather than down. My other @XmlPath annotations are working fine. EclipseLink JAXB (MOXy) does currently not support axes/parent. If you are interested in this kind of support please enter an enhancement request: https://bugs.eclipse.org/bugs/enter_bug.cgi

Force Glassfish4 to use Jackson instead of Moxy

一曲冷凌霜 提交于 2019-11-27 22:58:06
Glassfish4 is using Moxy to serialize REST responses into JSON. Does anybody know how to configure application to use Jackson instead of Moxy? Michal Gajdos You need to register JacksonFeature in your application if you want to use Jackson as your JSON provider (by registering this feature your disable MOXy to be your JSON provider). You can do it either in Application subclass: public class MyApplication extends Application { public Set<Class<?>> getClasses() { final Set<Class<?>> classes = new HashSet<Class<?>>(); // Add root resources. classes.add(HelloWorldResource.class); // Add

Represent null value as empty element in xml jaxb

时光总嘲笑我的痴心妄想 提交于 2019-11-27 20:47:25
I need to display null value as empty element in jaxb. I am using moxy implementation of jaxb. I found this option @XmlNullPolicy(emptyNodeRepresentsNull = true, nullRepresentationForXml = XmlMarshalNullRepresentation.EMPTY_NODE) Is there any similar extension that can be applied at Class level (for all elements defined in it) I would strongly recommend representing null with either the absence of the node or with the xsi:nil="true" attribute. This works best with schema validation (i.e. <age/> or <age></age> is not a valid element of type xsd:int . However if you can't here is how you can

What is the moxy equivalent to Jackson's JsonAnySetter?

坚强是说给别人听的谎言 提交于 2019-11-27 16:59:17
问题 I'm attempting to move to Jersey 2.0. Which is giving me pains with Jackson, and the docs recommend using Moxy. I got Moxy working for get and post calls where everything matches nicely however I have a need to deal with possible unknown elements. // Handle unknown deserialization parameters @JsonAnySetter protected void handleUnknown(String key, Object value) { if (unknownParameters == null) { unknownParameters = new HashMap<>(); } unknownParameters.put(key, value); } This worked well with

Moxy error with Karaf

帅比萌擦擦* 提交于 2019-11-27 04:51:13
问题 I'm using MOXy under fuse ESB (based on karaf), I converted org.eclipse.persistence.jar to a bundle, I deployed this bundle under fuse ESB and I got this error Error : "org.apache.cxf.interceptor.Fault: property "eclipselink-oxm-xml" is not supported" When trying to create new instance of JAXBContext my code is trying to convert Java model to XML, and the model is deployed in a separate bundle under fuse ESB and I added jaxb.properties file in the same package of the model Note: The same code

Use Moxy as default JAXB Implementation

*爱你&永不变心* 提交于 2019-11-27 01:46:39
问题 In order to use Moxy as JAXB Implementation, one has to add a file called jaxb.properties in the folder with the domain classes of the application and include the following line javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory Is it possible to make moxy the default for the project ? In case I have many different folders with annotated domain classes in which folder should I put this file? 回答1: Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB

EclipseLink MOXy @XmlPath support for axes/parent

半世苍凉 提交于 2019-11-26 23:29:42
问题 Are any of the following XPath expressions acceptable? Using version 2.3.1 of eclipselink @XmlPath("../header/@type") @XmlPath("/root/header/@type") @XmlPath("parent::*/header/@type") Basically this is in a class which repeats within the XML document ( /root/tag ), if that isn't clear I'll elaborate. I'm trying to traverse up the tree rather than down. My other @XmlPath annotations are working fine. 回答1: EclipseLink JAXB (MOXy) does currently not support axes/parent. If you are interested in

JAXB Compiling Issue - [ERROR] Property “Any” is already defined

萝らか妹 提交于 2019-11-26 21:53:45
问题 I am trying to create JAXB binding for xccdf-1.1.4.xsd which is a standard schema that can be obtain from XCCDF Schema Location I am currently using EclipseLink MOXy as my JAXB implementation since I like the fact that it can also generate JSON bindings as well. I fixed couple of occasion where I hit the infamous "[ERROR] Property "value" is already defined" error using an external binding XML, and now I am hitting an error on [ERROR] Property "Any" is already defined. Use <jaxb:property> to