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 8 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 8 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 8 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 8 months ago

I am calling this method

I am calling this method directly using GXDLMSPushSetup object.

Profile picture for user Kurumi

Kurumi

6 years 8 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

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin