[jboss-jira] [JBoss JIRA] Created: (JBAS-8496) NameNotFoundException during JNDI resource lookup

K C (JIRA) jira-events at lists.jboss.org
Wed Oct 6 03:18:40 EDT 2010


NameNotFoundException during JNDI resource lookup
-------------------------------------------------

                 Key: JBAS-8496
                 URL: https://jira.jboss.org/browse/JBAS-8496
             Project: JBoss Application Server
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions:  6.0.0.M5
         Environment: Windows XP SP3, jdk1.6.0_21
            Reporter: K C


Our servlet 2.5 app uses jndi lookup for the database (using Spring). The name in oracle-ds.xml is jndi/database and in the logs upon startup we get the following line:
 
[ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/database' to JNDI name 'java:jdbc/database'
 
In our web.xml, we have the following:
 
 <resource-ref>
 <res-ref-name>jdbc/database</res-ref-name>
 <res-type>javax.sql.DataSource</res-type>
 <res-auth>Container</res-auth>
 <mapped-name>java:jdbc/database</mapped-name>
 </resource-ref> 
 
When the app starts and tries to lookup jdbc/database in the Spring bean, it throws an exception:
 
Caused by: javax.naming.NameNotFoundException: jdbc not bound
 at org.jnp.server.NamingServer.getBinding(NamingServer.java:771) [:5.0.5.Final]
 at org.jnp.server.NamingServer.getBinding(NamingServer.java:779) [:5.0.5.Final]
 at org.jnp.server.NamingServer.getObject(NamingServer.java:785) [:5.0.5.Final]
 at org.jnp.server.NamingServer.lookup(NamingServer.java:396) [:5.0.5.Final]
 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728) [:5.0.5.Final]
 at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688) [:5.0.5.Final]
 at javax.naming.InitialContext.lookup(InitialContext.java:392) [:1.6.0_21]
  
When I do the lookup after the app is initialized, in a JSP, the same lookup returns the correct object.
 
So it seems like during initialization, the ENC-JNDI-style lookup (java:comp/env/...) doesn't work anymore, when they used to work in M4...

It only does this on M5 - M4 works fine. Both untouched extracted downloads, with the oracle-jdbc driver in server/default/lib and oracle-ds.xml in server/default/deploy.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list