Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6313340

PIT: Edit functionality is not working properly on Win2000, WinNT, Win98, Works only on WinXP.


    • Subcomponent:
    • CPU:
    • OS:


      Calling Desktop.edit() on Win2000, Win98, WinNT throws IOException - AccessDenined. This feature seems to work fine only on WinXP. I tried calling this method for many document types such as txt, jpg, sxw, log etc. For all these document types, open and browse features are working properly and opening the respective applications.

      On the above mentioned platforms, with the PIT build, the following exception is thrown:

      java.io.IOException: Failed to edit file:/Z:/dns.txt. Error message: Access is denied.
      at sun.awt.windows.WDesktopPeer.ShellExecute(WDesktopPeer.java:59)
      at sun.awt.windows.WDesktopPeer.edit(WDesktopPeer.java:40)
      at java.awt.Desktop.edit(Desktop.java:280)
      at DesktopTest.actionPerformed(DesktopTest.java:132)
      at java.awt.Button.processActionEvent(Button.java:388)
      at java.awt.Button.processEvent(Button.java:356)
      at java.awt.Component.dispatchEventImpl(Component.java:4342)
      at java.awt.Component.dispatchEvent(Component.java:4176)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

      Here is the PIT build:
      java version "1.6.0-awt.rebuild_int_jcg_win_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-awt.rebuild_int_jcg_win_02-java2d_11_aug_2005_10_55-b00)
      Java HotSpot(TM) Client VM (build 1.6.0-ea-b46, mixed mode)

      I have attached a sample test. Execute the sample test as follows:
      java DesktopTest <fileName>
      You can click 'SelectFile' and choose any file through the file dialog. Click on Edit. If you see the above exception on Win2000, 98, NT, the bug is reproduced.
      I am misled by the difference in the behavior between WinXP and other windows platforms. Except WinXP, all other win32 platforms expect the user to associate an application with the file type for the edit action, even for basic file types such as txt. I was also misled by the 'Access Denied' exception that is thrown when the association is not present. On XP, the exception thrown in case of a missing file association is different. Edit functionality works fine after adding the association explicitly on the specified win32 platforms.




            • Assignee:
              denis Denis Fokin (Inactive)
              pmohansunw Praveen Mohan (Inactive)
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: