moxy

How to handle java.util.Date with MOXy bindings file

这一生的挚爱 提交于 2021-02-20 17:55:52
问题 i'm new to MOXy and JaxB in general and I'm facing a problem with java.util.Date conversion. I'm unmarshaling an XML file (which I have no control of) to objects using a mapping file (I can neither manually annotate existing classes nor change them). My XML mapping file looks like this : <?xml version="1.0"?> <xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" version="2.1"> <java-types> <java-type name="Observation"> <xml-type prop-order="date theoricalTime ci ch cr

How to handle java.util.Date with MOXy bindings file

♀尐吖头ヾ 提交于 2021-02-20 17:54:19
问题 i'm new to MOXy and JaxB in general and I'm facing a problem with java.util.Date conversion. I'm unmarshaling an XML file (which I have no control of) to objects using a mapping file (I can neither manually annotate existing classes nor change them). My XML mapping file looks like this : <?xml version="1.0"?> <xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" version="2.1"> <java-types> <java-type name="Observation"> <xml-type prop-order="date theoricalTime ci ch cr

How do I configure Glassfish 5 to use Moxy as the default Provider?

不问归期 提交于 2021-02-20 02:20:19
问题 I’m migrating our web application from Glassfish 3 to Glassfish 5, and during the migration I ran across this error for a request. [2019-09-17T15:57:30.732-0600] [glassfish 5.0] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=241 _ThreadName=http-listener-2(27)] [timeMillis: 1568757450732] [levelValue: 900] [[ StandardWrapperValve[ClientControllers]: Servlet.service() for servlet ClientControllers threw exception java.lang.ClassCastException: [Z cannot be cast to [Ljava.lang.Object; at

How do I configure Glassfish 5 to use Moxy as the default Provider?

不想你离开。 提交于 2021-02-20 02:20:06
问题 I’m migrating our web application from Glassfish 3 to Glassfish 5, and during the migration I ran across this error for a request. [2019-09-17T15:57:30.732-0600] [glassfish 5.0] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=241 _ThreadName=http-listener-2(27)] [timeMillis: 1568757450732] [levelValue: 900] [[ StandardWrapperValve[ClientControllers]: Servlet.service() for servlet ClientControllers threw exception java.lang.ClassCastException: [Z cannot be cast to [Ljava.lang.Object; at

Ignoring DTDs when unmarshalling with EclipseLink MOXy

半世苍凉 提交于 2020-02-24 03:35:52
问题 When trying to unmarshall some XML into a POJO using EclipseLink MOXy I'm getting a FileNotFoundException where it's looking for the document's DTD as a relative path. Exception in thread "main" org.springframework.oxm.UnmarshallingFailureException: JAXB unmarshalling exception; nested exception is javax.xml.bind.UnmarshalException - with linked exception: [java.io.FileNotFoundException: C:\Users\deejay\Documents\workspace-sts-3.0.0.RELEASE\moxy-test\ieee_idams_exchange.dtd (The system cannot

Not able to configure Moxy using JAXB

六眼飞鱼酱① 提交于 2020-02-21 13:39:45
问题 I am using Moxy Implementation of JAXB in my codeset and trying to create paths using @XMLPath but it seems to be not working. I have a Spring bassed Project and I have created jaxb.properties under /project/WEB/src/main/resources having content : javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory My classes are placed under /project/WEB/src/main/java I have configured my pom.xml to download the dependancy. persistence.moxy --> <dependency> <groupId>org.eclipse

Filtering out elements based on sub elements with XMLStreamReader and StreamFilter

独自空忆成欢 提交于 2020-01-24 15:36:09
问题 I want to do something similar to XMLStreamReader example @BlaiseDoughan gave in his response to JAXB filtered parsing however I need to make the filtering decision based on sub elements not current node attributes. XMLStreamReader does not have a peek API like XMLEventReader. For example, I want to unmarshall the following XML into a Gump object whose records list ends up only containing 1 item, the record whose associated name does not start with "Filtered-". I'm using Eclipselink 2.3

Filtering out elements based on sub elements with XMLStreamReader and StreamFilter

半城伤御伤魂 提交于 2020-01-24 15:36:08
问题 I want to do something similar to XMLStreamReader example @BlaiseDoughan gave in his response to JAXB filtered parsing however I need to make the filtering decision based on sub elements not current node attributes. XMLStreamReader does not have a peek API like XMLEventReader. For example, I want to unmarshall the following XML into a Gump object whose records list ends up only containing 1 item, the record whose associated name does not start with "Filtered-". I'm using Eclipselink 2.3

Is it possible to use @XmlInverseReference where object and property are of same type?

前提是你 提交于 2020-01-24 13:08:08
问题 I'm using the MOXy JAXB implementation and make quite extensive use of the @XmlInverseReference annotation. However, I've recently encountered a scenario where this approach doesn't seem to work. If I have a class containing a field with a property that's the same type as the parent class, applying @XmlInverseReference seems to suppress the marshalling of that property altogether. Omitting the annotation yields a predictable StackoverflowException. Has anybody encountered this problem and

Dynamic JAXB support to convert XML to JSON

你离开我真会死。 提交于 2020-01-16 03:25:50
问题 I am using eclipse link(v2.5.0) Dynamic JAXB to convert XML to JSON and viceversa. customer.xsd <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="address" type="address"/> <xs:element name="customer" type="customer"/> <xs:complexType name="address"> <xs:sequence> <xs:element name="city" type="xs:string" minOccurs="0"/> <xs:element name="street" type="xs:string" minOccurs="0"/> <xs:element name="type"