views:

815

answers:

5

Hi,

After an upgrade to XP and Java 1.6 one of our intranet apps is experiencing a problem when running a java applet in the browser. The java applet is a document editor and accepts a parameter to where the document is located. I assume it copies this file to the users machine for editing. I wish I knew more but I don't have the source...dam!

we are getting a java.io.IOException on a machine running XP-IE6-Java 1.6. This problem doesn't happen on our older Win2K-IE6-Java 1.3 so we are certain its isolated to the desktop and not the server (99% sure anyway).

A little info: If you try to run the applet twice in a row, it works the second time. The first time it fails. Also, the error message box appears BEFORE the orange java loading logo appears embedded in the browser.

I have also entered in the following information into the policy file and reloaded the policy file via the console.

grant codeBase "http://intranetserver/*" {
    permission java.security.AllPermission; 
};

here is a dump of the stack trace. Thanks for your time :-)

java.io.IOException: Write error
    at java.io.FileOutputStream.writeBytes(Native Method)
    at java.io.FileOutputStream.write(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.close(Unknown Source)
    at com.docscience.dlstools.browser.editor.HTMLDocumentLoader.loadDocument(HTMLDocumentLoader.java:94)
    at com.docscience.dlstools.browser.editor.HTMLDocumentLoader.loadDocument(HTMLDocumentLoader.java:113)
    at com.docscience.dlstools.browser.editor.HTMLDocumentLoader.loadDocument(HTMLDocumentLoader.java:126)
    at com.docscience.dlstools.browser.editor.dsBrowserEditor.loadPage(dsBrowserEditor.java:1623)
    at com.docscience.dlstools.browser.editor.dsBrowserEditor.loadFile(dsBrowserEditor.java:1873)
    at com.docscience.dlstools.browser.editor.dsBrowserEditor.(dsBrowserEditor.java:201)
    at com.docscience.dlstools.browser.editor.DLSBrowserEditor.init(DLSBrowserEditor.java:38)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
A: 

You say you went from Java v1.3 directly to Java 1.6, have you had a chance to test it at all with Java 1.4 or 1.5? A bit more contextual information would be helpful here.

Natalia
A: 

Well no I haven't tested with those version because they aren't an option. I suppose doing that would help me narrow the problem down a little more.

So far this is a dead end.

Sir Psycho
A: 

Is your code signed or do you rely on the setting in the policy file?

I remember having a similar problem with signed code. I can't remember the exact situation, but it turned out, that the revocation check (or maybe OCSP) setting in Java console (Tab Advanced, Section Security) caused some problems on the first applet start when enabled. SUN states that they both are disabled by default, so you don't run into that problem unless you enable the setting explicitely.

You might have a look and and disable both, maybe it solves the problem, although disabling revocation checking is probably not desired.

Markus
A: 

If you decompile and look at the source of HttpURLConnection, you'll see that the exception occurs when writing to a HTTP cache. See the documentation for that here: http://java.sun.com/javase/6/docs/technotes/guides/net/http-cache.html

You might have to use a debugger to see what exactly happens there and what's the cause.

Michael Borgwardt
+1  A: 

I worked out the problem. Turn off temporary files in the java control panel.

Sir Psycho