

17:40, EEST

June 3, 2025

Hi,
I am using the server SDK from ProSys (latest version as of June 2025), running under Java 17. I have created an OPC.UA Server (based on the demo code), and inside IntelliJ, it all works fine.
When I try to run it outside of Intellij, I get an exception like this:
com.prosysopc.ua.server.UaServerException: Failed to initialize server endpoint: opc.tcp://AAAA.BBBB.org:52520/OPCUA/MyServer
at com.prosysopc.ua.server.UaServer.t(SourceFile:2403)
at com.prosysopc.ua.server.UaServer.csy(SourceFile:2418)
at com.prosysopc.ua.server.UaServer.start(SourceFile:2272)
….(some line removed that are not relevant)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: com.prosysopc.ua.stack.common.ServiceResultException: Bad_InternalError (code=0x80020000, description=”2147614720, Unsupported address type”)
at com.prosysopc.ua.stack.transport.tcp.nio.OpcTcpServer.bind(SourceFile:513)
at com.prosysopc.ua.stack.application.Server.bind(SourceFile:232)
at com.prosysopc.ua.server.UaServer.t(SourceFile:2372)
… 14 more
Caused by: java.net.SocketException: Unsupported address type
at java.base/sun.nio.ch.Net.translateToSocketException(Unknown Source)
at java.base/sun.nio.ch.Net.translateException(Unknown Source)
at java.base/sun.nio.ch.Net.translateException(Unknown Source)
at java.base/sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at com.prosysopc.ua.stack.utils.asyncsocket.ListenableServerSocketChannel.bind(SourceFile:139)
at com.prosysopc.ua.stack.utils.asyncsocket.AsyncServerSocket.bind(SourceFile:130)
at com.prosysopc.ua.stack.transport.tcp.nio.OpcTcpServer.bind(SourceFile:490)
I am running outside of IntelliJ using shadowjar (id “com.github.johnrengelman.shadow” version “7.1.2”), gradleVersion = ‘7.3.3’, but I have excluded ProSys jars and jars it depends on from the shadowjar. The classpath is fine, the same classes are available inside Intellj as outside.
If anyone has a clue what is going wrong please give me a hint.
10:02, EEST

April 3, 2012

Hi,
Can you try starting an unmodified sampleconsoleserver example and does it create the same exception? If not then there is some difference vs. your code that you can try to find.
Did you mean on the same machine or different one?
Depending on UaServer.setEnableIPv6(boolean) (default true) we either try to bind to the IPv6 ([::], this also listens on IPv4) or IPv4 wildcard (0.0.0.0) which does listen to all interfaces. If UaServer.setBindAddresses(..) is set (default null) then then those addresses are instead used for binding.
A typical scenario would be if the machine wouldn’t support IPv6 networking, but I think the exception should have different text then in the “Caused by: java.net.SocketException: Unsupported address type” (but that is from java itself, not us).
13:07, EEST

June 3, 2025

Thanks!
Adding UaServer.setEnableIPv6(false) fixed the problem, it works fine when running from a shadowjar.
I did put the sampleconsoleserver into a shadowjar (was my first experiment after I bought ProSys), and it worked fine without UaServer.setEnableIPv6(false), so it is confusing that my main application seems to need it, but only when running in a shadowjar. I ran my main application using all individual jars added to my classpath, and that also worked fine without UaServer.setEnableIPv6(false).
1 Guest(s)
