Live only exception with jaxb

Iv got an exception that I can not reproduce locally.
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 16
at com.sun.xml.bind.v2.util.CollisionCheckStack.pushNocheck(CollisionCheckStack.java:102)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:457)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:298)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:226)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:80)
at de.e_nexus.server.i8n.TranslationArtifactExposer.writeMetadata(TranslationArtifactExposer.java:269)
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 16
at com.sun.xml.bind.v2.util.CollisionCheckStack.pushNocheck(CollisionCheckStack.java:102)
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:457)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:298)
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:226)
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:80)
at de.e_nexus.server.i8n.TranslationArtifactExposer.writeMetadata(TranslationArtifactExposer.java:269)
This is the writeMetadata method:
private boolean writeMetadata(final TranslationMavenRelevation o, final ByteArrayOutputStream baos) {
try {
Metadata md = prepareMetadata(o);
md.setVersioning(new Versioning());
TranslationStack stack = o.getStack();

String currentProjectVersion = generateVersionNumber(o, stack);
md.getVersioning().setLatest(currentProjectVersion);
if (fin.isFinal(currentProjectVersion)) {
md.getVersioning().setRelease(currentProjectVersion);
}

List<Version> versions = md.getVersioning().getVersions();
Version e = new Version();
e.setVersion(currentProjectVersion);
versions.add(e);
marshaller.getMetadataMarshaller().marshal(md, baos);
return true;
} catch (JAXBException ex) {
LOG.log(Level.SEVERE, "Can not marshall!", ex);
return false;
}
}
private boolean writeMetadata(final TranslationMavenRelevation o, final ByteArrayOutputStream baos) {
try {
Metadata md = prepareMetadata(o);
md.setVersioning(new Versioning());
TranslationStack stack = o.getStack();

String currentProjectVersion = generateVersionNumber(o, stack);
md.getVersioning().setLatest(currentProjectVersion);
if (fin.isFinal(currentProjectVersion)) {
md.getVersioning().setRelease(currentProjectVersion);
}

List<Version> versions = md.getVersioning().getVersions();
Version e = new Version();
e.setVersion(currentProjectVersion);
versions.add(e);
marshaller.getMetadataMarshaller().marshal(md, baos);
return true;
} catch (JAXBException ex) {
LOG.log(Level.SEVERE, "Can not marshall!", ex);
return false;
}
}
1 Reply
JavaBot
JavaBot8mo ago
This post has been reserved for your question.
Hey @Peter Rader! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Want results from more Discord servers?
Add your server