This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Build 200411072021 1) Have a Java project in a directory with space 2) Have an applet 3) Run applet (use Run file action) 4) ERROR: run-applet target fails with: I/O exception while reading: D:\NetBeans\...\A%20L\JavaLibrary2\build\ClickMe.html (The system cannot find the path specified)
Works on JDK 1.4.2 but not on JDK 5.0
I can reproduce this. When running with verbose output from ant it is visible that executed command is: java -classpath "/usr/local/home/radim/Java Applet/build/classes sun.applet.AppletViewer file:/usr/local/home/radim/Java%20Applet/build/Main.html Command that works is unescaped URL: java -classpath "/usr/local/home/radim/Java Applet/build/classes" sun.applet.AppletViewer "file:///usr/local/home/radim/Java Applet/build/Main.html" So it looks like regression in AppletViewer. Please file a bug with decsription to Sun's bug tracking system. Possible workaround is to pass only file path (absolute). It works on tiger and probably on JDK1.4.2 too.
Filed jdk bug 6193279. Decoded URL passed to appletviewer works fine on JDK 1.4.2_06, 1.5.0 FCS and 1.5.0_01-ea-b04 - sounds like good workaround.
Created attachment 18824 [details] Patch with workaround for JDK1.5
Provided patch needs to be applied as soon as possible to trunk and later on QE request to release40 branch. Karle, please take care! It is show-stopper for release40! Wrong assignment to (non-existing) applet module changed to java module.
The attached patch should be changed. The logic of handling the URL should be done in generateAppletHTML ()
Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java,v <-- AppletSupport.java new revision: 1.4; previous revision: 1.3 done Processing log script arguments... More commits to come... Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.41; previous revision: 1.40 done Processing log script arguments... More commits to come... RCS file: /cvs/java/j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/applet/AppletSupportTest.java,v done Checking in j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/applet/AppletSupportTest.java; /cvs/java/j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/applet/AppletSupportTest.java,v <-- AppletSupportTest.java initial revision: 1.1 done
Jesse could you do a review of this issue? http://www.netbeans.org/source/browse/java/j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java.diff?r1=text&tr1=1.3&r2=text&tr2=1.4&f=h http://www.netbeans.org/source/browse/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl.diff?r1=text&tr1=1.40&r2=text&tr2=1.41&f=h
Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.42; previous revision: 1.41 done
New patch of build-impl.xsl http://www.netbeans.org/source/browse/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl.diff?r1=text&tr1=1.40&r2=text&tr2=1.42&f=h
Two problems. 1. Still awaiting a clearer description in the JDK bug report. Preferably with concrete steps to reproduce in 1.5 (but not in 1.4) using a file with spaces in its path (but not without). The example URL given in the bug report currently is bogus. 2. Checking for the JDK version in the action provider is incorrect. The user may have configured a nondefault platform. The action provider must check for the version of the project's target JDK.
The first, I don't know exactly what happend in appletviewer. But as I tried it, it seems that the appletviewer on the jdk 1.5 does not accept encoded URLs. The second is easy to fix.
Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java,v <-- J2SEActionProvider.java new revision: 1.33; previous revision: 1.32 done Processing log script arguments... More commits to come... Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java,v <-- AppletSupport.java new revision: 1.5; previous revision: 1.4 done Processing log script arguments... More commits to come... Checking in j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/applet/AppletSupportTest.java; /cvs/java/j2seproject/test/unit/src/org/netbeans/modules/java/j2seproject/applet/AppletSupportTest.java,v <-- AppletSupportTest.java new revision: 1.2; previous revision: 1.1 done
Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java,v <-- AppletSupport.java new revision: 1.6; previous revision: 1.5 done
Updated the diff URLs: http://www.netbeans.org/source/browse/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java.diff?r1=text&tr1=1.32&r2=text&tr2=1.33&f=h http://www.netbeans.org/source/browse/java/j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java.diff?r1=text&tr1=1.3&r2=text&tr2=1.5&f=h http://www.netbeans.org/source/browse/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl.diff?r1=text&tr1=1.40&r2=text&tr2=1.42&f=h
Those diffs look OK to me.
Fix is OK for applet running, but doesn't work for applet debugging (Debug file action). Reopenening.
This is a bit different issue. But it should be fixed to. The problem is that debug macro passes arguments as a line. This causes that file with spaces is handled as more different args.
There are two solutions how to handle this. Either change: -<j2seproject:debug xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/2" args="${applet.url}" classname="sun.applet.AppletViewer"/> +<j2seproject:debug xmlns:j2seproject="http://www.netbeans.org/ns/j2se-project/2" args='"${applet.url}"' classname="sun.applet.AppletViewer"/> Ugly Or not use j2seproject:debug for applet debugging. Even worse. have you any other ideas?
Re. "args='"${applet.url}"'" - I tried that on Windows and it works fine. I prefer this solution rather then duplicating body of the -init-macrodef-debug target just for applet debugging.
The '""' escaping is ugly but probably better then to copy the whole macro.
*** Issue 51433 has been marked as a duplicate of this issue. ***
Fixing problem with applet debugging: Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.44; previous revision: 1.43 done
Additional patch for applet debugging. It has to be applied in addition to patches above. http://www.netbeans.org/source/browse/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl.diff?r1=1.43&r2=1.44
I'm not comfortable with this fix. Maybe I'm missing something obvious here, but why is the macro <j2seproject:debug> using <attribute name="args" default="${application.args}"/> <!-- ... --> <arg line="@{args}"/> at all? <arg line="..."/> is inherently unsafe. <j2seproject:java> uses <element name="customize" optional="true"/> <!-- ... --> <customize/> and it works fine. E.g. run-applet uses <j2seproject:java classname="sun.applet.AppletViewer"> <customize> <arg value="${applet.url}"/> </customize> </j2seproject:java> so to my mind -debug-start-debuggee-applet should just look like <j2seproject:debug classname="sun.applet.AppletViewer"> <customize> <arg value="${applet.url}"/> </customize> </j2seproject:debug> rather than the current <j2seproject:debug classname="sun.applet.AppletViewer" args="${applet.url}"/> Why is it not done that way?
BTW consider also whether <j2seproject:debug> and <j2seproject:java> should even be independent macros. To my mind, debug should be a derivative macro based on java and only - adding the four JPDA VM args - using a different default for the classpath That is not critical for D, of course, but should be considered for E. For example, it would let people simply override -init-macrodef-java and have their changes apply also to debugging, if that is appropriate; usually it will be. Currently they would need to override both and essentially duplicate their modification.
I don't know, these macros were written by David. He probably had some reason for it. Rewriting the macros for D will be quite dangerous, since tomorrow is the last day we can commit into D.
I agree that for E the debug macro should be changed.
The current debug macro does not support customize. The fix is good enough for D, the change of the debug macro 24 hours before freeze is too dangerous.
I filed issue #51436 accordingly.
I've tried to rewrite the debug macro to use the customize element and it seems that it does not hurt anything. But I am not sure what was the reason not to use it. I can get it even into D, if you will do me a review.
I agree that it is probably too risky to put this into D now. Consider that the semantics of targets and macros is a kind of user API which we would be breaking - relative to 4.0b2, which though nominally was a "beta" was akin to a public release (bundled with JDK). If we are to cause incompatibilities (for users who have already overridden some targets in build.xml), we need to document them carefully. So I would probably not recommend trying to make such a change now, though I don't have strong feelings about it.
In this case I will tomorrow integrate this into D and then resolve the issue #51436 into E. Ok?
I'm not very convinced that we should integrate in the day of code freeze something that breaks compatibility of project metadata from Beta2. Beta2 was considered as "almost FCS" public release and FCS cannot break compatibility of project metadata. Please provide really compelling reason why should we integrate it. There is no duplicate, there is not vote and it's workaround for JDK issue.
Milan, incompatibilities mentioned here are planned for E (issue 51436). For D the original simple fix will be applied. Re. why <j2seproject:debug> macro does not have <customize> - good point, I completely overlooked that. Macros evolved independently I guess.
The current hot fix, which is not very nice, does not break compatibility of the project metadata. The project metadata compatibility would be broken by the right solution (using configure element in the debug macro, or even better make java and debug as a single macro as Jesse proposed - issue #51436)
OK then. I misunderstood Tomas's last comment (the one before my comment). Then it's approved :-).
I have tested the fix (both parts) - it seems to be ready for 4.0 integration. Thanks a lot for the fix, Tom! (tested on JDK 1.4 & 1.5, Solaris & Windows, with and without space in path)
Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java,v <-- J2SEActionProvider.java new revision: 1.29.8.1; previous revision: 1.29 done Processing log script arguments... More commits to come... Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/applet/AppletSupport.java,v <-- AppletSupport.java new revision: 1.3.4.1; previous revision: 1.3 done Processing log script arguments... More commits to come... Checking in j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl; /cvs/java/j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl,v <-- build-impl.xsl new revision: 1.39.4.1; previous revision: 1.39 done