Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

could not instantiate QueryTranslatorFactory: org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory

(Preface: this is not a duplicate of "org.hibernate.HibernateException: could not instantiate QueryTranslatorFactory: org.hibernate.hql.classic.ClassicQueryTransactionFactory" because the answer to that involved adding internal to the package, which mine does).

I am following the Netbeans tutorial "Using Hibernate in a Java Swing Application"

And I am at the line Creating Hibernate Mapping Files and POJOs From a Database

When I use the "Hibernate Mapping Files and POJOs from Database" wizard, I get the following dialog:

enter image description here

Because the message in red is cut off, I copy/pasted it here:

Hibernate configuration fails with message:
could not instantiate QueryTranslatorFactory: org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory
see message.log for exception details.

My questions:

  1. Does anyone know what may cause this? I double-checked my dependencies and my .xml file. Obviously, I'm brand new to Hibernate so I have no idea what else to try.
  2. It says to check "message.log". Where might this be located? Is there a default location for this?

UPDATE:

like image 806
ryvantage Avatar asked Mar 20 '23 21:03

ryvantage


1 Answers

In a strange twist of fate, I got it to work by removing the word "internal" from the factory_class classpath.

<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

I won't say that is an answer, though, because I am really confused as to why this is. Everything I've read says that

<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

...is for Hibernate 3

Whereas:

<property name="hibernate.query.factory_class">org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory</property>

... is for Hibernate 4.

And I'm certain my platform is Hibernate 4:

enter image description here

So, I'm still really confused as to what's going on....

like image 131
ryvantage Avatar answered Apr 05 '23 20:04

ryvantage