jballment opened a new issue, #6427:
URL: https://github.com/apache/hop/issues/6427
### Apache Hop version?
2.16.0
### Java version?
zulu17.60.17-ca-jdk17.0.16-win_x64
### Operating system
Windows
### What happened?
The following code in a JavaScript Action step:
```
var myJSON = '{ "myNode" : { "myValue" : "abc" } }';
action.logBasic(myJSON);
```
Gives the following stacktrace:
```
Exception in thread "Thread-24" java.util.regex.PatternSyntaxException:
Illegal repetition near index 15
\{ "myNode" : { "myValue" : "abc" \}
^
at java.base/java.util.regex.Pattern.error(Pattern.java:2028)
at java.base/java.util.regex.Pattern.closure(Pattern.java:3309)
at java.base/java.util.regex.Pattern.sequence(Pattern.java:2214)
at java.base/java.util.regex.Pattern.expr(Pattern.java:2069)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1783)
at java.base/java.util.regex.Pattern.<init>(Pattern.java:1430)
at java.base/java.util.regex.Pattern.compile(Pattern.java:1069)
at java.base/java.lang.String.replaceAll(String.java:2944)
at
org.apache.hop.core.logging.LogMessage.getMessage(LogMessage.java:158)
at
org.apache.hop.core.logging.HopLogLayout.format(HopLogLayout.java:61)
at
org.apache.hop.core.logging.LoggingBuffer.getBuffer(LoggingBuffer.java:130)
at
org.apache.hop.core.logging.LoggingBuffer.getBuffer(LoggingBuffer.java:142)
at
org.apache.hop.execution.ExecutionStateBuilder.getLoggingText(ExecutionStateBuilder.java:70)
at
org.apache.hop.execution.ExecutionStateBuilder.fromExecutor(ExecutionStateBuilder.java:168)
at
org.apache.hop.workflow.engines.local.LocalWorkflowEngine.stopExecutionInfoTimer(LocalWorkflowEngine.java:444)
at
org.apache.hop.workflow.engines.local.LocalWorkflowEngine.lambda$startExecutionInfoTimer$2(LocalWorkflowEngine.java:350)
at
org.apache.hop.workflow.Workflow.fireExecutionFinishedListeners(Workflow.java:624)
at org.apache.hop.workflow.Workflow.startExecution(Workflow.java:337)
at
org.apache.hop.workflow.engines.local.LocalWorkflowEngine.startExecution(LocalWorkflowEngine.java:249)
at
org.apache.hop.ui.hopgui.file.workflow.HopGuiWorkflowGraph.lambda$start$15(HopGuiWorkflowGraph.java:3776)
at java.base/java.lang.Thread.run(Thread.java:840)
```
Also using variables inside a variable resolver value can cause the same
stacktrace when sent to LogBasic i.e.
`#{Resolver:${SomeVariable}-${SomethingElse}:Password}`
The error seems to be cause by
org.apache.hop.core.logging.LogMessage.getMessage() trying to format messages
in the format of:
`LogBasic("My value {1} and my value {2}", abc, xyz);`
Where {1} and {2} would be replaced with the value of abc and xyz
respectively.
### Issue Priority
Priority: 3
### Issue Component
Component: Other
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]