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.
Build: NetBeans IDE 6.9.1 (Build 201007282301) VM: Java HotSpot(TM) Client VM, 19.0-b09, Java(TM) SE Runtime Environment, 1.6.0_23-b05 OS: Linux User Comments: jungmat: only crashed when C3P0 connection provider is activated thru hibernate.cfg.xml <property name="hibernate.connection.provider_class"> org.hibernate.connection.C3P0ConnectionProvider </property> magoarcano: I was trying to start writing the first lines in HQL editor with .cfg.xml file jungmat: when i'am trying to execute an HQL query in HQL Query netbeans interface Stacktrace: java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/DataSources at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:154) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
Created attachment 104859 [details] stacktrace
Created attachment 106960 [details] stacktrace I am trying to execute an hql query in HQL query editor ; C3P0 library is there when I am remove <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property> in hibernate.cfg.xml file the query is running fine Application is working fine even with or without the above config line maybe it's a bug in HQL Netbeans Editor ? Best Regards Matthieu
Unless I am mistaken D-Light is using HSQL, so Maria, please deal with evaluation of the issue.
Jarda, What we have in D-Light is H2 Java embedded database which uses SQL. Nothing to do with HQL... So I cannot evaluate and move back to platform ==Maria
Opps, sorry. I mistaken H2 SQL with HQL. Moving to hibernate.
Can someone provide sample project? What does it mean "C3P0 library is there"? Is "com/mchange/v2/c3p0/DataSources" in this library?
(In reply to comment #6) > Can someone provide sample project? > What does it mean "C3P0 library is there"? Is "com/mchange/v2/c3p0/DataSources" > in this library? Hello Sergey, Here below an hibernate.cfg.xml sample ; you can modify it so that it point to one of your own tables ; if you try to execute a simple HQL query, in my case <from Cities> in the netbeans HQL editor unless connection C3P0 provider (line commented) the query is working fine ; if you uncomment the C3P0 connection provider line you will receive the stacktrace ; if you run the "full" application (and consequently the queries) with the NetBeans <run> command (with connection provider C3P0) the application is also working fine. To give an answer to your other question about the library : "com/mchange/v2/c3p0/DataSources" is in this library. In view of the exchanges between the different NetBeans support teams, allow me to announce my intuition about this bug: given that the stacktrace arrives in one of first stages of execution, probably during the translation of HQL in SQL, I evaluate that it is the component HQL Editor which is not (or not yet) compatible with C3P0, as though the translator did not know what to make of the " connection provider "... Can you verify this supposition ? Thanks in advance Matthieu <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property> <property name="hibernate.connection.url">jdbc:mysql://fedora.linux.pc:3306/TripAssist</property> <property name="hibernate.connection.username">jungmat</property> <property name="hibernate.connection.password">******</property> <property name="hibernate.connection.autocommit">true</property> <property name="hibernate.show_sql">false</property> <!-- Caution : the next line does not work in HQL Query Console --> <!-- <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>--> <mapping resource="tripassist/entity/Cities.hbm.xml"/> </session-factory> </hibernate-configuration>
*** Bug 194647 has been marked as a duplicate of this bug. ***
The issue is reproducible during POJo generation also, and can't be resolved with addition of c3p0-0.9.1.jar. I'm not sure what provider is used by default but classloader used inside of hibernate code (and likely assigned by nb) can't access this class, hope it may be fixed but need more investigation.
*** Bug 201897 has been marked as a duplicate of this bug. ***
*** Bug 215551 has been marked as a duplicate of this bug. ***
*** Bug 226423 has been marked as a duplicate of this bug. ***
I came across this problem and posted it as a question in stackoverflow. Later then, I managed to solve the problem. It's not a bug, we just missed to add the "mchange-commons*.jar" from the c3p0 lib distribution. http://stackoverflow.com/questions/17508679/setting-up-hibernatec3p0-in-spring/17517276