Meaningless messages when JNDI lookup fails.
--------------------------------------------

                 Key: OPENJPA-2023
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2023
             Project: OpenJPA
          Issue Type: Improvement
          Components: kernel
    Affects Versions: 2.0.1
            Reporter: Piotr Gliźniewicz


If OpenJPA is configured to get the DataSource from JNDI and the lookup fails 
it return meaningless messages.

lookupConnectionFactory(String name, String userKey) in 
org.apache.openjpa.conf.OpenJPAConfigurationImpl swallows exceptions if a 
NamingException is thrown during a JNDI lookup.

The effect is, that in createConnectionFactory in 
org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl, if a ConnectionFactoryName 
is provided which causes a NamingException, null is returned from 
getConnectionFactory() and it tries to get the DataSource using JDBC 
configuration data, what fails, since there aren't any provided. It ends up 
with a ArgumentException with message: "A JDBC Driver or DataSource class name 
must be specified in the ConnectionDriverName property." which is totally 
misleading.

Expected: the provider returns information about the failure to retrieve the 
DataSource from JNDI. It should silently fall back to using JDBC properties.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to