Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

ArrayIndexOutOfBoundsException from JAXB when serializing ALS model #317

Closed
srowen opened this issue Sep 20, 2016 · 2 comments
Closed

ArrayIndexOutOfBoundsException from JAXB when serializing ALS model #317

srowen opened this issue Sep 20, 2016 · 2 comments
Assignees
Milestone

Comments

@srowen
Copy link
Member

srowen commented Sep 20, 2016

Strange JAXB exception when serializing a bunch of model IDs in ALS:

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 163
        at com.sun.xml.bind.v2.runtime.output.Encoded.setEscape(Encoded.java:151)
        at com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.doText(UTF8XmlOutput.java:321)
        at com.sun.xml.bind.v2.runtime.output.UTF8XmlOutput.text(UTF8XmlOutput.java:305)
        at com.sun.xml.bind.v2.runtime.output.IndentingUTF8XmlOutput.text(IndentingUTF8XmlOutput.java:157)
        at com.sun.xml.bind.v2.runtime.XMLSerializer.text(XMLSerializer.java:406)
        at com.sun.xml.bind.v2.runtime.property.ArrayReferenceNodeProperty.serializeListBody(ArrayReferenceNodeProperty.java:110)
        at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:159)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:361)
        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsXsiType(XMLSerializer.java:696)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.serializeItem(ArrayElementNodeProperty.java:69)
        at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.serializeListBody(ArrayElementProperty.java:172)
        at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.serializeBody(ArrayERProperty.java:159)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeBody(ClassBeanInfoImpl.java:361)
        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsSoleContent(XMLSerializer.java:593)
        at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.serializeRoot(ClassBeanInfoImpl.java:342)
        at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:494)
        at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323)
        at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251)
        at oryx.org.jpmml.model.JAXBUtil.marshal(JAXBUtil.java:102)
        at oryx.org.jpmml.model.JAXBUtil.marshalPMML(JAXBUtil.java:90)
        at com.cloudera.oryx.common.pmml.PMMLUtils.write(PMMLUtils.java:79)
        at com.cloudera.oryx.ml.MLUpdate.buildAndEval(MLUpdate.java:320)
...
@srowen srowen added this to the 2.1.3 milestone Sep 20, 2016
@srowen
Copy link
Member Author

srowen commented Sep 20, 2016

Villu notes that this can be resolved by using MOXy instead of the default JAXB. impl More on this to come.

@srowen
Copy link
Member Author

srowen commented Sep 20, 2016

With this change, you can enable MOXy to work around this with -Djavax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory

@srowen srowen closed this as completed Sep 20, 2016
@srowen srowen self-assigned this Sep 20, 2016
srowen added a commit to srowen/oryx that referenced this issue Sep 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant