I am trying to save pushObjectList in xml using save method of GXDLMSPushSetup. But it is giving exception as follows.
java.lang.NullPointerException
at gurux.dlms.objects.GXXmlWriter.appendSpaces(GXXmlWriter.java:110)
at gurux.dlms.objects.GXXmlWriter.writeStartElement(GXXmlWriter.java:131)
at gurux.dlms.objects.GXDLMSPushSetup.save(GXDLMSPushSetup.java:484)
at le.dlms.client.LEDLMSData.readPushSetup(LEDLMSData.java:682)
at le.dlms.client.RunDLMS.main(RunDLMS.java:131)
I have saved xml by adding writer.writeStartDocument(); line in save method of GXDLMSPushSetup.
But now i am getting exception while loading this xml.
It gives exception of invalid call of getName.
java.lang.IllegalStateException: Illegal to call getName() when event type is START_DOCUMENT. Valid states are START_ELEMENT, END_ELEMENT2019-09-25 16:20:27 INFO GXDLMSReader:128 - DisconnectRequest
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getName(Unknown Source)
at gurux.dlms.objects.GXXmlReader.getName(GXXmlReader.java:129)
at gurux.dlms.objects.GXXmlReader.readElementContentAsInt(GXXmlReader.java:201)
at gurux.dlms.objects.GXXmlReader.readElementContentAsInt(GXXmlReader.java:195)
at gurux.dlms.objects.GXDLMSPushSetup.load(GXDLMSPushSetup.java:458)
at le.dlms.client.LEDLMSData.readPushSetup(LEDLMSData.java:650)
at le.dlms.client.RunDLMS.main(RunDLMS.java:131)
We have tested this with a few meters but it works without problems. Content of the data must be different.
Can you read push object of your meter with GXDLMSDirector. After reading the push object,
select Push object from the tree and press the right mouse button. Select "Save values as..." and save read push list to the meter.
Hi
Hi
I have saved xml by adding writer.writeStartDocument(); line in save method of GXDLMSPushSetup.
But now i am getting exception while loading this xml.
It gives exception of invalid call of getName.
java.lang.IllegalStateException: Illegal to call getName() when event type is START_DOCUMENT. Valid states are START_ELEMENT, END_ELEMENT2019-09-25 16:20:27 INFO GXDLMSReader:128 - DisconnectRequest
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getName(Unknown Source)
at gurux.dlms.objects.GXXmlReader.getName(GXXmlReader.java:129)
at gurux.dlms.objects.GXXmlReader.readElementContentAsInt(GXXmlReader.java:201)
at gurux.dlms.objects.GXXmlReader.readElementContentAsInt(GXXmlReader.java:195)
at gurux.dlms.objects.GXDLMSPushSetup.load(GXDLMSPushSetup.java:458)
at le.dlms.client.LEDLMSData.readPushSetup(LEDLMSData.java:650)
at le.dlms.client.RunDLMS.main(RunDLMS.java:131)
What to do??
Hi,
Hi,
We have tested this with a few meters but it works without problems. Content of the data must be different.
Can you read push object of your meter with GXDLMSDirector. After reading the push object,
select Push object from the tree and press the right mouse button. Select "Save values as..." and save read push list to the meter.
Send saved xml file to me by email.
BR,
Mikko
Hi,
Hi,
Are you calling this method directly or are you using GXDLMSObjectCollection.save method to save it?
BR,
Mikko
I am calling this method
I am calling this method directly using GXDLMSPushSetup object.
Hi,
Hi,
OK. This is the reason. Don't call it directly. Use GXDLMSObjectCollection.save method and it works like should be.
BR,
Mikko