[jboss-jira] [JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
Igor Shulika (JIRA)
issues at jboss.org
Mon Feb 10 18:27:28 EST 2014
Igor Shulika created WFLY-2898:
----------------------------------
Summary: JNDI Name lookup of the DataSource returns NULL
Key: WFLY-2898
URL: https://issues.jboss.org/browse/WFLY-2898
Project: WildFly
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Web (Undertow)
Affects Versions: 8.0.0.CR1, 8.0.0.Final
Reporter: Igor Shulika
Assignee: Stuart Douglas
Priority: Blocker
Hi,
I'm having a problem to obtain DataSource using JNDI Name lookup.
Please see my code below:
Connection connection = null;
DataSource dataSource = null;
try {
final Context initContext = new InitialContext();
dataSource = (DataSource) initContext.lookup("java:/MyDataSource"); connection = dataSource.getConnection();
} catch (Exception e) {
LOGGER.error(e);
}
I'm doing initContext.lookup from a servlet, everything is working on JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14).
Also I can find and test connection of my “java:/MyDataSource” under the “Datasources” section of the WildFly Administration Console just fine(anoter word the datasource is there).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list