Java 7, Cisco AnyConnect, and SocketExceptions

This post is probably irrelevant to most readers, but I’m putting it online in the hope it saves someone hours of hair-pulling…

I’ve been holding off upgrading to Java 7 as every time I tried, I’d run into annoying issues preventing me from working. In particular, I was running into the issues discussed here. I thought I’d try again today with Java 7u1, but unfortunately immediately had the same issue. As in the previous link, my situation is that I need to use Cisco AnyConnect VPN client to connect to VPNs, and when I was attempting to pull down a remote file, I was getting the following exception:

ERROR:java.net.SocketException: Permission denied: connect
java.net.SocketException: Permission denied: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:316)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:177)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:164)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:154)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:390)
at java.net.Socket.connect(Socket.java:578)
at java.net.Socket.connect(Socket.java:527)
at java.net.Socket.(Socket.java:424)
at java.net.Socket.(Socket.java:279)

After spending many hours working through suggestions made on Google, I finally discovered the fix. It turns out that by disabling IPv6 in the VPN properties in Windows, the issue goes away. Here is the screenshot of how my properties dialog looks in Windows after making the change:

I hope this helps!

Dell, and how not to create online forms for addresses

I just purchased a new Dell laptop. I quite like Dell, but their online process leaves a little to be desired, as shown in the image below:

Why are there only four ‘State and Country’ options, those being Auckland, Christchurch, Rotorua (?) and Wellington? I conveniently don’t belong to any of those ‘states’, although I do live in Palmerston North, which is located in New Zealand.

I actually had to ring Dell up, wait on their phone system for 10 minutes, and then be told “I always tell people Michael Dell didn’t study his geography – just choose Wellington”. I then asked – how do I specify Palmerston North – she wasn’t sure – so I just added it in the line above my suburb.

My order is now being shipped to:

3a Huata Place
Palmerston North
Riverdale
Jonathan Giles-Ph:06 3551198
4410
Wel , New Zealand

Which is some frankenstein city that spans over 200 kilometres. Additionally, my suburb (Riverdale) now subsumes my city (Palmerston North), which are both subsumed by the fact they are apparently located in ‘Wel’, New Zealand.

Ah well, here’s hoping it turns up here…but if anyone sees a lost looking courier in the next few weeks, can you point them my way?

How to win $1000

I’ve mentioned in the past that I listen to The Rock when working, as it’s possible to pick up their Auckland broadcast online here. I can’t pick them up locally as there is no reception. I always found it curious how they have a ticker on their page that shows the currently playing song. Also curious is that it would quite frequently be out of sync with the song I was listening to. Clearly the music was being streamed and cached on my computer.

The Rock has a ‘no repeat workday’ where they’ll give $1000 to the first person who rings up to tell them of a repeated song. This week they are doing a guaranteed repeat each day.

I wondered if the website was exposing any additional data that could either tell me the schedule of songs (highly unlikely) or at least give me the currently playing song, to get me on a level playing field with the rest of the radio-listening population.

What I ended up doing was writing a very short Java program (yes, it could probably be written in one line of Ruby or Perl but I’m a Java programmer). It isn’t supposed to actually be used, but it does work as expected – it tells me the currently playing song, and warns me when a song is repeated. I don’t recommend you actually use it (I certainly won’t be), but it’s there for your personal education.

The code is as follows (I recommend you click the ‘view plain’ link if you see the formatted Java code):