XMLStreamException :Trying to output second root, StaXparser
Asked Answered
E

0

6
writer.writeStartElement(startElement.getName().getLocalPart());

//when i run on standalone machine with one thread, it works fine, but when i run the multiple jobs with multiple threads on the server it gives me the following error at

writer.writeStartElement(startElement.getName().getLocalPart());

javax.xml.stream.XMLStreamException: Trying to output second root, <element>

ERROR [STDERR] (JBossQuartzScheduler_Worker-4) javax.xml.stream.XMLStreamException:
 Trying to output second root, <handset>
ERROR [STDERR] (JBossQuartzScheduler_Worker-4)  at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1473)
ERROR [STDERR] (JBossQuartzScheduler_Worker-4)  at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1480)
ERROR [STDERR] (JBossQuartzScheduler_Worker-4)  at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1508)
ERROR [STDERR] (JBossQuartzScheduler_Worker-4)  at com.ctc.wstx.sw.BaseNsStreamWriter.checkStartElement(BaseNsStreamWriter.java:444)
ERROR [STDERR] (JBossQuartzScheduler_Worker-4)  at com.ctc.wstx.sw.BaseNsStreamWriter.writeStartElement(BaseNsStreamWriter.java:292)
Eusebioeusebius answered 26/3, 2013 at 19:17 Comment(3)
Are you using the same XMLStreamWriter in more than one thread with no synchronization? That's pretty much guaranteed to fail, or at least mangle the XML.Cota
thanks for your reply. yeah, but iam executing as different jobsEusebioeusebius
i have posted my codeEusebioeusebius

© 2022 - 2024 — McMap. All rights reserved.