Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_TopicIcon
The restart of the opc ua server using shutdown and start only starts the discovery url but the server url is still inaccessible
September 1, 2025
13:55, EEST
Avatar
Vishwajith
New Member
Members
Forum Posts: 2
Member Since:
September 1, 2025
sp_UserOfflineSmall Offline

Hi,
I have tried to restart the opc ua server in my java application. I invoked the shutdown(1, “Message”) and the start() methods of the prosys sdk to achieve it. Even though the server restart is successful and the server status flip can be seen, the server URI becomes unreachable after the restart(Tried to connect through a UAExpert UAClient). If the connection was preestablished the nodes stay reachable. It keeps us from starting a new connection. It seems to be some issue with improper shutdown and start of the server. But do anyone have any idea on what could be the issue here?

September 1, 2025
15:56, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1067
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

If you know for sure that it will be restarted, you can use .shutdown(1, “Message”, false), then it doesn’t clear nodes (and try to reinitialize nodemanagers). If not, then please try adding server.getAddressSpace().getInstanceDeclarationHierarchyCache().clear(); between shutdown and start and let us know if it helped. Probably we should make SDK do that automatically in the future.

September 2, 2025
15:43, EEST
Avatar
Vishwajith
New Member
Members
Forum Posts: 2
Member Since:
September 1, 2025
sp_UserOfflineSmall Offline

Thanks for the response.

Yes, We tried to stop and start the server using shutdown(1, “Message”) and it is shutting down the server and clearing up the nodemanagers. The reinitialization and start of the server is able to bring back the server to Running state also. Just that the server URI created during the initialization is not reachable. The reinitialization and start is following the same steps followed during the application startup, so that the data set for application identity, servername(OPCUAServer), port, endpoints are all the same.

Endpoints accessible prior to restart of the opcuaserver –
opc.tcp://localhost:5840(default)
opc.tcp://localhost:5840/OPCUAServer
opc.tcp://localhost:5840/OPCUAServer/External

Endpoints accessible post the restart of the opcuaserver –
opc.tcp://localhost:5840(default)

The missing 2 endpoints are present in the discovery URL list object of the UAServer class but not accessible when tried to establish a connection through a client.
The server.getAddressSpace().getInstanceDeclarationHierarchyCache().clear(); or shutdown(1, “Message”, false) did not help here

September 4, 2025
17:28, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1067
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Sorry for a bit late reply. I believe the cause is the 3 endpoints compared to typical 1-2. Can you explain your use-case a bit more? Typically a server only has the base url part (that runs Discovery endpoints only) and then the ServerName-including part. Or sometimes there is no server name and the whole server runs in the base url part. Having more than that would be quite uncommon.

Have you used com.prosysopc.ua.server.UaServer.addEndpoint(String, SecurityMode, UserTokenPolicy…) to add the 3rd? Or the 2nd as well? I have now managed to reproduce that any endpoint added this way wont survive restarting, the one added “naturally” via .setServerName does work.

We will investigate why this happens, though I must note we have a known issue regarding that the .addEndpoint only basically adds alternative Endpointurl, we do not yet support scenarios where the endpoints would have different security settings (thus basically only the modes set to the UaServer apply).

September 4, 2025
18:39, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1067
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

(A bit of investigation…)

IF you used the .addEndpoint (see prev. post), it is possible the following workaround might work. Call the following in sequence for the UaServer:

.shutdown (using ‘true’ or version without the parameter which use true by default)
.init
.addEndpoint
.start

The ‘true’ (either parameter or default from versions without it) will internally call UaServer.close automatically, this resets initialization flag thus UaServer.start would call .init automatically again (if not called manually before it). The .init resets the endpoints to be based on the ServerName, thus any .addEndpoint(s) would be lost.

That at least resolved the scenario I managed to create with using .addEndpoint, however using ‘false’ for the .shutdown did also resolved it, so it is possible your case is something else as you say it didn’t help.

September 5, 2025
10:04, EEST
Avatar
Vishwajith
New Member
Members
Forum Posts: 2
Member Since:
September 1, 2025
sp_UserOfflineSmall Offline

In our use case, we do not actually use the 1st endpoint. We have set the Servername as OPCUAServer which should create the 2nd endpoint and added the 3rd endpoint using the .addendpoint(). Both the endpoints are required for 2 different types of users to access.
Yes we have tried to perform the sequence of operations you mentioned:
.shutdown
.init
.addEndpoint
.start
Along with these steps, we also tried with the setApplicationIdentity prior to calling the init to follow the same process which we use during the application startup. Still the 2nd and 3rd endpoint are inaccessible

September 5, 2025
16:02, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1067
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

What version of the SDK you are using?
Could it be possible to get some sample that reproduces this, e.g. based on the sampleconsoleserver example? If yes, please send it to jsdk-support@prosysopc.com

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 62
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 100
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 773
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1558
Posts: 6567
Newest Members:
willardmackellar, vnedrenie_koPi, shaylaholton205, PhilesiaGen, rosaurathiel524, Arthurobext, stefanmacneil3, ralni, illuminationscanada, PhillipGit
Moderators: Jouni Aro: 1039, Pyry: 1, Petri: 1, Bjarne Boström: 1054, Jimmy Ni: 26, Matti Siponen: 359, Lusetti: 0
Administrators: admin: 1