Questions tagged [moxy]

MOXy is the object-to-XML and object-to-JSON component of EclipseLink. It is a JAXB (JSR-222) implementation with extensions for supporting: XPath based mapping, JPA entities, and infoset preservation.

MOXy is the object-to-XML and object-to-JSON component of EclipseLink. It is a JAXB (JSR-222) implementation with extensions for supporting: XPath based mapping, JPA entities, and infoset preservation.

868 questions
4
votes
1 answer

MOXy @XmlPath expressions, are they supported?

Are XPath expressions such as the following supported in MOXy? field[XMLtag!='identifier'] Basically I've got XML like this 12345 identifier
james4563
  • 169
  • 1
  • 13
4
votes
1 answer

Custom JSON serialization with Jersey 2.x/MOXy

Im using Jersey 2.x with built in MOXy conversion from JSON<-->POJO inside of an embedded Jetty 9.x server. Is it possible to define a custom JSON (de)serialization routine for specific types (e.g. Joda DateTime) programmatically (without…
user2591854
  • 182
  • 3
  • 15
4
votes
2 answers

How to bind a xml element into an object member variable?

I'm trying to unmarshal an xml to an object using moxy.Below is the sample of the xml. value
value of address
And below is the class I'm trying to…
cgeek
  • 55
  • 9
4
votes
2 answers

Handling Invalid Enums with JAX-RS and MOXy

I am currently attempting to unmarshal a JSON object provided via a REST PUT using Glassfish 4 (which uses Jersery 2.0 and EclipseLink 2.5). The JSON object consists of a several properties including a String value that gets mapped to a Java…
lucasweb
  • 1,736
  • 5
  • 28
  • 42
4
votes
2 answers

A recommended JAX-WS framework for working with Moxy

Currently I'm working with CXF but because of the following code in CXF: // fall back if we're using another jaxb implementation try { riContext = JAXBUtils.createRIContext(contextClasses .toArray(new Class[contextClasses.size()]),…
Avner Levy
  • 6,601
  • 9
  • 53
  • 92
4
votes
1 answer

Set MOXy as JAXB provider programmatically

Can I set a jaxb provider programmatically in a JAVA SE application (not web application)? I'm looking for other approach instead jaxb.properties file with javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
CelinHC
  • 1,857
  • 2
  • 27
  • 36
4
votes
1 answer

JAXB: Intercept during unmarshalling?

I've got a typical web service using JAX-RS and JAXB, and upon unmarshalling I would like to know which setters were explicitly called by JAXB. This effectively lets me know which elements were included in the document provided by the caller. I…
4
votes
0 answers

How to marshall generics?

I have a server application using Java, MOXy and Jersey. Marshalling single objects to JSON works pretty well, when my function returns a list with some objects (List), marshalling also works well. But now I have added a class called…
arnoid72
  • 41
  • 1
  • 3
4
votes
1 answer

How to make Eclipselink's moxy marshal HashMap?

I get the following exception when a method in my jersey application returns a HashMap [Exception [EclipseLink-25003] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.XMLMarshalException Exception…
Salil
  • 9,534
  • 9
  • 42
  • 56
4
votes
1 answer

Using MOXY's JAXB Implementation using annotations based + on the fly mapping

I'm writing a RESTful WS application using RESTEasy library. I've been looking for a way to dynamically modify certain model/xml mapping and found the MOXY's JAXB implementation. The problem is when I specify the MOXY's implementation using the file…
Pdv
  • 147
  • 10
4
votes
1 answer

PropertyException when setting Marshaller property with eclipselink.media-type value: application/json

I'm attempting to follow the example located here but get an javax.xml.bind.PropertyException. I receive this exception because of the following line of code: marshaller.setProperty("eclipselink.media-type", "application/json"); I have literally…
Prmths
  • 2,022
  • 4
  • 21
  • 38
4
votes
1 answer

JAXB throwing InstantiationException trying to marshal xsi:type based on abstract class

I am having an issue with using inheritance and JAXB unmarshalling. I have read the number of examples (specifically a much-reference blog at http://blog.bdoughan.com/2010/11/jaxb-and-inheritance-using-xsitype.html and a very similar SO question…
chooks
  • 694
  • 7
  • 20
4
votes
2 answers

Using @XmlPath with jaxb/MOXy to map complex type

I have a deep XML structure with a lot of pointless wrappers I'm mapping to a single Java class. Mapping the simple datatypes with @XmlPath is a walk in the park, but when it comes to types that actually require their own class I'm not quite sure…
Jakob Pogulis
  • 1,150
  • 2
  • 9
  • 19
4
votes
1 answer

Serializing multidimensional arrays to JSON with JAXB and MOXy

I'm serializing next two-dimensional string array with JAXB/MOXy: @XmlElement(name = "row") @XmlElementWrapper(name = "rows") private String[][] rows; and I want it to be serialized to next JSON: "rows": [ ["1", "2"], ["3","4"], …
GetUsername
  • 1,057
  • 5
  • 18
  • 29
4
votes
1 answer

Exception : "Missing class indicator field from database row [UnmarshalRecordImpl()]." when unmarshalling XML using EclipseLink JAXB (MOXy)

Is it any way to unmarshalling with @XmlDescriminatorNode/@XmlDescrimintatorValue annotations next XML, or any workaround:
Evgeniy Fitsner
  • 946
  • 9
  • 14