tag:blogger.com,1999:blog-56320472250410769782024-03-13T10:23:54.254-07:00Grokking IsRichard Conwayhttp://www.blogger.com/profile/09555879689052940992noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5632047225041076978.post-87675757833002112932012-08-01T02:04:00.000-07:002012-08-01T02:04:30.484-07:00Work Arounds: Windows Firewall Blocking Java 7 FTP<br />
It appears that Windows firewall is blocking IPv6 (JDK7) and not IPv4 (JDK6).<br />
<br />
When attempting to FTP using a client recently upgraded to Java 7, your FTP will most likely fail with some error similar to the following:<br />
<br />
<br />
<i>java.net.SocketException: Permission denied: recv failed</i><br />
<i><br /></i><br />
<i>ControlChannelIOException: Connection reset</i><br />
<br />
<br />
JDK 7 brings support for IPv6 on Windows. If you are running an app using Java 7, when you attempt to connect to an IPv4 address the new Java 7 JRE will use an IPv4-mapped IPv6 address. This in itself is not a problem. However, it looks like a Windows firewall bug. The firewall has a filter that examines client sockets to FTP servers in order to keep track of incoming data connections from the server. In the case of connecting to IPv4 destinations through IPv6 sockets, it seems to get confused and rejects the PORT and PASV commands - essentially closing the connection after each command is sent.<br />
<br />
For any apps using Java for FTP, this is a HUGE problem. Oracle has analysed the problem and have found that it seems to be a bug in Windows Firewall and/or the IPv6 stack. They managed to replicate the problem with a native C (i.e. non-Java app), so this is strong evidence that the bug is not in Java. They have informed Microsoft, but there is no telling when or if this will every be addressed.<br />
<br />
More details can be found at? http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7077696<br />
<br />
<br />
<b>Work Arounds:</b><br />
<br />
1) Add a firewall exception for the Java binary.<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TESTED: Works with Windows Firewall - but not with Windows Firewall with Advanced Security (Windows 7 Ultimate)<br />
<br />
2) Run the application with java vm argumnet -Djava.net.preferIPv4Stack=true (which disables IPv6 and uses AF_INET sockets exclusively)<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>- In eclipse, modify the run configuration or debug configuration and add the vm argument to the vm arguments<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TESTED: This works in eclipse.<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>- In JNLP, do something like the following:<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span><j2se version="1.6.10+" href="http://java.sun.com/products/autodl/j2se"<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span> java-vm-args="-Djava.net.preferIPv4Stack=true"/><br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TESTED: Does NOT work. Java WebStart does not support passing this vm argument to the client!!!<br />
<br />
3) Disable stateful FTP inspection in the firewall (registry setting or netsh command) by executing the following at a command prompt:<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>netsh advfirewall set global StatefulFTP disable<br />
<br />
Note: Must be executed with administrator rights.<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>TESTED: This works!<br />
<br />
4) Use a different firewall (Symantec firewall works correctly without any special configuration)<br />
<br />
5) Disable Java 7 in your Java Control Panel. Unfortunately this does not appear to work. Even if you disable Java 7 in the control panel - apps are still launched using Java 7! <br />
<br />
5) Roll back to Java 6 which does not use IPV6. Unfortunately, this is easier said than done. See notes below pertaining to Java Web Start Apps.<br />
<br />
6) Switch to using HTTP for file transfers.<br />
<br />
<br />
<b>Special Note: Java 7 and Web Start Apps:</b> <br />
<br />
This is particularly a problem for Web Start apps as there is no way to pass the -Djava.net.preferIPv4Stack=true argument to the client and it is unreasonable to assume every client has admin rights and can run the script to turn off stateful FTP.<br />
<br />
Worse, it appears that you can no longer specify the version of Java to use for your Web Start application. In my testing, specifying an older version of Java (Java 6 release 10 or similar) simply failed to download and install the version. If you specify a more recent version of Java (Oracle releases) you are informed that you should use the latest version of Java (i.e. 7) and if this doesn't work, you can opt to get the older version. It doesn't explain how to obtain and enforce usage of the older version.<br />
<br />
If anyone has a way to resolve this with Java Web Start apps, please let me know!<br />
<br />
<br />
<br />Richard Conwayhttp://www.blogger.com/profile/09555879689052940992noreply@blogger.com10tag:blogger.com,1999:blog-5632047225041076978.post-423562893821248442011-06-09T18:05:00.001-07:002011-06-09T18:18:01.202-07:00On Being EfficientIts funny how your thoughts/beliefs evolve over time. I used to think that multitasking was efficient and I worked hard at being able to multitask efficiently. I've since come to believe that multitasking is only efficient when you are engaged in many processes that do not require deep thought. If you are programming or are involved in any other "deep" thought activity, it is very expensive (time wise and otherwise) to keep switching modes. You are most efficient if you can spend 1, 2 or perhaps even 3 hours deeply focused on the task at hand.<div><br /></div><div>The Energy Project Blog (<a href="http://www.theenergyproject.com/blog">http://www.theenergyproject.com/blog</a>) argues compellingly for 90 minute sprints as being the most efficient/effective. </div><div><br /></div><div>The Four Hour Work Week (<a href="http://www.fourhourworkweek.com/">http://www.fourhourworkweek.com/</a>) also suggests some other valuable time management choices - such as only checking your email twice per day and grouping all calls at the same time. </div><div><br /></div><div>These ideas are not unique, not non-obvious and are not rocket science, but they are effective. Sometimes we just need to remind ourselves of the good habits we should adopt or resume.</div><div><br /></div><div>The challenge is to think critically about all the ideas we encounter and consciously decide which are valid/good and therefore should be adopted - and those which are invalid and should be ignored. </div><div><br /></div><div><br /></div>Richard Conwayhttp://www.blogger.com/profile/09555879689052940992noreply@blogger.com0tag:blogger.com,1999:blog-5632047225041076978.post-87393691408969799262011-06-09T18:00:00.001-07:002011-06-09T18:00:16.894-07:00My Review of Data Persistence in Google App Engine<div class="hreview"><div class="item"><p><a href="http://oreilly.com/catalog/0636920010746">Originally submitted at O'Reilly</a></p><div><img src="http://images.powerreviews.com/images_products/08/60/12735230_100.jpg" class="photo" align="left" style="margin: 0 0.5em 0 0"><p style="margin-top:0"><p>Every application needs data, and cloud-based applications in particular have unique challenges associated with data persistence. In this O'Reilly Breakdown, cloud programmer Dan Pilone takes you through the ins and outs of storing data in the cloud. You'll learn how to interact with Goo... </p></div><a href="http://oreilly.com/catalog/0636920010746" style="display: none;" class="url fn"><span class="fn">Data Persistence in Google App Engine</span></a></div><br clear="left"><p><strong class="summary">Very Helpful</strong></p><div>By <strong>REC</strong> from <strong>Miami, Florida</strong> on <strong><abbr title="201169T1200-0800" class="dtreviewed" style="border: none; text-decoration: none;">6/9/2011</abbr></strong></div><p><div style="margin: 0.5em 0; height: 15px; width: 83px; background-image: url(http://images.powerreviews.com/images/stars_small.gif); background-position: 0px -144px;" class="prStars prStarsSmall"> </div></p><div style="display: none"><span class="rating">4</span>out of 5</div><p><strong>Pros: </strong>Helpful examples, Easy to understand, Accurate</p><p><strong>Cons: </strong>None</p><p><strong>Best Uses: </strong>Novice, Intermediate, Student</p><p><strong>Describe Yourself: </strong>Developer</p><p style="margin-top:1em" class="description">Great introduction to core concepts of the AppEngine and how to persist data to it. Carried out in an easy to follow and comprehend conversational manner. Use of video makes it easy to follow how things are accomplished in Eclipse with the Google AppEngine SDK. Plus you pick up some other useful tricks just watching how he works. <br xmlns:pr="xalan://com.pufferfish.core.beans.xmlbuilders.xsl.Functions"><br>Would be nice to have a searchable transcript of the conversation so you can review it for key terms and references they make to other training, technology and materials.<br><br>Would love a more comprehensive approach - including examples of data validation, use of GWT Designer, binding to Data Grids and more in depth examples of queries (using multiple parameters).</p><p style="margin-top:0.5em">(<a href="http://www.powerreviews.com/legal/terms_of_use.html" rel="license">legalese</a>)</p></div>Richard Conwayhttp://www.blogger.com/profile/09555879689052940992noreply@blogger.com0