Introduction:
Customer modified the sample JavaTestClient program from CA to test in their environment. When used as JNI, it worked without issue. When testing as Pure Java, connections errors were seen.
Question:
What does this error mean?
[main] SMERROR: SmServerConnection, connect, Exception calling TCP transport connect: java.nio.channels.UnresolvedAddressException
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress
(Net.java:29)
at sun.nio.ch.SocketChannelImpl.connect
(SocketChannelImpl.java:512)
at com.ca.siteminder.sdk.agentapi.tli.SmAgentTcpTransport.connect
(SmAgentTcpTransport.java:179)
at com.ca.siteminder.sdk.agentapi.connection.SmServerConnection.connect
(SmServerConnection.java:281)
Environment:
Single Sign-On (SiteMinder) SDK Custom Agent
Answer:
The exception is actually from Java and not CA Single Sign-On. From : https://docs.oracle.com/javase/7/docs/api/java/nio/channels/UnresolvedAddressException.html
“Unchecked exception thrown when an attempt is made to invoke a network operation upon an unresolved socket address. “
The exception occurs at sun.nio.ch.Net.checkAddress, as detailed above, when the address being used to connect to is unresolvable. In this case the Policy Server address. It could be an invalid IP address, an unresolvable hostname or a typo in the address.
When the customer reviewed the address they were using, it was found that there was a trailing space after the IP address that does not get trimmed leading to the Java exception.
Additional Information:
None
trailing space after the policy servers ipaddress