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.

Bug 238667 - Driver missing in Create Entity Class From Database using MySQL Data Source
Summary: Driver missing in Create Entity Class From Database using MySQL Data Source
Status: NEW
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal with 3 votes (vote)
Assignee: TomasKraus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-21 16:33 UTC by strayan
Modified: 2015-02-23 10:28 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The name of the driver class in data source is missing - Error (202.79 KB, image/jpeg)
2013-11-21 16:33 UTC, strayan
Details
Connection pool general properties (116.74 KB, image/png)
2013-11-26 12:35 UTC, Martin Kozeny
Details
Connection pool additional properties (93.88 KB, image/png)
2013-11-26 12:36 UTC, Martin Kozeny
Details
Connection pool ping (121.43 KB, image/png)
2013-11-26 12:36 UTC, Martin Kozeny
Details
JDBC resource (92.93 KB, image/png)
2013-11-26 12:37 UTC, Martin Kozeny
Details
Add Restful WS choose DS (113.21 KB, image/png)
2013-11-26 12:37 UTC, Martin Kozeny
Details
Add Restful WS select server (122.37 KB, image/png)
2013-11-26 12:38 UTC, Martin Kozeny
Details
Add Restful WS get tables (102.73 KB, image/png)
2013-11-26 12:38 UTC, Martin Kozeny
Details
Glassfish 4.0 datasource when using not renamed JConnector 5.1.27 (123.64 KB, image/png)
2013-11-27 13:41 UTC, Martin Kozeny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description strayan 2013-11-21 16:33:26 UTC
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
Comment 1 Martin Kozeny 2013-11-25 08:12:44 UTC
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.
Comment 2 strayan 2013-11-25 09:13:49 UTC
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.
Comment 3 Martin Kozeny 2013-11-25 14:43:53 UTC
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.
Comment 4 Martin Kozeny 2013-11-25 15:08:06 UTC
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.
Comment 5 strayan 2013-11-25 18:39:45 UTC
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.
Comment 6 Martin Kozeny 2013-11-26 12:34:51 UTC
Quite strange. I am attaching screenshots from my settings for sure.
Comment 7 Martin Kozeny 2013-11-26 12:35:42 UTC
Created attachment 142589 [details]
Connection pool general properties
Comment 8 Martin Kozeny 2013-11-26 12:36:11 UTC
Created attachment 142590 [details]
Connection pool additional properties
Comment 9 Martin Kozeny 2013-11-26 12:36:36 UTC
Created attachment 142591 [details]
Connection pool ping
Comment 10 Martin Kozeny 2013-11-26 12:37:03 UTC
Created attachment 142592 [details]
JDBC resource
Comment 11 Martin Kozeny 2013-11-26 12:37:48 UTC
Created attachment 142594 [details]
Add Restful WS choose DS
Comment 12 Martin Kozeny 2013-11-26 12:38:10 UTC
Created attachment 142595 [details]
Add Restful WS select server
Comment 13 Martin Kozeny 2013-11-26 12:38:40 UTC
Created attachment 142596 [details]
Add Restful WS get tables
Comment 14 strayan 2013-11-27 06:30:38 UTC
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
Comment 15 strayan 2013-11-27 06:31:48 UTC
(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
Comment 16 strayan 2013-11-27 06:33:09 UTC
For 2) point I meant below
P: The version of MySQL Connector/J is 5.1.27 and not 5.1.23
Comment 17 Martin Kozeny 2013-11-27 09:18:00 UTC
(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.
Comment 18 strayan 2013-11-27 09:47:13 UTC
(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?
Comment 19 Martin Kozeny 2013-11-27 13:40:21 UTC
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!
Comment 20 Martin Kozeny 2013-11-27 13:41:30 UTC
Created attachment 142640 [details]
Glassfish 4.0 datasource when using not renamed JConnector 5.1.27
Comment 21 strayan 2013-11-27 15:19:06 UTC
It is not the same error I got. Please refer to attachment in the initial comment.
Comment 22 Martin Kozeny 2013-11-27 15:29:39 UTC
I know. Did you try settings as I've presented in https://netbeans.org/bugzilla/show_bug.cgi?id=238667#c19 ?
Comment 23 strayan 2013-11-27 15:47:37 UTC
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.
Comment 24 Martin Kozeny 2013-11-27 16:05:52 UTC
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.
Comment 25 gKar17 2014-02-21 15:27:10 UTC
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!
Comment 26 Collega 2014-04-16 13:03:52 UTC
Try to add property driverClass with value com.mysql.jdbc.Driver to additional parameters of JDBC Connection Pool
Comment 27 omniprof 2014-05-31 16:59:40 UTC
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.
Comment 28 thufir 2014-10-10 07:27:26 UTC
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.
Comment 29 barrel 2014-11-04 11:46:09 UTC
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
Comment 30 Drorcohen 2014-11-11 15:13:09 UTC
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 ?
Comment 31 Drorcohen 2014-11-17 09:04:46 UTC
Found a solution - using GF 4.1 and mysql jar 5.1.34 everything works as expected!
Comment 32 bryanosborne 2014-11-17 22:49:45 UTC
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.