oracle-db-tools icon indicating copy to clipboard operation
oracle-db-tools copied to clipboard

Strange errors in sqldeveloper console

Open wienerri opened this issue 3 years ago • 3 comments

I have got strange errors in sqldeveloper console. I don't know how it is important, formating code seems to be working OK.

I have downloaded latest version of plsql-formatter-settings-main.zip (readme date is 18.7.2021 16:34).

Console output:

Bind var 'offset' not found: null
Symbol 'analytic_clause[6,12)' not found
Symbol 'JSON_OBJECT' not found
incrementalAlignments callback: null
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at oracle.dbtools.arbori.Program.javaCallback(Program.java:1344)
        at oracle.dbtools.arbori.Program.eval(Program.java:1243)
        at oracle.dbtools.app.Format.format(Format.java:375)
        at oracle.dbtools.raptor.config.FormatSQLOptionsPanel.updatePreview(FormatSQLOptionsPanel.java:654)
        at oracle.dbtools.raptor.config.FormatSQLAdvancedOptions.valueChanged(FormatSQLAdvancedOptions.java:370)
        at javax.swing.JTree.fireValueChanged(JTree.java:2934)
        at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3398)
        at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:635)
        at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1093)
        at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:294)
        at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(DefaultTreeSelectionModel.java:188)
        at javax.swing.JTree.setSelectionPath(JTree.java:1641)
        at oracle.dbtools.raptor.config.FormatSQLAdvancedOptions.<init>(FormatSQLAdvancedOptions.java:165)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at javax.ide.util.MetaClass.newInstance(MetaClass.java:145)
        at oracle.dbtools.raptor.standalone.IndexedPreferencesCommand$IndexPreferencesTask.doWork(IndexedPreferencesCommand.java:122)
        at oracle.dbtools.raptor.standalone.IndexedPreferencesCommand$IndexPreferencesTask.doWork(IndexedPreferencesCommand.java:65)
        at oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:199)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$RaptorFutureTask.run(RaptorTaskManager.java:702)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
        at oracle.dbtools.app.Format.incrementalAlignments(Format.java:818)
        ... 32 more
incrementalAlignments callback: null
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at oracle.dbtools.arbori.Program.javaCallback(Program.java:1344)
        at oracle.dbtools.arbori.Program.eval(Program.java:1243)
        at oracle.dbtools.app.Format.format(Format.java:375)
        at oracle.dbtools.format.FormatCommand.formatCode(FormatCommand.java:94)
        at oracle.dbtools.format.FormatCommand$1.doWork(FormatCommand.java:54)
        at oracle.dbtools.format.FormatCommand$1.doWork(FormatCommand.java:49)
        at oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:199)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$RaptorFutureTask.run(RaptorTaskManager.java:702)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
        at oracle.dbtools.app.Format.incrementalAlignments(Format.java:818)
        ... 18 more
Bind var 'offset' not found: null

wienerri avatar Jul 19 '21 06:07 wienerri

It would be good to know the sql you were working with when you got this error

thatjeffsmith avatar Jul 19 '21 16:07 thatjeffsmith

@wienerri if you get a chance send the sql: in the meantime, I've asked the Vadim to take a look at the trace.

bamcgill avatar Jan 21 '22 11:01 bamcgill

The version of SqlDev/SqlCl (the parser/Arbori library) is out of sync with the formatter program.

P.S. The parser in SQLDev is in perpetual maintenance mode, where the parser bugs are discovered and fixed. Consequently, parser rules change, and the symbols like analytic_clause[6,12) are renamed. You can find the valid symbol by searching analytic_clause[ in the allRules.txt, or drop it from the formatter program altogether. Admittedly, SQLDev should have grammar symbol names more resilient to the rules change.

Vadimtro avatar Jan 21 '22 17:01 Vadimtro