java.lang.AssertionError: expected SQLGrammarException

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips


My guess is there is some kind of static state in the code being tested or in the test itself, so the tests aren't isolated. Adding the test changes the test order. In any case, your best course of action is to use the debugger to see why the tests fail.


Check your assert declaration and the method implementation with the condition.

Solutions on the web

via Hibernate JIRA by Carsten Hammer, 1 year ago
expected SQLGrammarException
via Hibernate JIRA by Carsten Hammer, 1 year ago
expected SQLGrammarException
via GitHub by HappyRay
, 1 month ago
Flow didn't reach expected status
via Stack Overflow by Unknown author, 2 years ago
java.lang.AssertionError: expected SQLGrammarException
at org.hibernate.test.cid.CompositeIdTest.testDistinctCountOfEntityWithCompositeId(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
at org.junit.internal.runners.statements.RunBefores.evaluate(
at org.junit.internal.runners.statements.RunAfters.evaluate(

Users with the same issue

Once, 21 hours ago
Once, 6 days ago
2 times, 1 week ago
Once, 1 week ago
Once, 2 weeks ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.