sqlDev - UserReports.xml going empty

sarlaac

    After reading Jeff Smith's blog about user created reports I wanted to try using this functionality for some often run queries.

     

    I'm using SQL Dev 17.2

    - I create a new folder under "User Defined Reports"

    - I check C:\Users\username\AppData\Roaming\SQL Developer and see the UserReports.xml created and contains the folder name.

    - I create a new report in the folder called TEST and with a query of select * from dual;

    - I apply and can run the report, and see it in the folder tree.

    - If I check C:\Users\username\AppData\Roaming\SQL Developer the UserReports.xml file is now 0kb in size.

    - If I exit and open SQL Dev again, the report and folder I created are gone.

     

    I was also able to reproduce this on SQL Dev 4.2. I only tried on this version after repeatedly having the issue on 17.2. I was not running both at the same time, in case that was causing any issues.

     

    Can anyone else reproduce this issue, or should I look for a cause that is local to my system?

      • 1. Re: sqlDev - UserReports.xml going empty
        thatJeffSmith-Oracle

        The file is going to be empty probably until you close SQL Developer - we update the file as the application closes

         

        Now, why it's coming up empty AFTER the shutdown, and causing you to lose your report - that's the issue.

         

        Can you try creating a file in that directory to see if you have write privs - it would be really weird if you didn't, but just to make sure.

        • 2. Re: sqlDev - UserReports.xml going empty
          sarlaac

          The file isn't empty when I create a reports folder. That change immediately shows up in the file. If I stop there the file is saved and I see the folder when I re-open sqldev.

           

          The file only goes to 0kb when I try to create a report and hit apply. I still have sqldev open and am watching the file in another window. With the file at 0kb I can even run the newly created report, until I exit sqldev.

           

          I created a testing.txt file next to UserReports.xml and that worked fine. I have admin privs on the machine so write access typically isn't an issue. I also have a CodeTemplate.xml file in that same directory. It is working just fine, my additions to it are saved and available after restarting.

          • 3. Re: sqlDev - UserReports.xml going empty
            Gary Graham-Oracle

            Whenever something unexpected like this happens we typically suspect corruption in the user settings.  You can try...

             

            1. Tools > Features > Clear Cache

                This clears C:\Users\<username>\AppData\Roaming\SQL Developer\<version>\system_cache

            2. If that does not help, try deleting any system_cache, system_cache_1, etc folders for the <version> of interest.

            3. If that does not help, try renaming the <version> folder and relaunch SQL Developer, preferably skipping settings migration.

             

            Clearly you need to relaunch SQL Developer after (2) or (3), but it might be a good idea even after (1).

            • 4. Re: sqlDev - UserReports.xml going empty
              thatJeffSmith-Oracle

              +1 to Gary's note - something is 'wrong' with your install. This will get you back to a 'clean' state.

              • 5. Re: sqlDev - UserReports.xml going empty
                sarlaac

                Gary,

                 

                I attempted each suggestion in sequence, and restarted sql developer between each, but the issue remains. I did not migrate any settings, I setup only one connect and created the select * from dual; report against it.

                 

                As soon as I create a report the UserReports.xml goes to 0kb, and the next time I start SQL Dev my reports are gone.

                • 6. Re: sqlDev - UserReports.xml going empty
                  Gary Graham-Oracle

                  Very strange.  Have you tried...

                   

                  1. Starting up SQL Developer using "Run as administrator"?

                  2. Tried launching <sqldev_home>\sqldeveloper\sqldeveloper\bin\sqldeveloper.exe from a Cmd console window?

                   

                  When doing (2), and watching for any messages in the console, you may first want to change...

                  IncludeConfFile  sqldeveloper-nondebug.conf

                  to

                  IncludeConfFile  sqldeveloper-debug.conf

                  in your sqldeveloper.conf file.

                  • 7. Re: sqlDev - UserReports.xml going empty
                    sarlaac

                    Ok ran it from the command line and as soon as I try to create the new report I get a java exception. sql dev is using Java 1.8.0_131 (not 144)

                     

                    c:\oracle\sqldeveloper172\sqldeveloper\bin>sqldeveloper.exe

                    Exception while performing action New Report...

                    java.lang.ExceptionInInitializerError

                            at oracle.ide.print.misc.Util.getConfig(Util.java:12)

                            at oracle.ide.print.core.Manager.getPageFormat(Manager.java:26)

                            at oracle.ideimpl.print.ide.Manager.getPageFormat(Manager.java:50)

                            at oracle.dbtools.raptor.format.ReportFormatOptions.getOrientation(ReportFormatOptions.java:540)

                            at oracle.dbtools.raptor.export.pdf.PDFXMLUtil.formatPageSetup(PDFXMLUtil.java:213)

                            at oracle.dbtools.raptor.export.pdf.PDFXMLUtil.toXML(PDFXMLUtil.java:48)

                            at oracle.dbtools.raptor.controls.display.DisplayModel.toXML(DisplayModel.java:360)

                            at oracle.dbtools.raptor.controls.display.DisplayModel.toXML(DisplayModel.java:319)

                            at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.exportNodes(ReportNavigatorContextMenu.java:621)

                            at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.saveUserDefined(ReportNavigatorContextMenu.java:588)

                            at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.handleEvent(ReportNavigatorContextMenu.java:349)

                            at oracle.ide.controller.IdeAction$ControllerDelegatingController.handleEvent(IdeAction.java:1488)

                            at oracle.ide.controller.IdeAction.performAction(IdeAction.java:663)

                            at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:1159)

                            at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:618)

                            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)

                            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)

                            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)

                            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)

                            at javax.swing.AbstractButton.doClick(AbstractButton.java:376)

                            at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)

                            at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)

                            at java.awt.Component.processMouseEvent(Component.java:6533)

                            at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)

                            at java.awt.Component.processEvent(Component.java:6298)

                            at java.awt.Container.processEvent(Container.java:2236)

                            at java.awt.Component.dispatchEventImpl(Component.java:4889)

                            at java.awt.Container.dispatchEventImpl(Container.java:2294)

                            at java.awt.Component.dispatchEvent(Component.java:4711)

                            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)

                            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)

                            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)

                            at java.awt.Container.dispatchEventImpl(Container.java:2280)

                            at java.awt.Window.dispatchEventImpl(Window.java:2746)

                            at java.awt.Component.dispatchEvent(Component.java:4711)

                            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

                            at java.awt.EventQueue.access$500(EventQueue.java:97)

                            at java.awt.EventQueue$3.run(EventQueue.java:709)

                            at java.awt.EventQueue$3.run(EventQueue.java:703)

                            at java.security.AccessController.doPrivileged(Native Method)

                            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

                            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)

                            at java.awt.EventQueue$4.run(EventQueue.java:731)

                            at java.awt.EventQueue$4.run(EventQueue.java:729)

                            at java.security.AccessController.doPrivileged(Native Method)

                            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

                            at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

                            at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)

                            at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)

                            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)

                            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

                            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

                            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

                            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

                            at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

                    Caused by: java.lang.IllegalArgumentException: 0 or negative value argument

                            at javax.print.attribute.standard.MediaPrintableArea.<init>(MediaPrintableArea.java:117)

                            at oracle.ide.print.misc.Area.<init>(Area.java:61)

                            at oracle.ide.print.misc.Config.<init>(Config.java:33)

                            at oracle.ide.print.misc.Config.<clinit>(Config.java:425)

                            ... 55 more

                    Exception while performing action New Report...

                    java.lang.NoClassDefFoundError: Could not initialize class oracle.ide.print.misc.Config

                            at oracle.ide.print.misc.Util.getConfig(Util.java:12)

                            at oracle.ide.print.core.Manager.getPageFormat(Manager.java:26)

                            at oracle.ideimpl.print.ide.Manager.getPageFormat(Manager.java:50)

                            at oracle.dbtools.raptor.format.ReportFormatOptions.getOrientation(ReportFormatOptions.java:540)

                            at oracle.dbtools.raptor.export.pdf.PDFXMLUtil.formatPageSetup(PDFXMLUtil.java:213)

                            at oracle.dbtools.raptor.export.pdf.PDFXMLUtil.toXML(PDFXMLUtil.java:48)

                            at oracle.dbtools.raptor.controls.display.DisplayModel.toXML(DisplayModel.java:360)

                            at oracle.dbtools.raptor.controls.display.DisplayModel.toXML(DisplayModel.java:319)

                            at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.exportNodes(ReportNavigatorContextMenu.java:621)

                            at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.saveUserDefined(ReportNavigatorContextMenu.java:588)

                            at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.handleEvent(ReportNavigatorContextMenu.java:349)

                            at oracle.ide.controller.IdeAction.performAction(IdeAction.java:663)

                            at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:1159)

                            at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:618)

                            at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)

                            at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)

                            at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)

                            at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)

                            at javax.swing.AbstractButton.doClick(AbstractButton.java:376)

                            at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)

                            at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)

                            at java.awt.Component.processMouseEvent(Component.java:6533)

                            at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)

                            at java.awt.Component.processEvent(Component.java:6298)

                            at java.awt.Container.processEvent(Container.java:2236)

                            at java.awt.Component.dispatchEventImpl(Component.java:4889)

                            at java.awt.Container.dispatchEventImpl(Container.java:2294)

                            at java.awt.Component.dispatchEvent(Component.java:4711)

                            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)

                            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)

                            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)

                            at java.awt.Container.dispatchEventImpl(Container.java:2280)

                            at java.awt.Window.dispatchEventImpl(Window.java:2746)

                            at java.awt.Component.dispatchEvent(Component.java:4711)

                            at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

                            at java.awt.EventQueue.access$500(EventQueue.java:97)

                            at java.awt.EventQueue$3.run(EventQueue.java:709)

                            at java.awt.EventQueue$3.run(EventQueue.java:703)

                            at java.security.AccessController.doPrivileged(Native Method)

                            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

                            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)

                            at java.awt.EventQueue$4.run(EventQueue.java:731)

                            at java.awt.EventQueue$4.run(EventQueue.java:729)

                            at java.security.AccessController.doPrivileged(Native Method)

                            at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

                            at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

                            at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)

                            at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)

                            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)

                            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

                            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

                            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

                            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

                            at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

                    • 8. Re: sqlDev - UserReports.xml going empty
                      sarlaac

                      I updated to java 1.8.0._144 and got the exception there as well.

                      c:\oracle\sqldeveloper172\sqldeveloper\bin>sqldeveloper.exe

                      Exception while performing action New Report...

                      java.lang.ExceptionInInitializerError

                              at oracle.ide.print.misc.Util.getConfig(Util.java:12)

                              at oracle.ide.print.core.Manager.getPageFormat(Manager.java:26)

                              at oracle.ideimpl.print.ide.Manager.getPageFormat(Manager.java:50)

                              at oracle.dbtools.raptor.format.ReportFormatOptions.getOrientation(ReportFormatOptions.java:540)

                              at oracle.dbtools.raptor.export.pdf.PDFXMLUtil.formatPageSetup(PDFXMLUtil.java:213)

                              at oracle.dbtools.raptor.export.pdf.PDFXMLUtil.toXML(PDFXMLUtil.java:48)

                              at oracle.dbtools.raptor.controls.display.DisplayModel.toXML(DisplayModel.java:360)

                              at oracle.dbtools.raptor.controls.display.DisplayModel.toXML(DisplayModel.java:319)

                              at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.exportNodes(ReportNavigatorContextMenu.java:621)

                              at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.saveUserDefined(ReportNavigatorContextMenu.java:588)

                              at oracle.dbtools.raptor.report.navigatorV2.ReportNavigatorContextMenu.handleEvent(ReportNavigatorContextMenu.java:349)

                              at oracle.ide.controller.IdeAction$ControllerDelegatingController.handleEvent(IdeAction.java:1488)

                              at oracle.ide.controller.IdeAction.performAction(IdeAction.java:663)

                              at oracle.ide.controller.IdeAction.actionPerformedImpl(IdeAction.java:1159)

                              at oracle.ide.controller.IdeAction.actionPerformed(IdeAction.java:618)

                              at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)

                              at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)

                              at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)

                              at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)

                              at javax.swing.AbstractButton.doClick(AbstractButton.java:376)

                              at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)

                              at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)

                              at java.awt.Component.processMouseEvent(Component.java:6533)

                              at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)

                              at java.awt.Component.processEvent(Component.java:6298)

                              at java.awt.Container.processEvent(Container.java:2236)

                              at java.awt.Component.dispatchEventImpl(Component.java:4889)

                              at java.awt.Container.dispatchEventImpl(Container.java:2294)

                              at java.awt.Component.dispatchEvent(Component.java:4711)

                              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)

                              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)

                              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)

                              at java.awt.Container.dispatchEventImpl(Container.java:2280)

                              at java.awt.Window.dispatchEventImpl(Window.java:2746)

                              at java.awt.Component.dispatchEvent(Component.java:4711)

                              at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

                              at java.awt.EventQueue.access$500(EventQueue.java:97)

                              at java.awt.EventQueue$3.run(EventQueue.java:709)

                              at java.awt.EventQueue$3.run(EventQueue.java:703)

                              at java.security.AccessController.doPrivileged(Native Method)

                              at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

                              at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)

                              at java.awt.EventQueue$4.run(EventQueue.java:731)

                              at java.awt.EventQueue$4.run(EventQueue.java:729)

                              at java.security.AccessController.doPrivileged(Native Method)

                              at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)

                              at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

                              at oracle.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)

                              at oracle.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)

                              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)

                              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

                              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

                              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

                              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

                              at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

                      Caused by: java.lang.IllegalArgumentException: 0 or negative value argument

                              at javax.print.attribute.standard.MediaPrintableArea.<init>(MediaPrintableArea.java:117)

                              at oracle.ide.print.misc.Area.<init>(Area.java:61)

                              at oracle.ide.print.misc.Config.<init>(Config.java:33)

                              at oracle.ide.print.misc.Config.<clinit>(Config.java:425)

                              ... 55 more

                      • 9. Re: sqlDev - UserReports.xml going empty
                        Gary Graham-Oracle

                        I got a hit on my web search for at oracle.ide.print.misc.Util.getConfig(Util.java:12)

                        User Defined Reports not being saved after reopening SQL Developer

                         

                        That poster discovered a conflict with some other software.  Read the final post in that discussion, summarized here...

                        Details : I have Zebra Enterprise Printers setup in my machine as I was testing UPC barcode label printing functionality and that was my Default Printer. 'Zebra QL 200+' printer.

                         

                        When I create a new report, in the debug mode, this error was thrown

                        Caused by: java.lang.IllegalArgumentException: 0 or negative value argument

                                at javax.print.attribute.standard.MediaPrintableArea.<init>(MediaPrintableArea.java:117)

                         

                        I added the jars explicitly in the classpath, but still no luck. Then I just tried to see if Printing is working through  SQLDeveloper. "File --> PageSetup". The same error was thrown.

                         

                        The constructor of MediaPrintableArea throws IllegalArgumentException, when the printable x,y or the width and height are less than 0. Looks like that's the setting in my default printer which is a Zebra Printer.

                         

                        I went to 'Devices and Printers' on windows, removed the Zebra Printer Devices and then tried the Page Setup, it worked. Later tried creating a new report. It worked.

                        • 10. Re: sqlDev - UserReports.xml going empty
                          sarlaac

                          Well we are making real progress now.

                           

                          I did have a label printer (Intermec PM43) installed. I tried to switch it so it was not the default printer but the issue remained. I deleted the printer from my system and the problem went away.

                           

                          That's great, but I would like to still be able to have that printer installed. I'm assuming if I install it again, the issue will return?

                          • 11. Re: sqlDev - UserReports.xml going empty
                            Gary Graham-Oracle

                            I'm assuming if I install it again, the issue will return?

                            That sounds reasonable, but...

                            1. Maybe it won't be a problem, or

                            2. Maybe repeating the Clear Cache, etc, steps for SQL Developer before re-installing the print driver will do the trick.

                             

                            After all, the poster in the other discussion noted that File > PageSetup failed until that printer was uninstalled, whereas you actually tried to change the default printer, without effect.  To me, that means the getPageFormat / getConfig java calls are getting some bad values (maybe from the Windows registry or maybe from our system_cache).  Recall the poster said...

                            The constructor of MediaPrintableArea throws IllegalArgumentException, when the printable x,y or the width and height are less than 0. Looks like that's the setting in my default printer which is a Zebra Printer.

                            So anyway we can stop negative (or 0?) values from being read should help.  Otherwise...

                            3. Perhaps if you avoid letting it ever become the default printer, it will work.

                            4. Maybe there is a newer print driver for that device.

                            • 12. Re: sqlDev - UserReports.xml going empty
                              sarlaac

                              I'll leave those tests for another day.

                               

                              Thanks for all the help to get this tracked down.