Could not add prepared statement, no sql available!

It might happen that you see the following exception popping up:

INFO: This is not an inspectIT issue, please consult the management of inspectIT and send the following stacktrace!
java.util.NoSuchElementException
at java.util.LinkedList.getLast(LinkedList.java:122)
at info.novatec.inspectit.util.ThreadLocalStack.getLast(ThreadLocalStack.java:48)

The reason for this exception is the approach used for recording prepared statements. In nearly all of the cases, this is not a real problem but happens due to the specific JDBC vendor implementations. In the Oracle JDBC driver for example, it is because the OracleClosedStatement implements both Statement and PreparedStatement. During startup, such an object is being created with the calling of createStatement() (which is used to create a normal statement object) and inspectIT tries to identify the real SQL statement behind which is not possible (because in this context, the OracleClosedStatement is not used for a Prepared Statement).

Solution

Contact the inspectIT team and send us the stacktrace etc. We'll take a look at it and see if this is due to the above mentioned problem or really because of a bug.