Applets from a local http server don't load
978934Dec 14 2012 — edited Dec 17 2012I am using Java7 SDK to compile my Java Applet Code. Same code was perfectly working with Java1.6 JDK and JRE1.6 update 37.
But it stops working when I compile my code with Java7 SDK and on JRE 1.7 update 9.
After spending lot of time I found a bug posted in Oracle site @ http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7184280 which states :
With JRE 1.7, in a local network the communication is in IPv6 and there is a problem in the java code of the JRE which makes that in
this case the applets don't load.
For a workaround we need to add the parameter "-Djava.net.preferIPv4Stack=true" in HTML applet tag.
+<Applet+
style = "position:absolute;border:0px;left:184;top:95;height:180;width:364;"
code = "jtreeviewapplet.JTreeViewAppletMain.class"
name = "TreeView"
id = "TreeView"
hspace = "0"
vspace = "0"
align = "top"
archive = "/Project/HTML/ABC/XYZ.jar,/Project/HTML/ABC/ABC.jar"
MAYSCRIPT>
*+<PARAM NAME="java_arguments" VALUE="-Djava.net.preferIPv4Stack=true">+*
+<PARAM NAME="onSelected" VALUE="onSelect_Handler">+
+<PARAM NAME="onFinishNormalize" VALUE="onFinishNormalize_Handler">+
+</Applet>+
Now after putting this paramete it works.
But the problem here is that we are forcing our client to use IPV4 and we have to do all such changes in all the html file wherever it is applicable.
There are almost 1245 html files , in which we are using applet tag and we have to put this parameter <PARAM NAME="java_arguments" VALUE="-Djava.net.preferIPv4Stack=true"> everywhere in the html.
My questions are:
1) Is this really a java bug?
2) Do we need at all this parameter(-Djava.net.preferIPv4Stack=true) to run our applet.
3) what is the solution to get rid from this problem? I think all this stuff should be handled from java side. Becuase with Java 6 everythings are running.
Could anybody suggest what to do, it would be a great help.