javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".

Spring JIRA | Sephi Lipkin | 1 decade ago
  1. 0

    I use a servlet on Websphere V6 to initialize the application. Spring framework 1.2.5 is called to initialize the application context. There's a data source bean definition in the ApplicationContext.xml: <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:comp/env/jdbc/OracleJDBCDriver</value> </property> </bean> The exception below is thrown and I can't find what the problem could be. The reference to the data source is defined in web.xml . [17:08:58:328 IST 09/02/06] 00000010 ContextLoader E Context initialization failed [17:08:58:344 IST 09/02/06] 00000010 ContextLoader E TRAS0014I: The following exception was logged org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1716) at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1062) at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:985) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:198) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:139) at javax.naming.InitialContext.lookup(InitialContext.java:361) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123) at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121) at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:71) at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:106) at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:125) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1003) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:348) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48) at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1355) at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:371) at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:114) at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:127) at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:776) at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:729) at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:140) at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1019) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1028) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:538) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:724) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:683) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1161) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code)) at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1366) at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1012) at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerMBeanServerInterceptor.java:233) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java(Compiled Code)) at mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(SecurityMBeanServerInterceptor.java:86) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java(Compiled Code)) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java(Compiled Code)) at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invoke(ContextClassLoaderMBeanServerInterceptor.java:167) at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1249) at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:901) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java(Compiled Code)) at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:817) at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:139) at com.ibm.ws.management.connector.rmi.RMIConnectorService.invoke(RMIConnectorService.java:176) at com.ibm.ws.management.connector.rmi._RMIConnectorService_Tie.invoke(_RMIConnectorService_Tie.java:362) at com.ibm.ws.management.connector.rmi._RMIConnectorService_Tie._invoke(_RMIConnectorService_Tie.java(Compiled Code)) at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java(Compiled Code)) at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java(Compiled Code)) at com.ibm.rmi.iiop.ORB.process(ORB.java(Compiled Code)) at com.ibm.CORBA.iiop.ORB.process(ORB.java(Compiled Code)) at com.ibm.rmi.iiop.Connection.doWork(Connection.java(Compiled Code)) at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java(Compiled Code)) at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java(Compiled Code)) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code)) .

    Spring JIRA | 1 decade ago | Sephi Lipkin
    javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".
  2. 0

    I use a servlet on Websphere V6 to initialize the application. Spring framework 1.2.5 is called to initialize the application context. There's a data source bean definition in the ApplicationContext.xml: <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName"> <value>java:comp/env/jdbc/OracleJDBCDriver</value> </property> </bean> The exception below is thrown and I can't find what the problem could be. The reference to the data source is defined in web.xml . [17:08:58:328 IST 09/02/06] 00000010 ContextLoader E Context initialization failed [17:08:58:344 IST 09/02/06] 00000010 ContextLoader E TRAS0014I: The following exception was logged org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1716) at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1062) at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:985) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:198) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:139) at javax.naming.InitialContext.lookup(InitialContext.java:361) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123) at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121) at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:71) at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:106) at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:125) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1003) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:348) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48) at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1355) at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:371) at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:114) at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:127) at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:776) at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:729) at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:140) at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1019) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1028) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:538) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:724) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:683) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1161) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code)) at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1366) at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1012) at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerMBeanServerInterceptor.java:233) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java(Compiled Code)) at mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(SecurityMBeanServerInterceptor.java:86) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java(Compiled Code)) at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java(Compiled Code)) at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invoke(ContextClassLoaderMBeanServerInterceptor.java:167) at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1249) at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:901) at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java(Compiled Code)) at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:817) at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:139) at com.ibm.ws.management.connector.rmi.RMIConnectorService.invoke(RMIConnectorService.java:176) at com.ibm.ws.management.connector.rmi._RMIConnectorService_Tie.invoke(_RMIConnectorService_Tie.java:362) at com.ibm.ws.management.connector.rmi._RMIConnectorService_Tie._invoke(_RMIConnectorService_Tie.java(Compiled Code)) at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java(Compiled Code)) at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java(Compiled Code)) at com.ibm.rmi.iiop.ORB.process(ORB.java(Compiled Code)) at com.ibm.CORBA.iiop.ORB.process(ORB.java(Compiled Code)) at com.ibm.rmi.iiop.Connection.doWork(Connection.java(Compiled Code)) at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java(Compiled Code)) at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java(Compiled Code)) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code)) .

    Spring JIRA | 1 decade ago | Sephi Lipkin
    javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".
  3. 0

     

    fc2.com | 1 year ago
    javax.naming.NameNotFoundException: Name "comp/env/jdbc/SampleDataSource" not found in context "java:".
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    4 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. javax.naming.NameNotFoundException

      Name comp/env/jdbc not found in context "java:".

      at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal()
    2. WebSphere
      javaURLContextRoot.lookup
      1. com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1716)
      2. com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1062)
      3. com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:985)
      4. com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263)
      5. com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:198)
      6. com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:139)
      6 frames
    3. Java RT
      InitialContext.lookup
      1. javax.naming.InitialContext.lookup(InitialContext.java:361)
      1 frame
    4. Spring Context
      JndiObjectFactoryBean.afterPropertiesSet
      1. org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:123)
      2. org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:85)
      3. org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:121)
      4. org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:71)
      5. org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:106)
      6. org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:125)
      6 frames
    5. Spring Beans
      DefaultListableBeanFactory.preInstantiateSingletons
      1. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1003)
      2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:348)
      3. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
      4. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
      5. org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:269)
      5 frames
    6. Spring Context
      AbstractApplicationContext.refresh
      1. org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317)
      1 frame
    7. Spring
      ContextLoaderListener.contextInitialized
      1. org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:134)
      2. org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
      3. org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
      4. org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
      4 frames
    8. WebSphere
      ApplicationMgrImpl.startApplication
      1. com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1355)
      2. com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:371)
      3. com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:114)
      4. com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:127)
      5. com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:776)
      6. com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:729)
      7. com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:140)
      8. com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360)
      9. com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1019)
      10. com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1028)
      11. com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:538)
      12. com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:724)
      13. com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:683)
      14. com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1161)
      14 frames
    9. Java RT
      NativeMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
      3. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
      3 frames