Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353143 - JNDI data source take design time username/pass
Summary: JNDI data source take design time username/pass
Status: VERIFIED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 3.7.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Bin Feng CLA
QA Contact: Maggie Shen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 353280
  Show dependency tree
 
Reported: 2011-07-26 13:39 EDT by Lin Zhu CLA
Modified: 2011-11-13 21:14 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lin Zhu CLA 2011-07-26 13:39:38 EDT
In current JNDI support, if user provide username/password in connection property, after acquire a JNDI DataSource, we will first try to connect using the username/password with API java.sql.DataSource.getConnection(String,String). If the API call failed with either a SQLException or UnsupportedOperationException, we will then try to use API java.sql.DataSource.getConnection() which includes no authentication information.

However, for JBOSS' case, the exception thrown is JBOSSResourceException, which is not a subclass of SQLException. We then simply re-throw the exception, which leads to problem.

For detailed discussion, please see http://www.birt-exchange.org/org/forum/index.php/topic/22953-jndi-datasource/
Comment 1 Bin Feng CLA 2011-11-13 20:57:38 EST
Currently while opening JNDI connection, Datasource.getConnection(String, String) with user credential is use to make initial connection attempt; While the initial attempt failed, attempt Datasource.getConnection() without user credential. This is not a problem for design time. In runtime environment, username/password usually differs from design time; Opening a JNDI connection against application server usually does not require using username/passwords.

According to the requirement above, the process of getting JNDI connection is changed as below:
1. Attemp obtaining connection by Datasource.getConnection() and catch any exception.
2. If Step#1 failed, try obtaining connection by Datasource.getConnection(String, String)
3. If all above failed, try obtaining connection by JDBC URL.
Comment 2 Bin Feng CLA 2011-11-13 21:10:12 EST
Fixed
Comment 3 Maggie Shen CLA 2011-11-13 21:14:29 EST
verified on build 3.7.2.v20111107-1411.