Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Prosys UPCUA Client 4.2.0 logs NullPointerException during UaClient.connect()
February 5, 2020
12:41, EET
Avatar
John
Member
Members
Forum Posts: 5
Member Since:
February 3, 2020
sp_UserOfflineSmall Offline

Using Prosys UPCUA Client 4.2.0 instead of 4.1.2 logs the following LogRecord:

java.util.logging.LogRecord@28d3767d
WARNING
com.prosysopc.ua.client.UaClient
Could not init TypeDictionary, decoding custom Structures might not work
false
1580898712678
null
null
null
66
com.prosysopc.ua.client.UaClient
connect
60
com.prosysopc.ua.typedictionary.TypeDictionaryException: Cannot init typedictionaries

Cause could be one of the server variable with UserAccessLevel and AccessLevel with invalid data type as stated by UaExpert Client Browser:
Invalid Datatype: Expected OpcUaType_Byte, Received OpcUaType_Boolean

Is this a correct assumption of me?

February 5, 2020
13:35, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

If server fails to return correct datatypes for the basic Attributes, then things can fail. If the server is made with any proper SDK that should never happen.

I would need to see the actual log line output, hard to say almost anything from that LogRecord. And normally the logging backend would be anything else than java util logging (e.g. Log4j2 or logback etc.).

SDK 4.2.0 (https://downloads.prosysopc.com/opcua/Prosys_OPC_UA_SDK_for_Java_4_Release_Notes.html#version-4-2-0) fixes some issue where the new Attributes of OPC UA 1.04 were not fetched for AddressSpace.getNode(…). Additionally it tries to read DataTypeDefinitions (one of the new Attributes) over DataTypeDictionaries (“the old way” of describing them). If all Structures cannot be resolved with DataTypeDefinitions it will revert to reading DataTypeDictionaries.

The logging line that would come out of the LogRecord should list the Structures that could not be resolved (i.e. we need to read how they are encoded/decoded, this information is either provided by the DataTypeDefinitions or DataTypeDictionaries, or both, basically the DataTypeDefinitions is the preferred way, but not yet a lot of servers support that, however the dictionaries can be considered deprecated and probably in the future there will be servers that do support pre-1.04 so we need to start preferring the 1.04 way..)

Additionally it should be mentioned that resolving the structure types is a best-effort attempt. In OPC UA the data is entirely provided by the server and must be exactly correct, otherwise it wont work. We should of course log more, but generally speaking, there is a lot of places that can go wrong, if the model is not made with proper tools, such as UaModeler.

February 7, 2020
11:02, EET
Avatar
John
Member
Members
Forum Posts: 5
Member Since:
February 3, 2020
sp_UserOfflineSmall Offline

The stack trace is:

com.prosysopc.ua.typedictionary.TypeDictionaryException: Cannot init typedictionaries
at com.prosysopc.ua.typedictionary.TypeDictionary.init(SourceFile:366)
at com.prosysopc.ua.client.UaClient.connect(SourceFile:8933)
at com.spgprints.tdp.opcua.OPCUAConnection.connect(OPCUAConnection.java:143)
at com.spgprints.tdp.opcua.log.OPCUAMonitorJob$1.onStart(OPCUAMonitorJob.java:188)
at com.spgprints.tdp.opcua.log.OPCUAMonitorJob.lambda$4(OPCUAMonitorJob.java:716)
at com.spgprints.tdp.opcua.log.OPCUAMonitorJob.lambda$6(OPCUAMonitorJob.java:730)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at com.prosysopc.ua.typedictionary.TypeDictionary.init(SourceFile:1814)
… 12 more

February 7, 2020
15:00, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Is this the same server as in the initial post (i.e. one returning wrong data for (User)AccesssLevel)? Can you tell it’s manufacturer or what SDK that has been used to make it?

Can you check (with UaExpert) all DataTypes, do they _all_ define properly the IsAbstract Attribute either as true or false?

Basically the error would happen if a server incorrectly would just return a Null for this Attribute instead of proper true/false.

We should probably have a better error check in place there (so in that way it is a bug within the SDK), but basically if a server violates some basic assumptions that basically no server has broken before, we might miss a check here and there..

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1468

Posts: 6262

Newest Members:

joliecheney96, digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 322, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1