Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Problem In Saving Push Object List In XML

Problem in saving push object list in XML

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By sakshi , 25 September, 2019
Forums
Gurux DLMS for Java

Hi,

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)

Please help me to get out of it.

I am using gurux.dlms version 3.0.1

sakshi

7 years 1 month ago

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??

Profile picture for user Kurumi

Kurumi

7 years 1 month ago

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

Profile picture for user Kurumi

Kurumi

7 years 1 month ago

Hi,

Hi,

Are you calling this method directly or are you using GXDLMSObjectCollection.save method to save it?

BR,
Mikko

sakshi

7 years 1 month ago

I am calling this method

I am calling this method directly using GXDLMSPushSetup object.

Profile picture for user Kurumi

Kurumi

7 years 1 month ago

Hi,

Hi,

OK. This is the reason. Don't call it directly. Use GXDLMSObjectCollection.save method and it works like should be.

BR,

Mikko

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 10/13/2026 - 12:00
    gurux.dlms.java 4.0.97
  • Tue, 09/22/2026 - 14:02
    Gurux.DLMS.Net 9.0.2609.2201
  • Mon, 09/21/2026 - 10:18
    Gurux.DLMS.Net 9.0.2609.2101
  • Wed, 08/26/2026 - 09:04
    Gurux.DLMS.Python 1.0.203
  • Mon, 08/17/2026 - 11:28
    Gurux.DLMS.Python 1.0.202

New forum topics

  • Association refresh related issue
  • Need RJ45 pin configuration for Saral 300 and Saral 305 Secure meters
  • Query Regarding Class 63 Status Mapping Support in Gurux DLMS Python
  • Inhemeter
  • DLMS Server - Profile Generic - can't add too many items to profile generic capture object - how to set maximum profile entries
More

Who's new

  • amir.jradi
  • JOEBID€N123
  • yogibear
  • Eric@li
  • Asier Sierra
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin