This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
This issue was reported manually by giorgo. It already has 3 duplicates Build: NetBeans IDE 6.9.1 (Build 201011082200) VM: Java HotSpot(TM) Client VM, 17.1-b03, Java(TM) SE Runtime Environment, 1.6.0_22-b04 OS: Windows 7 User Comments: giorgo: i was trying to Creating the Hibernate Mapping Files and POJOs You can use the Hibernate Mapping Files and POJOs from a Database wizard to generate files for you. The wizard can generate a POJO and a corresponding mapping file for each table that you select in the wizard. The mapping files are XML files that contain data about how the columns in the tables are mapped to the fields in the POJOs. You need to have the hibernate.reveng.xml and hibernate.cfg.xml files to use the wizard. To create the POJOS and mapping files using a wizard, perform the following steps. 1. Right-click the Source Packages node in the Projects window and choose New > Other to open the New File wizard. 2. Select Hibernate Mapping Files and POJOs from a Database in the Hibernate category. Click Next. 3. Ensure that the hibernate.cfg.xml and hibernate.reveng.xml files are selected in the drop down lists. 4. Select JDK 5 Language Features under the General Settings options. 5. Ensure that the Dom giorgo: i was doing the hibernate example Creating the Hibernate Mapping Files and POJOs You can use the Hibernate Mapping Files and POJOs from a Database wizard to generate files for you. The wizard can generate a POJO and a corresponding mapping file for each table that you select in the wizard. The mapping files are XML files that contain data about how the columns in the tables are mapped to the fields in the POJOs. You need to have the hibernate.reveng.xml and hibernate.cfg.xml files to use the wizard. To create the POJOS and mapping files using a wizard, perform the following steps. 1. Right-click the Source Packages node in the Projects window and choose New > Other to open the New File wizard. 2. Select Hibernate Mapping Files and POJOs from a Database in the Hibernate category. Click Next. 3. Ensure that the hibernate.cfg.xml and hibernate.reveng.xml files are selected in the drop down lists. 4. Select JDK 5 Language Features under the General Settings options. 5. Stacktrace: java.lang.ClassNotFoundException: org.hibernate.hql.classic.ClassicQueryTransactionFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(AccessController.java:0) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Created attachment 103018 [details] stacktrace
*** This bug has been marked as a duplicate of bug 192026 ***
*** Bug 192026 has been marked as a duplicate of this bug. ***
http://netbeans.org/kb/docs/java/hibernate-java-se.html When editing hibernate.cfg.xml with the designer editor, one value available from the list in Miscellaneous Properties is wrong: <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTransactionFactory</property> This should probably be org.hibernate.hql.classic.ClassicQueryTranslatorFactory - the class ClassicQueryTransactionFactory is not found. However, when using ClassicQueryTranslatorFactory, then the example in the tutorial fails with an error as described in: http://netbeans.org/projects/usersguide/lists/nbdocs_feedback/archive/2010-10/message/44 The query works if one selects the value org.hibernate.hql.ast.ASTQueryTranslatorFactory
The excellent tutorial using this fails. This tutorial is a showcase of the ease of Hibernate development with NetBeans using wizards. With raising the priority of this to 1, I am trying to raise awareness of this.
"The query works if one selects the value org.hibernate.hql.ast.ASTQueryTranslatorFactory" Does it mean it's a workaround? If it's it doesn't look like P1 and may be tutorial need correction.
org.hibernate.hql.ast.ASTQueryTranslatorFactory is a workaround, and the tutorial may need a correction to reflect that. But that is only part of the problem. NetBeans contains org.hibernate.hql.classic.ClassicQueryTransactionFactory which I don't know what that is. It does not seem to exist. If that is corrected to ClassicQueryTranslatorFactory, then im am not sure whether that is ok, but it looks logical. When used in the tutorial, then the tutorial still fails. So the whole thing is quite tricky and confusing, not the type of thing that one would want to see in wizards/tutorials. Sure not a priority one, but highly visible and damaging while easy to fix.
iI have spend hours untill i realisead what is .. I am trying the tut Using Hibernate in a Web Application very good but when it comes for 8 .Type org.hibernate.hql.classic.ClassicQueryTranslatorFactory as the Property Value. Click OK. Add Hibernate Property dialog box for properties hibernate.query.factory_class If you click the XML tab in the editor you can see the file in XML view. Your file should look like the following (the three new properties are bold): <hibernate-configuration> <session-factory name="session1"> <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/sakila</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password">######</property> <property name="hibernate.show_sql">true</property> <property name="hibernate.current_session_context_class">thread</property> <property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property> </session-factory> </hibernate-configuration> with this entry org.hibernate.hql.classic.ClassicQueryTranslatorFactory i canott create the pojos with the wizard later on step Creating the Hibernate Mapping Files and POJOs You can use the Hibernate Mapping Files and POJOs from a Database wizard to generate files for you. The wizard can generate a POJO and a corresponding mapping file for each table that you select in the wizard. The mapping files are XML files that contain data about how the columns in the tables are mapped to the fields in the POJOs. You need to have the hibernate.reveng.xml and hibernate.cfg.xml files to use the wizard. To create the POJOS and mapping files using a wizard, perform the following steps. 1. Right-click the Source Packages node in the Projects window and choose New > Other to open the New File wizard. 2. Select Hibernate Mapping Files and POJOs from a Database in the Hibernate category. Click Next. 3. Ensure that the hibernate.cfg.xml and hibernate.reveng.xml files are selected in the drop down lists. 4. Select JDK 5 Language Features under the General Settings options. 5. Ensure that the Domain Code and Hibernate XML Mappings options are selected. 6. Select dvdrental for the Package name. Click Finish. So if i go back on step 8 .Type org.hibernate.hql.classic.ClassicQueryTranslatorFactory as the Property Value. Click OK. Add Hibernate Property dialog box for properties hibernate.query.factory_class and i change the org.hibernate.hql.classic.ClassicQueryTranslatorFactory to org.hibernate.hql.ast.ASTQueryTranslatorFactory later i can create the pojos with the wizard ... THE SAME BUG IS ALSO ON NETBEANS 6.8 and 6.9.1
Yes but i don't know if the tut need correction!!!!!!!!!! i try to understand Hibernate . I am student and i just want to have this application work so that i can understand what is going on with hibernate.
Thanks for more information, let it be P2 for now, still more visible then most issues but do not block other activities. Was here any reply to http://netbeans.org/projects/usersguide/lists/nbdocs_feedback/archive/2010-10/message/44 ?
What I see tutorial itself said about org.hibernate.hql.classic.ClassicQueryTranslatorFactory which one may be mixed with listed org.hibernate.hql.classic.ClassicQueryTransactionFactory as it's similar but it's not tutorial issue in case ClassicQueryTranslatorFactory works. But as you said ClassicQueryTranslatorFactory fails at runtime, it's another issue and I'm not sure if it's nb or tutorial or specific setup issue. Anyway I will remove org.hibernate.hql.classic.ClassicQueryTransactionFactory as almost all google links are related to nb issues, when org.hibernate.hql.classic.ClassicQueryTranslatorFactory point at hibernate site from the beginning it looks like a misprint affecting tutorial even tutorial said about correct class. It's unlikely ClassicQueryTranslatorFactory have a problem also as I hope tutorial was executed at least at creation time successfully.
<Incorrect value for Hibernate Config Property hibernate.query.factory_class > is fixed http://hg.netbeans.org/web-main/rev/08e9088bc877 next issue may need to be filed as separate one and investigated more if it's tutorial/hibernate/nb issue and how to resolve it.
Many thanks Sergey! Created bug 192554 for the tutorials.
Integrated into 'main-golden', will be available in build *201011270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/08e9088bc877 User: Sergey B. Petrov <sj-nb@netbeans.org> Log: fix #192027 fix factory name to one really existent
*** Bug 190297 has been marked as a duplicate of this bug. ***
*** Bug 192900 has been marked as a duplicate of this bug. ***
*** Bug 190597 has been marked as a duplicate of this bug. ***