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. ClassCastEception With ReadList

ClassCastEception with ReadList

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 enemy235 , 6 April, 2021
Forums
Gurux DLMS for Java

Hi,
I'm having trouble when reading some objects in List. Server is based on gxsimulator.
All attributes can be read alone, but when in list, I got:

class [B cannot be cast to class java.lang.Number ([B and java.lang.Number are in module java.base of loader 'bootstrap')
gurux.dlms.objects.GXDLMSDemandRegister.setValue(GXDLMSDemandRegister.java:578)
gurux.dlms.GXDLMSClient.updateValues(GXDLMSClient.java:1510)
cz.vutbr.client.reader.MyReader.readMyList(MyReader.java:839)

I know, that some values are null in this object, but when every attribute alone works just fine, list should work too.

I noticed that in some other cases, but always the object on server had some values as null.

When dubbugging, i found a value for index 9 (on line 578 in demandregister). EventValue was [7, -28, 12, 6, 7, 21, 56, 8, -1, -1, -60, 0], but for this, there should be only one number.

I have this object:
<GXDLMSDemandRegister>
<LN>1.5.32.27.0.255</LN>
<Access>111133333</Access>
<MethodAccess>00</MethodAccess>
<CurrentAverageValue Type="18">0</CurrentAverageValue>
<LastAverageValue></LastAverageValue>
<Scaler>1.000000</Scaler>
<Unit>0</Unit>
<Status Type="17">0</Status>
<CaptureTime>12/06/2020 21:56:08+01:00</CaptureTime>
<StartTimeCurrent>12/06/2020 21:56:08+01:00</StartTimeCurrent>
<Period>0</Period>
<NumberOfPeriods>0</NumberOfPeriods>
</GXDLMSDemandRegister>

I guess best solution is to make better xml for server with all values specified...

Profile picture for user Kurumi

Kurumi

5 years 2 months ago

Hi,

Hi,

Demand register attribute #9 should be UInt16 and the value that you have tried to update is wrong.
Check your code. I believe that you will found the reason from there.

BR,
Mikko

enemy235

5 years 2 months ago

Hi,

Hi,
can you check list data in this file (log from our client)? https://pastebin.com/qGNsa0r0
It contains association, then reading object one attribute at the time and after that, there is list read with parsing error.

I'm not doing anything to the data. Parsing part is vanilla gurux :)

  • 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