[jboss-jira] [JBoss JIRA] (WFLY-2896) Cannot obtain DataSource using JNDI Name lookup
Igor Shulika (JIRA)
issues at jboss.org
Mon Feb 10 17:53:28 EST 2014
[ https://issues.jboss.org/browse/WFLY-2896?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12943255#comment-12943255 ]
Igor Shulika edited comment on WFLY-2896 at 2/10/14 5:53 PM:
-------------------------------------------------------------
I'm doing initContext.lookup from a servlet, would be that is Undertow issue, because everything is working on JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14)?
was (Author: eagleigor):
I'm doing initContext.lookup from a servlet, would be that is Undertow issue, because everything is working on JBoss EAP 6.2?
> Cannot obtain DataSource using JNDI Name lookup
> -----------------------------------------------
>
> Key: WFLY-2896
> URL: https://issues.jboss.org/browse/WFLY-2896
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming
> Affects Versions: 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: David Lloyd
> Priority: Blocker
> Fix For: 8.0.0.Final
>
>
> Hi,
> I'm having a problem to obtain DataSource using JNDI Name lookup.
> Please see my code and error 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);
> }
> Caused by: javax.naming.NamingException: JBAS011832: Could not dereference object [Root exception is java.lang.NullPointerException]
> at org.jboss.as.naming.NamingContext.getObjectInstance(NamingContext.java:526)
> at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:236)
> at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:233)
> at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)
> at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
> at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_45]
> at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_45]
> ... 10 more
> Caused by: java.lang.NullPointerException
> at org.jboss.as.naming.NamingContext.getObjectInstance(NamingContext.java:522)
> ... 17 more
--
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