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
Discrepancy in Package Imports when generating Server separate from Client / Common
November 8, 2024
14:28, EET
Avatar
in-fke
Member
Members
Forum Posts: 36
Member Since:
June 8, 2016
sp_UserOfflineSmall Offline

With SDK 4 I used to have code generation like this:
1. Client Code generates with target common,client_base,client_impl
2. Server Code generates with target server_base,server_impl

When I try this with SDK 5 – I get the problem:
1. com.prosysopc.ua.types.di.server.BlockTypeNodeBase tries to import com.prosysopc.ua.types.di.BlockType (missing out the “objecttypes” sub-package)
2. but under #1, the FQCN is com.prosysopc.ua.types.di.objecttypes.BlockType
3. also the namespaceMapping was somehow required, so I declared mapping from http://opcfoundation.org/UA/DI/ to com.prosysopc.ua.types.di

When I try the the following with SDK 5 – it works:
Use target “all”:
1. com.prosysopc.ua.types.di.objecttypes.server.BlockTypeNodeBase imports com.prosysopc.ua.types.di.objecttypes.BlockType
2. as before,the FQCN is com.prosysopc.ua.types.di.objecttypes.BlockType, so this import works

Could not find anything related under https://downloads.prosysopc.com/opcua/Prosys_OPC_UA_SDK_for_Java_4_To_5_Migration_Guide.html#code-generator
Also looked into prosys-opc-ua-sdk-for-java-5.2.6-151-client-server-binary/codegen/Prosys_OPC_UA_SDK_for_Java_Codegen_Manual.html#generation-targets

As for now, I will probably move to generating all code at once using targets “all”.

November 8, 2024
15:22, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1028
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Can you doublecheck that the namespaceMappings configuration is exactly identical in both 1&2 (other than the targets part)?

Hmm.. seems the migration guide misses this part (we might add in the future), but the Codegen Manual section 4.3.2. ‘Namespace Mapping Parameters’ at least does mention

Starting from 5.0.0, a separate subpackage is used for each NodeClass, by default. This can be disabled by setting nodeClassSpecificPackageNames as false. For example, for the Device Information (DI) model, the configuration could look like:


<namespaceMappings>

<namespaceMapping>
<uri>http://opcfoundation.org/UA/DI…..ri&gt;
<packageName>com.prosysopc.ua.types.di</packageName>
<prefix>Di</prefix>
<nodeClassSpecificPackageNames>false</nodeClassSpecificPackageNames>
</namespaceMapping>


(EDIT: we really need a better tool for code snippets here… anyway while the ‘uri’ above looks a bit funny I think the example is still somewhat clear)

That fixed some issues with some information models using the same BrowseName for DataTypes and VariableTypes, which caused generation issues in the past (thus enabled by default).

If you happened to have different values for nodeClassSpecificPackageNames in 1 and 2 it would have caused that. If they are identical then it is most likely a bug.

P.S.
I think (but cannot fully remember) we did require the namespaceMapping already before 5.x since the DI, ADI, PLCOpen internal hardcodings were removed. In practice since applications should generate them, since those move faster than the SDK and/or they do not contain UA Method implementations they also kinda should be in your applications namespaces, not something we hardcode.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 724

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1526

Posts: 6457

Newest Members:

forrestdilke5, ernestoportus31, martin123, rickie5305, shaylamaggard4, rickyjuarez140, jonathonmcintyre, fannielima, kristiewinkle8, rust

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1028, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1