When output sql and format sql are selected the BasicFormatterImpl spawns a thread to process logging the sql query. That process iterates through identifying tokens and appropriately formatting the output. If the SQL query starts with a parenthesis (valid according to the SQL spec) it passes to a method to handle open parenthesis. That method expects there to be a lastToken and attempts to get the first character of a null string throwing a NullPointerException and takes down the currently running session in Tomcat/Spring. This is most likely to affect development simply because you would never output SQL in a production environment. I was able to refactor the SQL that generated the exception to not use a starting parenthesis, but the code is significantly less readable because it is quite long with multiple nested queries and unions.
Windows 8.1, Spring 2.5, Tomcat 6.0.47
Can you please attach a test case we can use to reproduce this?
Note: In an attempt to clean up the HHH JIRA, we will be rejecting any ticket that sits in the "Awaiting Test Case" state for 2-3 months with no response. So, if this issue is critical to you, please attach a reproducing test case ASAP. Thanks!
Bulk rejecting issues lacking a test case or recent response.