Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-5722

NPE on "Open Project ..." with CDE/Motif Look and Feel

Details

    Description

      When selecting "Open Project ..." in the Projects-view with the CDE/Motif Look and Feel, no dialog opens but the exception happens. No exception on "New Project ..." or "New File ...", or when using a different Look and Feel.

      Attachments

        1. IDE-Log.txt
          107 kB
          Mario Bruckschwaiger
        2. UI-Log.txt
          155 kB
          Mario Bruckschwaiger

        Issue Links

          Activity

            asbachb Benjamin Asbach added a comment - - edited

            Based on my tests the "Open Project..." dialog is not pop up anywhere:

            • File / Open Project...
            • Toolbar Icon
            • Projects View / Right Click / Open Project...

            Tested with NetBeans 12.5, Java 16, Linux

            asbachb Benjamin Asbach added a comment - - edited Based on my tests the "Open Project..." dialog is not pop up anywhere: File / Open Project... Toolbar Icon Projects View / Right Click / Open Project... Tested with NetBeans 12.5, Java 16, Linux

            I think this is somehow JDK related. At least I cannot reproduce the problem with JDK11.

            mario.bruckschwaiger  can you double check?

            asbachb Benjamin Asbach added a comment - I think this is somehow JDK related. At least I cannot reproduce the problem with JDK11. mario.bruckschwaiger   can you double check?
            asbachb Benjamin Asbach added a comment - - edited

            I think this is caused due to the usage of javax.swing.plaf.metal.MetalFileChooserUI instead of com.sun.java.swing.plaf.motif.MotifFileChooserUI.

            asbachb Benjamin Asbach added a comment - - edited I think this is caused due to the usage of javax.swing.plaf.metal.MetalFileChooserUI instead of com.sun.java.swing.plaf.motif.MotifFileChooserUI .
            asbachb Benjamin Asbach added a comment - - edited

            javax.swing.plaf.metal.MetalFileChooserUI is choosen because of https://github.com/apache/netbeans/blob/12.5/ide/o.n.swing.dirchooser/src/org/netbeans/swing/dirchooser/DelegatingChooserUI.java#L79

            Exception cause

            java.lang.IllegalAccessException: class org.netbeans.swing.dirchooser.DelegatingChooserUI cannot access class com.sun.java.swing.plaf.motif.MotifFileChooserUI (in module java.desktop) because module java.desktop does not export com.sun.java.swing.plaf.motif to unnamed module @54ee70d1
             at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385)
             at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:687)
             at java.base/java.lang.reflect.Method.invoke(Method.java:559)
             at org.netbeans.swing.dirchooser.DelegatingChooserUI.createUI(DelegatingChooserUI.java:75)
             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
             at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
             at java.base/java.lang.reflect.Method.invoke(Method.java:567)
             at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
             at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
             at java.base/java.lang.reflect.Method.invoke(Method.java:567)
             at java.base/sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260)
             at java.desktop/javax.swing.UIDefaults.getUI(UIDefaults.java:806)
             at java.desktop/javax.swing.UIManager.getUI(UIManager.java:1068)
             at java.desktop/javax.swing.JFileChooser.updateUI(JFileChooser.java:1833)
             at java.desktop/javax.swing.JFileChooser.setup(JFileChooser.java:395)
             at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:361)
             at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:308)
             at org.netbeans.modules.project.ui.ProjectChooserAccessory$ProjectFileChooser.<init>(ProjectChooserAccessory.java:507)
             at org.netbeans.modules.project.ui.ProjectChooserAccessory$ProjectFileChooser.<init>(ProjectChooserAccessory.java:507)
             at org.netbeans.modules.project.ui.ProjectChooserAccessory.createProjectChooser(ProjectChooserAccessory.java:442)
             at org.netbeans.modules.project.ui.actions.OpenProject.actionPerformed(OpenProject.java:61)
             at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
             at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
             at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
             at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
             at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
             at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298)
             at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297)
             at java.desktop/java.awt.Component.processMouseEvent(Component.java:6617)
             at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
             at java.desktop/java.awt.Component.processEvent(Component.java:6382)
             at java.desktop/java.awt.Container.processEvent(Container.java:2264)
             at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4993)
             at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2322)
             at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825)
             at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4934)
             at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4563)
             at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4504)
             at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2308)
             at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
             at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825)
             at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
             at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
             at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
             at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
             at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
             at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
             at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
             at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
             at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
             at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
             at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
             at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
             at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
             at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
             at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
             at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
             at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
             at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
            
            

             

            asbachb Benjamin Asbach added a comment - - edited javax.swing.plaf.metal.MetalFileChooserUI is choosen because of https://github.com/apache/netbeans/blob/12.5/ide/o.n.swing.dirchooser/src/org/netbeans/swing/dirchooser/DelegatingChooserUI.java#L79 Exception cause java.lang.IllegalAccessException: class org.netbeans.swing.dirchooser.DelegatingChooserUI cannot access class com.sun.java.swing.plaf.motif.MotifFileChooserUI (in module java.desktop) because module java.desktop does not export com.sun.java.swing.plaf.motif to unnamed module @54ee70d1 at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:385) at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:687) at java.base/java.lang.reflect.Method.invoke(Method.java:559) at org.netbeans.swing.dirchooser.DelegatingChooserUI.createUI(DelegatingChooserUI.java:75) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at java.base/sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:260) at java.desktop/javax.swing.UIDefaults.getUI(UIDefaults.java:806) at java.desktop/javax.swing.UIManager.getUI(UIManager.java:1068) at java.desktop/javax.swing.JFileChooser.updateUI(JFileChooser.java:1833) at java.desktop/javax.swing.JFileChooser.setup(JFileChooser.java:395) at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:361) at java.desktop/javax.swing.JFileChooser.<init>(JFileChooser.java:308) at org.netbeans.modules.project.ui.ProjectChooserAccessory$ProjectFileChooser.<init>(ProjectChooserAccessory.java:507) at org.netbeans.modules.project.ui.ProjectChooserAccessory$ProjectFileChooser.<init>(ProjectChooserAccessory.java:507) at org.netbeans.modules.project.ui.ProjectChooserAccessory.createProjectChooser(ProjectChooserAccessory.java:442) at org.netbeans.modules.project.ui.actions.OpenProject.actionPerformed(OpenProject.java:61) at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972) at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313) at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:298) at java.desktop/java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:297) at java.desktop/java.awt.Component.processMouseEvent(Component.java:6617) at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342) at java.desktop/java.awt.Component.processEvent(Component.java:6382) at java.desktop/java.awt.Container.processEvent(Container.java:2264) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4993) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2322) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4934) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4563) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4504) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2308) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743) at java.base/java.security.AccessController.doPrivileged(AccessController.java:391) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)  
            mario.bruckschwaiger Mario Bruckschwaiger added a comment - - edited

            asbachb you are right, it is JDK related. Works also for me with JDK11. Adding com.sun.java.swing.plaf.motif to exported modules fixes it for me for JDK17. Thanks.

            mario.bruckschwaiger Mario Bruckschwaiger added a comment - - edited asbachb  you are right, it is JDK related. Works also for me with JDK11. Adding com.sun.java.swing.plaf.motif to exported modules fixes it for me for JDK17. Thanks.

            PR was merged into master. I guess this will be part of NetBeans 12.6

            asbachb Benjamin Asbach added a comment - PR was merged into master. I guess this will be part of NetBeans 12.6

            People

              asbachb Benjamin Asbach
              mario.bruckschwaiger Mario Bruckschwaiger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m