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.
A Java DB connection url doesn't require a port number. However, the serverplugin injects ":1527" in the url This affects the visual web pack as the resource url returned from the serverplugin contains the port number even though the connection created doesn't have a port number e.g. jdbc:derby://localhost/travel is a valid url but the serverplugin returns jdbc:derby://localhost:1527/travel
Could you describe how this affects the visual web pack? This can probably cause that on appserver are registrated two Data Sources for one database thus this is not P1. Reassigning to appropriate subcomponent.
When a new connection is added to NetBeans using the url, jdbc:derby://localhost/travel, VWP uses this connection to create a rowset. What was happening in VWP was a new data source name was being generated for subsequent uses of database tables in an application . As a result, while checking to see if a data source existed, the comparison of the url of one connection jdbc:derby://localhost/travel to the modified connection jdbc:derby://localhost:1527/travel (returned by an instance of RequestedJdbcResource.getUrl() ) , failed - differed by port number. When a comparision fails, a new datasource is generated. As a result, the database tables added to the application could not be used - connection to the database through the data source failed. Since multiple data sources for the same connection parameters were being created, VWP tries to use the first matching data source, but as a result, a mismatch with JDBC resources and a connection failed error occur As a result, a hack was integrated into VWP to get around this issue. Agree, this is not a P1.
Is this really an issue in the Appserver plugin? Andrei, can you please evaluate? Thanks.
Yes, this is an issue in the plugin. It is caused by the fact that the appserver works with data sources, where the database URL is split into data source properties like server name, port, user name and password. But Datasource.getURL() requires the plugin to return a database URL, which it obtains by concatenating these properties. The appserver could perhaps try to create both versions of the URL (with and without a port number) and return the one which is used in a database connection in the Runtime tab. It should basically try to ensure that DatasourceHelper.findDatabaseConnections(Datasource) in j2ee/utilities will return a non-zero list if possible.
Fixed for most cases by fix for IZ103161. Also fixed the original codepath which is now the fallback. IZ103161 adds a new codepath for most zero-config resource creation and reconstruction of url. http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/DatabaseUtils.java?r1=1.2&r2=1.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/DomainEditor.java?r1=1.6&r2=1.7 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceConfigurator.java?r1=1.19&r2=1.20 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceUtils.java?r1=1.25&r2=1.26