premature end of file.


#1

Hello Damencho,

While running the unit tests i got the following exception:

[Fatal Error] :-1:-1: Premature end of file.
java.lang.RuntimeException: Error occured while parsing XML document.
  at net.java.sip.communicator.impl.history.HistoryImpl.getDocumentForFile(HistoryImpl.java:230)
  at net.java.sip.communicator.impl.history.HistoryWriterImpl.createNewDoc(HistoryWriterImpl.java:175)
  at net.java.sip.communicator.impl.history.HistoryWriterImpl.addRecord(HistoryWriterImpl.java:89)
  at net.java.sip.communicator.impl.history.HistoryWriterImpl.addRecord(HistoryWriterImpl.java:63)
  at net.java.sip.communicator.impl.msghistory.MessageHistoryServiceImpl.writeMessage(MessageHistoryServiceImpl.java:440)
  at net.java.sip.communicator.impl.msghistory.MessageHistoryServiceImpl.messageReceived(MessageHistoryServiceImpl.java:411)
  at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl.fireMessageEvent(OperationSetBasicInstantMessagingJabberImpl.java:233)
  at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl.access$500(OperationSetBasicInstantMessagingJabberImpl.java:27)
  at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl$SmackMessageListener.processPacket(OperationSetBasicInstantMessagingJabberImpl.java:313)
  at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader.java:822)
  at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:260)
  at org.jivesoftware.smack.PacketReader.access$100(PacketReader.java:43)
  at org.jivesoftware.smack.PacketReader$2.run(PacketReader.java:72)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
  at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
  at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
  at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:151)
  at net.java.sip.communicator.impl.history.HistoryImpl.getDocumentForFile(HistoryImpl.java:227)
  ... 12 more

I checked the history files in test-msghistory and they didn't seem to contain errors which makes me things there is a concurrent access problem. I guess sync-ing history writes should fix this.

Cheers
Emil


#2

Hi Emil,

The strange thing is that writing to the xml is sync to the Xml Document Object.

damencho

Emil Ivov wrote:

···

Hello Damencho,

While running the unit tests i got the following exception:

[Fatal Error] :-1:-1: Premature end of file.
java.lang.RuntimeException: Error occured while parsing XML document.
    at net.java.sip.communicator.impl.history.HistoryImpl.getDocumentForFile(HistoryImpl.java:230)

    at net.java.sip.communicator.impl.history.HistoryWriterImpl.createNewDoc(HistoryWriterImpl.java:175)

    at net.java.sip.communicator.impl.history.HistoryWriterImpl.addRecord(HistoryWriterImpl.java:89)

    at net.java.sip.communicator.impl.history.HistoryWriterImpl.addRecord(HistoryWriterImpl.java:63)

    at net.java.sip.communicator.impl.msghistory.MessageHistoryServiceImpl.writeMessage(MessageHistoryServiceImpl.java:440)

    at net.java.sip.communicator.impl.msghistory.MessageHistoryServiceImpl.messageReceived(MessageHistoryServiceImpl.java:411)

    at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl.fireMessageEvent(OperationSetBasicInstantMessagingJabberImpl.java:233)

    at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl.access$500(OperationSetBasicInstantMessagingJabberImpl.java:27)

    at net.java.sip.communicator.impl.protocol.jabber.OperationSetBasicInstantMessagingJabberImpl$SmackMessageListener.processPacket(OperationSetBasicInstantMessagingJabberImpl.java:313)

    at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader.java:822)

    at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:260)

    at org.jivesoftware.smack.PacketReader.access$100(PacketReader.java:43)
    at org.jivesoftware.smack.PacketReader$2.run(PacketReader.java:72)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:151)
    at net.java.sip.communicator.impl.history.HistoryImpl.getDocumentForFile(HistoryImpl.java:227)

    ... 12 more

I checked the history files in test-msghistory and they didn't seem to contain errors which makes me things there is a concurrent access problem. I guess sync-ing history writes should fix this.

Cheers
Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net