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

6 years 10 months 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

6 years 10 months 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

6 years 10 months ago

Hi,

Hi,

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

BR,
Mikko

sakshi

6 years 10 months ago

I am calling this method

I am calling this method directly using GXDLMSPushSetup object.

Profile picture for user Kurumi

Kurumi

6 years 10 months 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

  • Thu, 07/23/2026 - 16:19
    gurux.dlms.java 4.0.96
  • Thu, 07/09/2026 - 14:34
    Gurux.DLMS.Python 1.0.201
  • Fri, 06/26/2026 - 16:32
    Gurux.Service 3.0.2606.2601
  • Wed, 06/24/2026 - 08:36
    Gurux.DLMS.Python 1.0.200
  • Mon, 06/15/2026 - 08:52
    gurux.dlms.c 9.0.2606.1501

New forum topics

  • Service not known error on gprs communication
  • Service not known error on gprs communication
  • Help Needed: Interfacing Saral 100 Energy Meter with Microcontroller via RS232
  • Connecting Meter to Agent via serial
  • Reading block profile with Compact array
More

Who's new

  • Dawsontot
  • Jerrylam
  • qvlLdJweKzGUYaSOVS
  • LindanEt
  • annoyingconsultants
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin