Hi,
I'm in the process of changing our development process in using the sqlcl projects command. We're encountering a StringIndexOutOfBoundsException. We're using sqlcl 26.2.0 on Windows. This is the stack:
references callback: null
java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at oracle.dbtools.arbori.Program.javaCallback(Program.java:1486)
at oracle.dbtools.arbori.Program$PredicateCmd.eval(Program.java:1603)
at oracle.dbtools.arbori.Program.eval(Program.java:1403)
at oracle.dbtools.arbori.SqlProgram.run(SqlProgram.java:77)
at oracle.dbtools.arbori.SqlProgram.run(SqlProgram.java:63)
at oracle.dbtools.arbori.SqlProgram.run(SqlProgram.java:58)
at oracle.dbtools.arbori.SqlProgram.run(SqlProgram.java:89)
at oracle.dbtools.app.SqlRecognizer.recognize(SqlRecognizer.java:83)
at oracle.dbtools.app.SqlRecognizer.<init>(SqlRecognizer.java:48)
at oracle.dbtools.extension.project.commands.stage.objectclasses.StageEntryMetadataParser.createSqlRecognizer(StageEntryMetadataParser.java:276)
at oracle.dbtools.extension.project.commands.stage.objectclasses.StageEntryMetadataParser.parse(StageEntryMetadataParser.java:135)
at oracle.dbtools.extension.project.commands.stage.services.StageEntryDescriptorFactory.build(StageEntryDescriptorFactory.java:29)
at oracle.dbtools.extension.project.commands.stage.application.StageGitDiffService.diffBranchDescriptors(StageGitDiffService.java:242)
at oracle.dbtools.extension.project.commands.stage.application.StageDiffPreparationService.prepare(StageDiffPreparationService.java:51)
at oracle.dbtools.extension.project.commands.stage.application.StageOrchestrationService.stage(StageOrchestrationService.java:48)
at oracle.dbtools.extension.project.commands.stage.StageCommand.run(StageCommand.java:69)
at oracle.dbtools.extension.project.commands.handler.CommandHandler.StageCommand(CommandHandler.java:60)
at oracle.dbtools.extension.project.commands.handler.ProjectCommand.handleEvent(ProjectCommand.java:80)
at oracle.dbtools.raptor.newscriptrunner.util.command.ParsedCommandListener.handleEvent(ParsedCommandListener.java:66)
at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.lambda$fireListeners$4(CommandRegistry.java:473)
at oracle.dbtools.raptor.newscriptrunner.ScriptRunnerContext.runWithStoredContext(ScriptRunnerContext.java:897)
at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.runWithStoredContext(CommandRegistry.java:693)
at oracle.dbtools.raptor.newscriptrunner.CommandRegistry.fireListeners(CommandRegistry.java:451)
at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.lambda$run$0(ScriptRunner.java:241)
at oracle.dbtools.raptor.newscriptrunner.ScriptRunnerContext.runWithStoredContext(ScriptRunnerContext.java:897)
at oracle.dbtools.raptor.newscriptrunner.ScriptRunner.run(ScriptRunner.java:124)
at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:364)
at oracle.dbtools.raptor.newscriptrunner.ScriptExecutor.run(ScriptExecutor.java:245)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.processLine(SqlCli.java:1592)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.runSqlcl(SqlCli.java:1851)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:379)
at oracle.dbtools.raptor.scriptrunner.cmdline.SqlCli.main(SqlCli.java:283)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.base/java.lang.StringLatin1.charAt(StringLatin1.java:48)
at java.base/java.lang.String.charAt(String.java:1519)
at oracle.dbtools.parser.Lexer.tokenize(Lexer.java:444)
at oracle.dbtools.parser.Lexer.doParse(Lexer.java:840)
at oracle.dbtools.parser.Lexer.doParse(Lexer.java:823)
at oracle.dbtools.parser.Lexer.doParse(Lexer.java:780)
at oracle.dbtools.parser.Lexer.parse(Lexer.java:20)
at oracle.arbori.util.DbObjNames.handleMixedCase(DbObjNames.java:24)
at oracle.arbori.util.Service.handleMixedCase(Service.java:381)
at oracle.arbori.util.Service.handleMixedCase(Service.java:372)
at oracle.dbtools.app.SqlRecognizer.add(SqlRecognizer.java:1001)
at oracle.dbtools.app.SqlRecognizer.references(SqlRecognizer.java:977)
... 35 more
In total, there are 22 of these errors. When I add the -debug flag to the project stage command, I see nothing out of the ordinary in the files referenced just above the error. I also see several of these errors right after echother, without mentioning of a source file in between, so I don't think the referenced source file just above the error has something to do with the error.
I've read posts SQLcl 26.1 fails on project stage command with java.lang.StringIndexOutOfBoundsException - Oracle Forums and SQLcl 25.4.1 project stage StringIndexOutOfBoundsException - Oracle Forums, that also raises the same error, but with a different stack trace.