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 89439 - Deployment of database drivers
Summary: Deployment of database drivers
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 1 vote (vote)
Assignee: Sherold Dev
URL: http://wiki.netbeans.info/wiki/view/J...
Keywords: API_REVIEW_FAST
: 90463 (view as bug list)
Depends on: 93807
Blocks: 89772 99610
  Show dependency tree
 
Reported: 2006-11-16 10:01 UTC by Petr Jiricka
Modified: 2007-04-30 16:12 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
javadoc (484.01 KB, application/octet-stream)
2007-03-28 16:53 UTC, Sherold Dev
Details
api diff (10.25 KB, patch)
2007-03-28 16:55 UTC, Sherold Dev
Details | Diff
server log for Sun AS9 with Mysql5 (536.50 KB, text/plain)
2007-04-28 01:59 UTC, Yousuf Haider
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2006-11-16 10:01:20 UTC
Support deployment of database drivers to the server to enhance the out of box
experience of NetBeans, and to get on par with Creator in this area.
Comment 1 Jayashri Visvanathan 2007-02-15 01:57:04 UTC
*** Issue 90463 has been marked as a duplicate of this issue. ***
Comment 2 Sherold Dev 2007-03-28 16:53:44 UTC
Created attachment 40095 [details]
javadoc
Comment 3 Sherold Dev 2007-03-28 16:55:06 UTC
Created attachment 40096 [details]
api diff
Comment 4 Sherold Dev 2007-03-28 17:02:33 UTC
For the description of the JDBC driver deployment support please refer to the
following document: http://wiki.netbeans.org/wiki/view/JDBCDriverDeployment.

List of affected interfaces:
org.netbeans.modules.j2ee.deployment.common.api.DatasourceHelper
org.netbeans.modules.j2ee.deployment.plugins.spi.JDBCDriverDeployer
org.netbeans.modules.j2ee.deployment.plugins.spi.OptionalDeploymentManagerFactory

Using the API_REVIEW_FAST keyword, since the changes are simple and compatible.
Comment 5 Petr Jiricka 2007-03-29 12:53:30 UTC
Regarding the method for finding database connections for a datasource - you are
suggesting this signature:
public static List<DatabaseConnection> findDatabaseConnections(Datasource
datasource);

However, the datasource alignment design document:
http://wiki.netbeans.org/wiki/view/VWPDataSourceIntegration

proposes the following signature:
public static List<DatabaseConnection> findDatabaseConnections(Datasource
datasource, boolean tryRegister);

Which one is correct? Do we need the tryRegister parameter and what for?
Comment 6 Sherold Dev 2007-03-29 13:42:01 UTC
I didn't know about this, I have just taken DatasourceHelper class as it was in
j2ee/utilities module.

Andrei, do we want to introduce the tryRegister parameter?
Comment 7 Andrei Badea 2007-03-29 14:06:41 UTC
Yes, but not now. The tryRegister parameter is needed for the case when no
database connection can be found for the data source. If that happens and
tryRegister is true, the New Database Connection (and also New JDBC Driver, if
needed) will be displayed, letting the user to register a matching connection.
The tryRegister parameter is not needed for the driver deployment IMHO.
Comment 8 John Baker 2007-03-30 06:40:20 UTC
Concerning the previous comment, when is "not now" ?

For driver deployment why not include tryRegister in
findDatabaseConnections(...) and just set tryRegister to false ?

For visualweb, I have a reference to j2ee/utilities
After the change, then, I guess from j2ee module, friend access to
org.netbeans.modules.visualweb.dataconnectivity is required
Comment 9 Sherold Dev 2007-03-31 13:10:48 UTC
Moving of DatasourceHelper from j2ee/utilities to j2eeserver module was removed
from this API change, since it is likely to be changed soon, see John's comment.

The API change was merged to trunk

Checking in ide/golden/deps.txt;
/cvs/ide/golden/deps.txt,v  <--  deps.txt
new revision: 1.500; previous revision: 1.499
done
Checking in ide/golden/friend-packages.txt;
/cvs/ide/golden/friend-packages.txt,v  <--  friend-packages.txt
new revision: 1.134; previous revision: 1.133
done
Checking in j2ee/utilities/manifest.mf;
/cvs/j2ee/utilities/manifest.mf,v  <--  manifest.mf
new revision: 1.15; previous revision: 1.14
done
Checking in j2ee/utilities/nbproject/project.xml;
/cvs/j2ee/utilities/nbproject/project.xml,v  <--  project.xml
new revision: 1.62; previous revision: 1.61
done
Checking in j2ee/utilities/src/org/netbeans/modules/j2ee/common/Util.java;
/cvs/j2ee/utilities/src/org/netbeans/modules/j2ee/common/Util.java,v  <--  Util.java
new revision: 1.13; previous revision: 1.12
done
RCS file:
/cvs/j2ee/utilities/test/unit/data/testcp/libs/org.netbeans.nondriver.jar,v
done
Checking in j2ee/utilities/test/unit/data/testcp/libs/org.netbeans.nondriver.jar;
/cvs/j2ee/utilities/test/unit/data/testcp/libs/org.netbeans.nondriver.jar,v  <--
 org.netbeans.nondriver.jar
initial revision: 1.1
done
RCS file:
/cvs/j2ee/utilities/test/unit/data/testcp/libs/org.netbeans.test.dbdriver.jar,v
done
Checking in
j2ee/utilities/test/unit/data/testcp/libs/org.netbeans.test.dbdriver.jar;
/cvs/j2ee/utilities/test/unit/data/testcp/libs/org.netbeans.test.dbdriver.jar,v
 <--  org.netbeans.test.dbdriver.jar
initial revision: 1.1
done
RCS file:
/cvs/j2ee/utilities/test/unit/data/testcp/shared/libs/org.netbeans.test.dbdriver.jar,v
done
Checking in
j2ee/utilities/test/unit/data/testcp/shared/libs/org.netbeans.test.dbdriver.jar;
/cvs/j2ee/utilities/test/unit/data/testcp/shared/libs/org.netbeans.test.dbdriver.jar,v
 <--  org.netbeans.test.dbdriver.jar
initial revision: 1.1
done
RCS file:
/cvs/j2ee/utilities/test/unit/src/org/netbeans/modules/j2ee/common/UtilTest.java,v
done
Checking in
j2ee/utilities/test/unit/src/org/netbeans/modules/j2ee/common/UtilTest.java;
/cvs/j2ee/utilities/test/unit/src/org/netbeans/modules/j2ee/common/UtilTest.java,v
 <--  UtilTest.java
initial revision: 1.1
done
Checking in j2eeserver/apichanges.xml;
/cvs/j2eeserver/apichanges.xml,v  <--  apichanges.xml
new revision: 1.26; previous revision: 1.25
done
Checking in j2eeserver/nbproject/project.properties;
/cvs/j2eeserver/nbproject/project.properties,v  <--  project.properties
new revision: 1.17; previous revision: 1.16
done
Checking in
j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/Deployment.java;
/cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/devmodules/api/Deployment.java,v
 <--  Deployment.java
new revision: 1.25; previous revision: 1.24
done
Checking in
j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ProgressObjectUtil.java;
/cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ProgressObjectUtil.java,v
 <--  ProgressObjectUtil.java
new revision: 1.3; previous revision: 1.2
done
Checking in
j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerInstance.java;
/cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ServerInstance.java,v
 <--  ServerInstance.java
new revision: 1.77; previous revision: 1.76
done
Checking in
j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ui/ProgressUI.java;
/cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/impl/ui/ProgressUI.java,v
 <--  ProgressUI.java
new revision: 1.20; previous revision: 1.19
done
Checking in
j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/JDBCDriverDeployer.java;
/cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/JDBCDriverDeployer.java,v
 <--  JDBCDriverDeployer.java
new revision: 1.2; previous revision: 1.1
done
Checking in
j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/OptionalDeploymentManagerFactory.java;
/cvs/j2eeserver/src/org/netbeans/modules/j2ee/deployment/plugins/spi/OptionalDeploymentManagerFactory.java,v
 <--  OptionalDeploymentManagerFactory.java
new revision: 1.3; previous revision: 1.2
done
Checking in tomcatint/tomcat5/nbproject/project.xml;
/cvs/tomcatint/tomcat5/nbproject/project.xml,v  <--  project.xml
new revision: 1.21; previous revision: 1.20
done
Checking in tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/Bundle.properties;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/Bundle.properties,v  <--
 Bundle.properties
new revision: 1.36; previous revision: 1.35
done
RCS file:
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/TomcatJDBCDriverDeployer.java,v
done
Checking in
tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/TomcatJDBCDriverDeployer.java;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/TomcatJDBCDriverDeployer.java,v
 <--  TomcatJDBCDriverDeployer.java
initial revision: 1.1
done
Checking in tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/TomcatManager.java;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/TomcatManager.java,v 
<--  TomcatManager.java
new revision: 1.90; previous revision: 1.89
done
Checking in
tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/ide/OptionalFactory.java;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/ide/OptionalFactory.java,v
 <--  OptionalFactory.java
new revision: 1.10; previous revision: 1.9
done
Checking in tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/ide/StartTomcat.java;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/ide/StartTomcat.java,v 
<--  StartTomcat.java
new revision: 1.88; previous revision: 1.87
done
Checking in
tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java;
/cvs/tomcatint/tomcat5/src/org/netbeans/modules/tomcat5/util/TomcatProperties.java,v
 <--  TomcatProperties.java
new revision: 1.17; previous revision: 1.16
done
Comment 10 Sherold Dev 2007-03-31 13:20:58 UTC
F.
Comment 11 John Baker 2007-04-28 01:22:37 UTC
Seems drivers are not copied.

* Create new Java EE 5 Web Application with Visual web framework, Glassfish as
target server
* Register Oracle driver and connection 
* drag and drop an Oracle table to the visual web page
* deploy

drivers not copied
Comment 12 John Baker 2007-04-28 01:23:21 UTC
Seems drivers are not copied.

* Create new Java EE 5 Web Application with Visual web framework, Glassfish as
target server
* Register Oracle driver and connection 
* drag and drop an Oracle table to the visual web page
* deploy

drivers are not copied to the application server's classpath
Comment 13 Yousuf Haider 2007-04-28 01:57:44 UTC
NBI Build: 200704270000
WinXp
JDK 1.6

Tried this on both Oracle10G and MySQL5.

1.Create a VWP app with Sun AS9(b41d) as target server.
2.Drag a table component.
3.Add a jdbc driver for Oracle/Mysql
4.Connect to a database server instance
5.Drag a Db table onto the table component.
 At design time the table will be bind to the data.
6.On deployment exceptions are thrown in the server log and the page is empty.

WA: Copy the driver to the Sun_ASServer/lib folder and then redeploy. Table will
come up with all of the data.


I am attaching the server log.
Comment 14 Yousuf Haider 2007-04-28 01:59:48 UTC
Created attachment 41910 [details]
server log for Sun AS9 with Mysql5
Comment 15 John Baker 2007-04-28 07:34:40 UTC
The reason for drivers not getting deployed appears to be that visualweb also
needs to implement some methods described in the spec.

Comment 16 Yousuf Haider 2007-04-29 10:30:04 UTC
Update:
NB M9 Build: 200704280000

I tried Mysql and JavaDb with Tomcat 5.5.17 and I am having no problems. I don't
need to copy the jars in that case. Still having problems with Glassfish though.

TC5.5.23 and TC6 seem to have a different issue with databinding:
http://www.netbeans.org/issues/show_bug.cgi?id=89439

Comment 17 Sherold Dev 2007-04-30 14:20:01 UTC
Closing as FIXED.

Please note that this issue is about API, not about support in the specific
server plug-in. Tomcat support was added only as a kind of reference implementation.


There is a different issue filed against GlassFish to implement this API.
Comment 18 Petr Jiricka 2007-04-30 16:12:58 UTC
Here is the issue for Sun AS:
http://www.netbeans.org/issues/show_bug.cgi?id=99610

And this is for JBoss:
http://www.netbeans.org/issues/show_bug.cgi?id=99609