DocEW
2005-03-31, 09:06:36
Hey,
es hat nicht zufällig jemand von euch Ahnung von PML / JAXB / XML usw.? Habe da ein kleines Problem... ich benutze den PML-Parser von Sun und bekomme immer eine Exception:
DefaultValidationEventHandler: [FATAL_ERROR]: Unexpected end of element {}:ID
Location: line 8 of file:/c:/myxml/query_arrived.xml
javax.xml.bind.UnmarshalException: Unexpected end of element {}:ID
at com.sun.autoid.epcis.xml.impl.runtime.SAXUnmarshallerHandlerImpl.handleEvent(SAX UnmarshallerHandlerImpl.java:551)
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.repo rtError(AbstractUnmarshallingEventHandlerImpl.java:148)
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.repo rtError(AbstractUnmarshallingEventHandlerImpl.java:145)
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.unex pectedLeaveElement(AbstractUnmarshallingEventHandlerImpl.java:162)
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.leav eElement(AbstractUnmarshallingEventHandlerImpl.java:72)
at com.sun.autoid.pmlcore.pml.impl.IDImpl$Unmarshaller.leaveElement(IDImpl.java:229 )
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.reve rtToParentFromLeaveElement(AbstractUnmarshallingEventHandlerImpl.java:343)
at com.sun.autoid.pmlcore.pml.impl.IdentifierTypeImpl$Unmarshaller.leaveElement(Ide ntifierTypeImpl.java:341)
at com.sun.autoid.epcis.xml.impl.runtime.SAXUnmarshallerHandlerImpl.endElement(SAXU nmarshallerHandlerImpl.java:146)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher. dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.autoid.epcis.xml.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImp l.java:142)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm pl.java:131)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm pl.java:136)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm pl.java:145)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm pl.java:163)
at com.sun.autoid.util.XmlParser.unmarshal(XmlParser.java:55)
at com.sun.autoid.pmlcore.pmlparser.PmlParser.unmarshalPML(PmlParser.java:47)
at DOMgui4_PML.xmlToTinyDB.procQuery(xmlToTinyDB.java:58)
at DOMgui4_PML.Server.createConnection(Server.java:68)
at DOMgui4_PML.xmlToTinyDB.main(xmlToTinyDB.java:117)
Die XML-Datei sieht z.B. so aus (ist direkt aus der PML-Spezifikation, sollte also i.O. sein):
<?xml version="1.0" encoding="UTF-8"?>
<pmlcore:Sensor xmlns:pmlcore="urn:autoid:specification:interchange:PMLCore:xml:schema:1"
xmlns:pmluid="urn:autoid:specification:universal:Identifier:xml:schema:1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:autoid:specification:interchange:PMLCore:xml:schema:1
../SchemaFiles/Interchange/PMLCore.xsd">
<pmluid:ID>urn:epc:1:4.16.36</pmluid:ID>
<pmlcore:Observation>
<pmluid:ID>00000001</pmluid:ID>
<pmlcore:DateTime>2002-11-06T13:04:34-06:00</pmlcore:DateTime>
<pmlcore:Command>READ_PALLET_TAGS_ONLY</pmlcore:Command>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.400</pmluid:ID>
</pmlcore:Tag>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.401</pmluid:ID>
</pmlcore:Tag>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.402</pmluid:ID>
</pmlcore:Tag>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.403</pmluid:ID>
</pmlcore:Tag>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.404</pmluid:ID>
</pmlcore:Tag>
</pmlcore:Observation>
</pmlcore:Sensor>
es hat nicht zufällig jemand von euch Ahnung von PML / JAXB / XML usw.? Habe da ein kleines Problem... ich benutze den PML-Parser von Sun und bekomme immer eine Exception:
DefaultValidationEventHandler: [FATAL_ERROR]: Unexpected end of element {}:ID
Location: line 8 of file:/c:/myxml/query_arrived.xml
javax.xml.bind.UnmarshalException: Unexpected end of element {}:ID
at com.sun.autoid.epcis.xml.impl.runtime.SAXUnmarshallerHandlerImpl.handleEvent(SAX UnmarshallerHandlerImpl.java:551)
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.repo rtError(AbstractUnmarshallingEventHandlerImpl.java:148)
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.repo rtError(AbstractUnmarshallingEventHandlerImpl.java:145)
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.unex pectedLeaveElement(AbstractUnmarshallingEventHandlerImpl.java:162)
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.leav eElement(AbstractUnmarshallingEventHandlerImpl.java:72)
at com.sun.autoid.pmlcore.pml.impl.IDImpl$Unmarshaller.leaveElement(IDImpl.java:229 )
at com.sun.autoid.epcis.xml.impl.runtime.AbstractUnmarshallingEventHandlerImpl.reve rtToParentFromLeaveElement(AbstractUnmarshallingEventHandlerImpl.java:343)
at com.sun.autoid.pmlcore.pml.impl.IdentifierTypeImpl$Unmarshaller.leaveElement(Ide ntifierTypeImpl.java:341)
at com.sun.autoid.epcis.xml.impl.runtime.SAXUnmarshallerHandlerImpl.endElement(SAXU nmarshallerHandlerImpl.java:146)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher. dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.autoid.epcis.xml.impl.runtime.UnmarshallerImpl.unmarshal(UnmarshallerImp l.java:142)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm pl.java:131)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm pl.java:136)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm pl.java:145)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerIm pl.java:163)
at com.sun.autoid.util.XmlParser.unmarshal(XmlParser.java:55)
at com.sun.autoid.pmlcore.pmlparser.PmlParser.unmarshalPML(PmlParser.java:47)
at DOMgui4_PML.xmlToTinyDB.procQuery(xmlToTinyDB.java:58)
at DOMgui4_PML.Server.createConnection(Server.java:68)
at DOMgui4_PML.xmlToTinyDB.main(xmlToTinyDB.java:117)
Die XML-Datei sieht z.B. so aus (ist direkt aus der PML-Spezifikation, sollte also i.O. sein):
<?xml version="1.0" encoding="UTF-8"?>
<pmlcore:Sensor xmlns:pmlcore="urn:autoid:specification:interchange:PMLCore:xml:schema:1"
xmlns:pmluid="urn:autoid:specification:universal:Identifier:xml:schema:1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:autoid:specification:interchange:PMLCore:xml:schema:1
../SchemaFiles/Interchange/PMLCore.xsd">
<pmluid:ID>urn:epc:1:4.16.36</pmluid:ID>
<pmlcore:Observation>
<pmluid:ID>00000001</pmluid:ID>
<pmlcore:DateTime>2002-11-06T13:04:34-06:00</pmlcore:DateTime>
<pmlcore:Command>READ_PALLET_TAGS_ONLY</pmlcore:Command>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.400</pmluid:ID>
</pmlcore:Tag>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.401</pmluid:ID>
</pmlcore:Tag>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.402</pmluid:ID>
</pmlcore:Tag>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.403</pmluid:ID>
</pmlcore:Tag>
<pmlcore:Tag>
<pmluid:ID>urn:epc:1:2.24.404</pmluid:ID>
</pmlcore:Tag>
</pmlcore:Observation>
</pmlcore:Sensor>