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.
NB 5.5 20060904: Using a DB connection to Oracle with the SUN JDBC drivers in the IDE works. But once that information is translated into the setup/sun* files, it appreas the information is not translated correctly:-( For instance the serverName property is not specified but required by the DataSource implementation. So the GF throws exceptions: RAR5038:Unexpected exception while creating resource RAR5117 : Failed to obtain/create connection. Reason : Connection could not be allocated because: [sunm][Oracle JDBC Driver]Missing connection information: no serverName specified. RAR5114 : Error allocating connection : [Error in allocating a connection. Cause: Connection could not be allocated because: [sunm][Oracle JDBC Driver]Missing connection information: no serverName specified.] WebModule[/Test-Oracle-DD-9]java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: [sunm][Oracle JDBC Driver]Missing connection information: no serverName specified. java.lang.RuntimeException: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: [sunm][Oracle JDBC Driver]Missing connection information: no serverName specified. at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorRow(CachedRowSetDataProvider.java:344) at com.sun.data.provider.impl.CachedRowSetDataProvider.setCursorIndex(CachedRowSetDataProvider.java:300) at com.sun.data.provider.impl.CachedRowSetDataProvider.getRowCount(CachedRowSetDataProvider.java:626) FYI, the error message seems to be different for each driver, so I'm guessing that it comes from the driver itself. E.g., with the IBM DB2 driver, I get: "Required property 'serverName' not set", and with some other driver I get: "the serverName property has not been set" [There is a Sun internal bug #6467923 on this]
Looks like the appserver requires the information in the url to be split up into serverName, portNumber, databaseName in addition to the url. Workaround, in the connection pool property sheet, provide these additional name/value pairs via the Properties field. Either register just this resource or redeploy. You can do the same via the admin console. It should work now. Downgrading to P2. WIll fix in the next day.
That worked. After manually adding the three properties, I could deploy apps that use the connection pool (using jTDS driver). Will try on some of the other drivers. This will be in the next Daily Build, right? Thanks!
Update: After adding these three properties, plus driverType=4, the IBM DB2 drivers seem to work.
good news and progress. Thanks for the testing.
Created attachment 33864 [details] diff for fix
Checked into release55_dev branch Checking in appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/CPWizard.xml; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/CPWizard.xml,v <-- CPWizard.xml new revision: 1.1.16.3.2.4.2.1; previous revision: 1.1.16.3.2.4 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/DatabaseUtils.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/Attic/DatabaseUtils.java,v <-- DatabaseUtils.java new revision: 1.1.2.4.2.1; previous revision: 1.1.2.4 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/WizardConstants.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/WizardConstants.java,v <-- WizardConstants.java new revision: 1.1.16.4.2.9.10.1; previous revision: 1.1.16.4.2.9 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceConfigurator.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceConfigurator.java,v <-- ResourceConfigurator.java new revision: 1.3.6.5.2.13.6.1; previous revision: 1.3.6.5.2.13 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceUtils.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceUtils.java,v <-- ResourceUtils.java new revision: 1.2.4.3.2.16.6.1; previous revision: 1.2.4.3.2.16 done Checking in appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/DomainEditor.java; /cvs/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/Attic/DomainEditor.java,v <-- DomainEditor.java new revision: 1.1.2.9.6.1; previous revision: 1.1.2.9 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle.properties; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle.properties,v <-- Bundle.properties new revision: 1.1.16.2.2.8.6.1; previous revision: 1.1.16.2.2.8 done
Created attachment 33923 [details] Updated patch
Fixed in release55_dev
diff approved
Update: I tested 5 different drivers, with the release55_dev build. *All passed* Details: Two drivers used to work, and still do. Tested for regression: - Derby/Derby - Oracle/Oracle Two drivers used to fail because of IZ# 84391, and now work: - Oracle/DataDirect - SQLServer/jTDS One driver used to fail because of IZ# 84405, and now works: - SQLServer/MS Looks good.
Addendum: Tested the IBM drivers for DB2. These used to fail because of IZ #84641 and IZ #84391. Now that #84391 is fixed, the method is to deploy once, fix up connection pool to add driverType, and redeploy. This works.
Checked in fix into release55 branch. Checking in appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/DomainEditor.java; /cvs/serverplugins/sun/appsrv81/src/org/netbeans/modules/j2ee/sun/ide/j2ee/Attic/DomainEditor.java,v <-- DomainEditor.java new revision: 1.1.2.10; previous revision: 1.1.2.9 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/CPWizard.xml; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/CPWizard.xml,v <-- CPWizard.xml new revision: 1.1.16.3.2.5; previous revision: 1.1.16.3.2.4 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/DatabaseUtils.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/Attic/DatabaseUtils.java,v <-- DatabaseUtils.java new revision: 1.1.2.5; previous revision: 1.1.2.4 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/WizardConstants.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/sunresources/beans/WizardConstants.java,v <-- WizardConstants.java new revision: 1.1.16.4.2.10; previous revision: 1.1.16.4.2.9 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle.properties; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/wizards/Bundle.properties,v <-- Bundle.properties new revision: 1.1.16.2.2.9; previous revision: 1.1.16.2.2.8 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceConfigurator.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceConfigurator.java,v <-- ResourceConfigurator.java new revision: 1.3.6.5.2.14; previous revision: 1.3.6.5.2.13 done Checking in appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceUtils.java; /cvs/serverplugins/sun/appsrv/src/org/netbeans/modules/j2ee/sun/ide/sunresources/beans/ResourceUtils.java,v <-- ResourceUtils.java new revision: 1.2.4.3.2.17; previous revision: 1.2.4.3.2.16 done
Please, can a QE member verify the fix in latest relase55 build and mark this issue as verified?
Tested on release55 branch latest build 20060929-1949. I did the following two scenarios testing: (1) Use Oracle JDBC driver ojdbc14.jar. In IDE Create a web application project. Create a JDBC datasource and a JDBC connection pool pointing to Oracle 9i DB. Deploy the web application that using the pool to create table and insert row. The application works fine. (2) Use JDBC driver( smbase.jar, smsqlserver.jar and smutil.jar) to connect MSSQL server. Create a Connect to DB works fine from IDE runtime. Use the same application mention above. Create JDBC datasource and a JDBC connection pool pointing to the MSSQL DB. This time the connection pool cannot connect to DB. From admin GUI, if you click ping button of the connection pool. The error will thrown: Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Connection could not be allocated because: [sunm][SQLServer JDBC Driver]A value was not specified for a required property: serverName Add serverName property either from IDE or admin GUI. Then the application works. Do not know if my finding is the same issue. Could please the issue submitter verify the fix in release55 branch?
Good catch. That seems to be an instance of the same problem. I tested the DataDirect drivers (which are the ones mentioned above) on Oracle and DB2, and they worked fine. An additional serverName property is added to the connection pool in each case. However, on SQL Server, they produce the error shown above. It looks like the additional serverName property is not being set on the sun_msftsqlpool. On this basis, I have reopened the issue.
Could Li or Jim attach the url associated with the MSSQL server
Created attachment 34748 [details] fix for mssql database
Sorry, just saw the request now. I think you got the information elsewhere, but the URL for connecting to SQL Server with the Sun DataDirect drivers is: jdbc:sun:sqlserver://<server_name>[:<portNumber>];databaseName=<database>;selectMethod=cursor It would probably be good to test with Sybase as well; I don't have access to a Sybase database right now, although I will try to find one.
I also tested the DataDirect drivers as obtained from DataDirect (i.e., non-Sun-branded): Driver Class: com.ddtek.jdbc.oracle.OracleDriver com.ddtek.jdbc.sqlserver.SQLServerDriver com.ddtek.jdbc.db2.DB2Driver URL: jdbc:datadirect:oracle://<server_name>[:<portNumber>];SID=<database> jdbc:datadirect:sqlserver://<server_name>[:<portNumber>];databaseName=<database> jdbc:datadirect:db2://<server_name>:<portNumber>DatabaseName=<database> This time, SQL Server and DB2 worked, but the Oracle version failed with a complaint about missing serverName. Sure enough, the datadirect_oraclePool did not have a serverName property.
Opened issue http://www.netbeans.org/issues/show_bug.cgi?id=86281 for new drivers that don't have all the properties. Closing this issue as the drivers identified in this issue were fixed.
Li, Please verify the fix in release55 for the drivers identified in the top level descriptions. I have opened another P2 86281 for the other drivers identified last week.
I tested SUN JDBC driver against Oracle 9i in release55 build NetBeans-release55-20061002-1452. I still see the issue. Reopen the bug. This time I use SUN JDBC Oracle driver (smbase.jar, smoracle.jar and smutil.jar). The following steps I performed: 1. Add sun JDBC driver (smbase.jar, smoracle.jar and smutil.jar) from IDE runtime 2. Add the JDBC driver also in application server 9.0 JVM classpath suffix and restart application server domain 3. Create a new project by inport .ear 4. In project create a JDBC connection pool by selecting new configuration using database. 5. select Sun DataDirect oracle driver. Give URL: jdbc:sun:oracle://jws-cust-880-1.red.iplanet.com:1523;SID=ORA9201 6. Register the connection pool 7. In application server admin GUI, ping the connection pool. The following error still thrown: Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Connection could not be allocated because: [sunm][Oracle JDBC Driver]Missing connection information: no serverName specified.
This configuration (Sun-branded DataDirect drivers on Oracle database) works for me. I just tested again, using Creator Shortfin: 1. Add sun JDBC driver (smbase.jar, smoracle.jar and smutil.jar) from IDE runtime 2. Copy the three jar files into App Server /lib directory, and restart 3. Right-click -> "Connect Using" to connect to DB. Fill in URL etc. 4. Open new project, of type Web -> Visual Web Application 5. Drag/drop table component onto form 6. Drag/drop DB table onto form 7. Run project. Works. Connection Pool (sun_oraclePool) is created, with four additional properties (serverName, SID, Password, User). JDBC Resource (jdbc/dataSource_1159856348281_) is created.
Li, Did you test the SUN JDBC driver against Oracle 9i zero-config resource creation or did you use the wizards to attempt to create the resource? The issue was filed and fixed against zero-config creation of resources. Jim indicates that it is working for him. Please clarify. The wizards use a seperate codepath. That still requires the user to do somelevel of setup and will be part of rewrite for the next gen.NB
Change status back to fixed
I created resource from wizard in project. I did not know non-zero scenario. Since Jim has verified the fix. Marked the bug verified. I suggest every bug submitter give detail reproduce steps so that other people could easily reproduce the issue.