Remote Console feature through Java applet failing?
I’m working for a customer who’s using IBM blades. Remote access isn’t limited to e.g. SoL but also possible through a Remote Console feature using a Java applet.
After migrating one of my 32bit systems to a fresh 64bit system I suddenly couldn’t use this Remote Console feature any longer. The error message was (leaving it for search engines and help other affected users):
load: class vnc.VncViewer.class not found. java.lang.ClassNotFoundException: vnc.VncViewer.class at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:152) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:447) at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:2880) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.java:1397) at java.lang.Thread.run(Thread.java:619) Caused by: java.net.ConnectException: Network is unreachable at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:525) at sun.net.NetworkClient.doConnect(NetworkClient.java:161) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.http.HttpClient.<init>(HttpClient.java:233) at sun.net.www.http.HttpClient.New(HttpClient.java:306) at sun.net.www.http.HttpClient.New(HttpClient.java:323) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1049) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373) at sun.plugin2.applet.Applet2ClassLoader.getBytes(Applet2ClassLoader.java:458) at sun.plugin2.applet.Applet2ClassLoader.access$000(Applet2ClassLoader.java:46) at sun.plugin2.applet.Applet2ClassLoader$1.run(Applet2ClassLoader.java:126) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:123) ... 6 more Exception: java.lang.ClassNotFoundException: vnc.VncViewer.class
The error message might not be obvious at a glance and that’s why I’m writing about it actually. It’s NOT the:
load: class vnc.VncViewer.class not found.
why it’s failing but instead the real reason for the failure is the:
java.net.ConnectException: Network is unreachable
As you can read in Debian’s Bug Tracking System in bug #560044:
Netbase has recently introduced the sysctl-setting
net.ipv6.bindv6only=1 in /etc/sysctl.d/bindv6only.conf and this setting will probably be the default in squeeze.This setting breaks networking in java, and any traffic will always
result in a “java.net.SocketException: Network is unreachable”.
To quote /etc/sysctl.d/bindv6only.conf:
When disabled, IPv6 sockets will also be able to send and receive IPv4 traffic with addresses in the form ::ffff:192.0.2.1 and daemons listening on IPv6 sockets will also accept IPv4 connections.
When IPV6_V6ONLY is enabled, daemons interested in both IPv4 and IPv6 connections must open two listening sockets.
To work around this issue you can either execute the Java process through "java -Djava.net.preferIPv4Stack=true" or to change the IPv6 behaviour system wide execute "sysctl -w net.ipv6.bindv6only=0". To make this setting permanent across reboots adjust the setting inside /etc/sysctl.d/bindv6only.conf. After applying this workaround the Remote Console should work again.
April 8th, 2010 at 16:25
Just use icedtea6-plugin >= 6b18~pre4-1.
April 8th, 2010 at 18:26
@Torsten:
Thanks for the hint, I wasn’t aware of it. Sadly its limited to xulrunner and doesn’t seem to work reliable for me (have to investigate though).
regards,
-mika-
April 12th, 2010 at 14:08
This also applies to HP iLO / iLO2 remote management applets (remote console, virtual media)
used in their Proliant servers and makes them work again.
April 22nd, 2010 at 20:00
Great tipps! Nice Thx! http://www.koschi.at