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 89801 - Java DB port number is preset to 1527
Summary: Java DB port number is preset to 1527
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Sun Appserver 9 (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Nitya Doraisamy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-22 01:49 UTC by John Baker
Modified: 2007-08-03 02:55 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Baker 2006-11-22 01:49:29 UTC
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
Comment 1 Jan Horvath 2006-11-24 14:35:17 UTC
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.
Comment 2 John Baker 2006-11-27 22:09:53 UTC
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.  
Comment 3 Petr Jiricka 2007-01-02 14:52:23 UTC
Is this really an issue in the Appserver plugin? Andrei, can you please
evaluate? Thanks.
Comment 4 Andrei Badea 2007-01-03 08:46:15 UTC
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.