Most software professionals working remotely have to connect to the network using Cisco Anyconnect VPN connection.
If you are one among them and if you run into an issue with running programs that connect and retrieve
data from corporate network, please read on for solution.
If you are connected to your corporate network over cisco anyconnect vpn connection, there are
occassions when you might run into database connection issues, zookeeper connection issues or just
socket connection issues in general. The database connection error usually reads:
Could not connect to your database alias; the exact message was:
Cannot connect to database. Check your URL
Listener refused the connection with the following error:
ORA-12514,TNS:listener does not currently know of service requested in connect descriptor
The Connection descriptor used by the client was:xxx
Do you want to try again?
Programs attempting to establish a zookeeper connection to retrieve data would display below error:
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /Root/Node at org.apache.zookeeper.KeeperException.create(KeeperException.java:90)
In general programs run by java might get below exception:
ERROR: java.net.SocketException: Permission denied: connect
at java.net.DualStackPlainSocketImpl.connect0(Native method)
But you would be able to connect to the network and access other resources perfectly fine. So, what could be wrong?
Whenever there is a connection issue running programs over cisco anyconnect VPN connection, please check
the version of java used for running these programs. There is apparently an issue with the java 7 and cisco
anyconnect vpn connection. Java 7 socket channel packages have been updated with new firewall and
security checks that have been causing issues with several VPN connectivity softwares. It is very much possible
that Cisco anyconnect VPN is also failing because of the same issue. We recommend switching back over to Java 6
and reattempt the connection again. Remember to change JAVA_HOME as well as the PATH environment variables.
Close out all programs, disconnect from VPN and connect again. Now retry the database connection or programs
pulling data over socket connection. It should start working again. Cheers!
If you absolutely need to run with Java 7, there is still an alternative solution. Go to control panel and open
up your network and sharing center. Click on change adapter settings. Right click on "Cisco AnyConnect VPN Client Connection"
and choose properties. Uncheck the "Internet Protocol Version 6 (TCP/IPV6) here. It should look like below screenshot:
Once this update is done. Restart your computer and connect to VPN again. Now your programs should be able to connect without any issues. Enjoy!