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 248217

Summary: RESTful Web Services from Database won't recognize data source
Product: serverplugins Reporter: dmitri_k
Component: WildFlyAssignee: ehsavoie <ehsavoie>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.1   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:

Description dmitri_k 2014-10-27 18:34:07 UTC
I am having hard time adding a RESTful Web Services from Database to a Maven web application with NetBeans 8.0.1, WildFly 8.1.0 Final, and SQL Server (or any) database.

In WildFly server, I created datasource connections to local MySQL database, and two connections to SQL Server database, using MS JDBC driver and jTDS driver, enabled them all. In NetBeans > Services > Databases, added corresponding drivers and tested connections:
- MySQL (Connector/J driver) - mysql-connector-java-5.1.33-bin.jar
- Microsoft SQL Server 2005 - sqljdbc4.jar
- jTDS - jdts-1.2.5.jar

In the project, when I add New RESTful Web Service from Database... >, I can see all these data sources in the drop-down list.

Problem is: when I try to select ANY data source, I am getting the error:
"Unable to find the driver <name>. Register this driver in the Databases tab". 

This happens even if I select default data source that comes with WildFly server java:/jboss/datasources/ExampleDS[jdbc:h2:mem:test...]

But if I see them in the list of Drivers, doesn't it mean they are not registered?

Additionally, driver name in the error message in case of MySQL data source doesn't look right (maybe it has something to do with the problem): 
"Unable to find the driver mysql-connector-java-5.1.33-bin.jar_com.mysql.jdbc.Driver_5_1. Register this driver in the Databases tab". 

Am I missing something, or it really is a bug?
Comment 1 dmitri_k 2014-10-27 23:56:49 UTC
I figured out what was the problem. I had to manually add this section:

<driver name="mysqlDriver" module="com.mysql">
  <driver-class>com.mysql.jdbc.Driver</driver-class>
  <xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
</driver>

to standalone-full.xml - that actually made it available for "RESTful Web Service from Database" wizard, not the fact that it is registered in NetBeans. 
Kind of misleading message. 

Sorry for the trouble, you can close the ticket.
I think I can manage to do the same for SQL Server driver which is my goal.