Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 243018 - Exception when using HQL query editor in Maven web app
Exception when using HQL query editor in Maven web app
Status: RESOLVED FIXED
Product: javaee
Classification: Unclassified
Component: Hibernate
8.0
PC Mac OS X
: P2 (vote)
: 8.0.1
Assigned To: Sergey Petrov
issues@javaee
:
: 246910 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-18 17:35 UTC by Kenneth Ganfield
Modified: 2014-09-18 08:55 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Ganfield 2014-03-18 17:35:32 UTC
Product Version: NetBeans IDE 8.0 (Build 201403052200)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.8.5 running on x86_64; UTF-8; en_US (nb)

The HQL Query editor throw exception when trying to run a query.

https://netbeans.org/kb/docs/web/hibernate-webapp.html

Possibly it is related to the translator factory (see #241729).
I tried with two different versions of the translator factory 



When using the default org.hibernate.hql.classic.ClassicQueryTranslatorFactory, I see the following exception in the editor:


java.lang.ClassCastException: dvdrental.Language_$$_javassist_12 cannot be cast to javassist.util.proxy.ProxyObject
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.getProxy(JavassistLazyInitializer.java:147)
	at org.hibernate.proxy.pojo.javassist.JavassistProxyFactory.getProxy(JavassistProxyFactory.java:71)
	at org.hibernate.tuple.entity.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:631)



If I try using org.hibernate.hql.internal.ClassicQueryTranslatorFactory as mentioned in issue #241729, the following exception is displayed in the editor:

org.hibernate.HibernateException: could not instantiate QueryTranslatorFactory: org.hibernate.hql.internal.ClassicQueryTranslatorFactory
	at org.hibernate.cfg.SettingsFactory.createQueryTranslatorFactory(SettingsFactory.java:436)
	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:258)
Comment 1 Sergey Petrov 2014-03-21 15:23:01 UTC
p2, seems important, and need to reevaluate, but simple queries on fresh works fine, priority isn't final.
Comment 2 Sergey Petrov 2014-07-03 16:03:57 UTC
interesting discussion,  I don't knwo why it works in some cases and may not work in another.
I can reproduce with tutorial steps.
I may need to rollback to older hibernate or somehow combine with another javassist version.
Comment 3 Sergey Petrov 2014-07-03 16:11:43 UTC
forget to add link https://hibernate.atlassian.net/browse/HHH-8778
Comment 4 Sergey Petrov 2014-07-07 15:56:23 UTC
seems fixed with http://hg.netbeans.org/web-main/rev/3ef9987079f3
Comment 5 Quality Engineering 2014-07-08 02:27:42 UTC
Integrated into 'main-silver', will be available in build *201407080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/3ef9987079f3
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #243018 change javassist classes loading way
Comment 6 Sergey Petrov 2014-09-18 08:55:16 UTC
*** Bug 246910 has been marked as a duplicate of this bug. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo