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.
Created attachment 142454 [details] The name of the driver class in data source is missing - Error In New Entity Class From Database using MySQL Data Source wizard selecting any MySQL DataSource (DS) you got an error pop up window saying: "The name of the driver class in data source is missing". - Please refer to attachment Product Version: NetBeans IDE 7.4 (Build 201310111528) 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: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb) User directory: C:\Users\krithu\AppData\Roaming\NetBeans\7.4 Cache directory: C:\Users\krithu\AppData\Local\NetBeans\Cache\7.4 When following Step 2) of Section "Generating Entity Classes and RESTful Services" in the tutorial https://netbeans.org/kb/70/websvc/rest.html Getting "Driver Class Error" as shown in attachment
It works fine for me on Product Version: NetBeans IDE Dev (Build 201311210002) Updates: Updates available Java: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b13 System: Windows 7 version 6.1 running on x86; Cp1252; en_US (nb) when following tutorial. Let's look under Services tab, Databases node on Folder Drivers. There should be item MySQL (Connector/J driver). Also check if under following path ${path_to_ide}\ide\modules\ext\mysql-connector-java-5.1.23-bin.jar exists that jar. Thanks.
Sorry for the confusion, when you create the DataSource from the NetBean IDE like mentioned in the tutorial it works fine like you said. But when selecting a DataSource that is created outside (using GlassFish Server Admin console) of the IDE which shows in the IDE we see the error.
I've created DataSource using web interface of glassfish and everything works fine for me same as before. I think, that you probably forget to add jdbc driver to ${GLASSFISH_INSTALL}/glassfish/lib. It could be ${path_to_ide}\ide\modules\ext\mysql-connector-java-5.1.23-bin.jar.
No I am wrong, you have to put this driver to glassfish's lib only when you want to ping database from glassfish admin console. Netbeans probably takes own driver from ${path_to_ide}\ide\modules\ext\mysql-connector-java-5.1.23-bin.jar. You have to edit your JDBC Connection Pool in admin console and set additional properties like user, password, url, databaseName, serverName. In general settings you have to put as Resource Type java.sql.Driver and as Datasource Classname and Driver Classname com.mysql.jdbc.Driver. When I removed additional properties, I get the same error as you.
1) ${path_to_ide}\ide\modules\ext\mysql-connector-java-5.1.27-bin.jar (the same Jar file as in GlassFish Server) 2) Changed the Resource Type java.sql.Driver from java.sql.Datasource (as specified in Glassfiss doc., note this was working from IDE) and as Datasource Classname and Driver Classname com.mysql.jdbc.Driver 3) Made sure following property were set user, password, url, databaseName, serverName Left the additional properties, did not remove any and still get the same error when selecting the DataSource from IDE.
Quite strange. I am attaching screenshots from my settings for sure.
Created attachment 142589 [details] Connection pool general properties
Created attachment 142590 [details] Connection pool additional properties
Created attachment 142591 [details] Connection pool ping
Created attachment 142592 [details] JDBC resource
Created attachment 142594 [details] Add Restful WS choose DS
Created attachment 142595 [details] Add Restful WS select server
Created attachment 142596 [details] Add Restful WS get tables
Few Pointers (P) and Questions (Q) 1) Q: Why use Driver Object/Interface to connect DB instead of "DataSource" using JDBC? - Most Java & DB doc suggests we use DataSource 2) P: The version of MySQL Connector/J is 5.1.27 and not 5.1.27 - This is the latest version that is used by Glassfish4 and NB 7.4 3) P: Please note the ySQL Connector/J 5.1.25 changelog for "Driver Name" issue found in SQL Connector/J 5.1.23 (http://www.softpedia.com/progChangelog/MySQL-Connector-J-Changelog-235129.html) 4) Refer to below bug as well which were recently opened against Netbean, who is also seeing it in Netbean 7.4 version https://netbeans.org/bugzilla/show_bug.cgi?id=235511 https://netbeans.org/bugzilla/show_bug.cgi?id=232715 Will try again and report back, till then pls ignore below comment 5) P: Ping test failed when I used Driver Object/Interface from glassfish but passed when used Datasource Object/Interface
(In reply to strayan from comment #14) > Few Pointers (P) and Questions (Q) > 1) Q: Why use Driver Object/Interface to connect DB instead of "DataSource" > using JDBC? > - Most Java & DB doc suggests we use DataSource > 2) P: The version of MySQL Connector/J is 5.1.27 and not 5.1.23 > - This is the latest version that is used by Glassfish4 and NB 7.4 > 3) P: Please note the ySQL Connector/J 5.1.25 changelog for "Driver Name" > issue found in SQL Connector/J 5.1.23 > (http://www.softpedia.com/progChangelog/MySQL-Connector-J-Changelog-235129. > html) > 4) Refer to below bug as well which were recently opened against Netbean, > who is also seeing it in Netbean 7.4 version > https://netbeans.org/bugzilla/show_bug.cgi?id=235511 > https://netbeans.org/bugzilla/show_bug.cgi?id=232715 > > Will try again and report back, till then pls ignore below comment > 5) P: Ping test failed when I used Driver Object/Interface from glassfish > but passed when used Datasource Object/Interface
For 2) point I meant below P: The version of MySQL Connector/J is 5.1.27 and not 5.1.23
(In reply to strayan from comment #14) > Few Pointers (P) and Questions (Q) > 1) Q: Why use Driver Object/Interface to connect DB instead of "DataSource" > using JDBC? > - Most Java & DB doc suggests we use DataSource I don't know exactly what you actually mean by this, but I've followed this tutorial http://dev.mysql.com/doc/refman/5.1/en/connector-j-usagenotes-glassfish-config.html and I am using Glassfish 3.1.2.2. I classically create JDBC Connection pool and then JDBC Resource, and here resource mean datasource...see this comment in tutorial: Now that you have created a connection pool you will also need to create a JDBC Resource (data source) for use by your application. > 2) P: The version of MySQL Connector/J is 5.1.27 and not 5.1.27 > - This is the latest version that is used by Glassfish4 and NB 7.4 I am using this version of connector, b/c it was located in my LATEST NetBeans Dev build path ${path_to_ide}\ide\modules\ext\ All in all when I use glassfish 4.0 with JConnector 5.1.27, NetBeans told me, that they cannot find suitable driver (but com.mysql.jdbc.Driver class is present in JConnector 5.1.27), when I use 5.1.23 everythings works fine for me also for glassfish 4.0. Reassigning to default owner for sure.
(In reply to Martin Kozeny from comment #17) > (In reply to strayan from comment #14) > > Few Pointers (P) and Questions (Q) > > 1) Q: Why use Driver Object/Interface to connect DB instead of "DataSource" > > using JDBC? > > - Most Java & DB doc suggests we use DataSource > > I don't know exactly what you actually mean by this, but I've followed this > tutorial > http://dev.mysql.com/doc/refman/5.1/en/connector-j-usagenotes-glassfish- > config.html and I am using Glassfish 3.1.2.2. I classically create JDBC > Connection pool and then JDBC Resource, and here resource mean > datasource...see this comment in tutorial: Now that you have created a > connection pool you will also need to create a JDBC Resource (data source) > for use by your application. > You requested to select java.sql.Driver instead of javax.sql.DataSource, the ling you sent suggests "DataSource". > > 2) P: The version of MySQL Connector/J is 5.1.27 and not 5.1.23 > > - This is the latest version that is used by Glassfish4 and NB 7.4 > > I am using this version of connector, b/c it was located in my LATEST > NetBeans Dev build path ${path_to_ide}\ide\modules\ext\ > > > > All in all when I use glassfish 4.0 with JConnector 5.1.27, NetBeans told > me, that they cannot find suitable driver (but com.mysql.jdbc.Driver class > is present in JConnector 5.1.27), when I use 5.1.23 everythings works fine > for me also for glassfish 4.0. Reassigning to default owner for sure. You were able to repro the issue, correct?
No I am not able to reproduce this error. When I use glassfish 4.0 and JConnector 5.1.27 (located in ${path_to_ide}\ide\modules\ext\) I get error you can see in screentshot below both for java.sql.Driver and javax.sql.DataSource. Glassfish 4.0 works fine for me when using JConnector 5.1.23 (located in ${path_to_ide}\ide\modules\ext\ by default) both for java.sql.Driver and javax.sql.DataSource. BUT listen! :) When I rename mysql-connector-java-5.1.27.jar located in ${path_to_ide}\ide\modules\ext\ to mysql-connector-java-5.1.23.jar it works fine for me both for java.sql.Driver and javax.sql.DataSource!
Created attachment 142640 [details] Glassfish 4.0 datasource when using not renamed JConnector 5.1.27
It is not the same error I got. Please refer to attachment in the initial comment.
I know. Did you try settings as I've presented in https://netbeans.org/bugzilla/show_bug.cgi?id=238667#c19 ?
No, I didn't try because of following 1) Concerned renaming will cause some other issue 2) Not clear on the root cause what causes the issue in GF4 with 5.1.27 3) There are multiple versions of J/Connector a) for GF4, b) for Netbean IDE and c) MySQL - not clear why can't we use same version 5.1.23 everywhere instead of renaming.
I cannot do more for you, b/c I am not owner of this component so please wait until someone from glassfish reply to you. Thank you.
I had the same issue. I removed both ConnectionPool and Resource from Glassfish, removed also the Database from Services tab, Databases and create a new Connection pool (having only as Additional Params User, Port, DatabaseName, Password, Url and URL - maybe less required, but those are what I have), JDBC resource (those took place in the glassfish admin console) and restart NetBeans. After restart I tried to create Entity Class from database and when I locate it, it asked me params for a new glassfish service. Complete them and no entities shown. But when I restarted glassfish, everything was fine!
Try to add property driverClass with value com.mysql.jdbc.Driver to additional parameters of JDBC Connection Pool
Ran into the same problem with GlassFish 4.0, NetBeans 8.0 and Java 1.8 when using a Driver. The previous comment is the solution. "add property driverClass with value com.mysql.jdbc.Driver to additional parameters of JDBC Connection Pool" When using a DataSource carefully review the long list of parameters. There are a number of items to be filled in. Will blog about them soon.
see also: http://stackoverflow.com/questions/26249567/glassfish-the-name-of-the-driver-class-for-the-datasource-is-missing Perhaps it's an error on my end, or perhaps it's a bug -- I'm not sure yet. Seems to be the same issue.
Same problem using an Oracla database connection. The fix using the driverClass as property does not work for me, it was already listed in the property list
I'm experiencing this problem on a ubuntu 14.04LTS. 64 bit. I've also tried the latest 5.1.34 jar file. trying to downgrade back to 5.1.23 still doesn't solve. Any workarounds ?
Found a solution - using GF 4.1 and mysql jar 5.1.34 everything works as expected!
Comment on attachment 142454 [details] The name of the driver class in data source is missing - Error Having same issue when attempting to create New Entity Classes from Database. Added the “driverClass” property to the connection pool with value “com.mysql.jdbc.Driver” which got rid of the Error message, but now NetBeans displays a New Connection Wizard when I select a Data Source. After a new connection is added (which requires first deleting the existing one) I am returned to the New Entity Classes from Database with no tables presented in the Available Tables area and the "Select the table source" message remains. Selecting the Data Source again begins an infinite loop of attempting to add a New Connection which NetBeans won't recognize. Any help on this is appreciated.