More from the dumbass mistake department. Trying to boot up a Hibernate based project, I was getting this error:
java.lang.IllegalArgumentException: node to traverse cannot be null!
This was occurring during parsing of the named query information in the configuration. Eventually I tracked it down to this query:
@NamedQuery( name=Comment.COUNT_COMMENTS_BY_ARTICLE, query="count(*) from Comment where article = :article")
The problem was simply that I'd omitted a vital keyword from the query - because I'm normally retrieving lists of simple entities with queries of the form "from Foo where bar = :spong", which is quite legal, I failed to spot the missing select for ages even where it was staring me in the face! Here's that corrected query:
@NamedQuery( name=Comment.COUNT_COMMENTS_BY_ARTICLE, query="select count(*) from Comment where article = :article")
The moral of this story is perhaps that Hibernate's error handling isn't always very helpful, but a systematic approach to debugging will get you there in the end. In this case I did a binary search on the application's named queries until I found the offender, then it was relatively easy to spot the problem.