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: 4
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: 469
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: 4
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: 469
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: 267

Currently Online:
13 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 93

pramanj: 86

ibrahim: 69

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 36

Rainer Versteeg: 32

Thomas Reuther: 26

Member Stats:

Guest Posters: 0

Members: 957

Moderators: 13

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 935

Posts: 3932

Newest Members:

mattiee679022481, osvaldolennox12, brandenmallette, mellisafcm, P0001, launastanfill, Oleksandr, Matti Siponen, gselvas92, ashleighfinlay

Moderators: Jouni Aro: 834, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 469, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 18, Markus Johansson: 11, Matti Siponen: 6

Administrators: admin: 0