Jangbahadur Patel Jangbahadur Patel - 3 years ago 163
Java Question

org.hibernate.Query cannot be converted to org.hibernate.query.Query [javac] Query query = session.createQuery(sqlQuery);

i'm updating my project from hibernate 4.3.5 to 5.2.10. i updated the jars but getting below error during ant build.


error: incompatible types: org.hibernate.Query cannot be converted to org.hibernate.query.Query
[javac] Query query = session.createQuery(sqlQuery);


i can't understand why? Any help will be appreciated.

A_J A_J
Answer Source

Your classpath should contain only single version of hibernate jars, version 5 in this case. Please remove any other version of jars if present.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download