javax.naming.NameNotFoundException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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)) .
    via by Sephi Lipkin,
  • 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)) .
    via by Sephi Lipkin,
  •  
    via by Unknown author,
  • When configuraing jBPM / Hibernate with a datasource in an Enterprise application, using a local JNDI reference (java:comp/env/...) the web application works properly, accessing the database without any problem. But if you declare the JobExecutorServlet in the web application's web.xml, each time the this servlet JobExecutorThread fires, it generates exceptions: [22/08/07 18:33:03:175 CEST] 0000005e SystemOut O 18:33:03 DEBUG org.jbpm.job.executor.JobExecutorThread : acquiring jobs for execution... [22/08/07 18:33:03:315 CEST] 0000005f javaURLContex E NMSV0310E: Une opération JNDI sur un nom "java:" ne peut pas aboutir car le contexte d'exécution du serveur ne peut pas associer l'unité d'exécution de l'opération à un composant d'application J2EE. Cette condition peut se produire lorsque le client JNDI utilisant le nom "java:" n'est pas exécuté sur l'unité d'exécution d'une demande d'application du serveur. Assurez-vous qu'une application J2EE n'exécute pas d'opérations JNDI sur des noms "java:" dans des blocs de code statiques ou dans des unités d'exécution créées par cette application J2EE. Un code de ce type ne s'exécute pas nécessairement sur l'unité d'exécution d'une demande d'application du serveur et n'est donc pas pris en charge par les opérations JNDI sur les noms "java:". Trace de pile d'exceptions : javax.naming.ConfigurationException [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".] at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:411) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:388) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144) at javax.naming.InitialContext.lookup(InitialContext.java:363) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767) at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083) at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384) ... 17 more [22/08/07 18:33:03:347 CEST] 0000005e SystemOut O 18:33:03 FATAL org.hibernate.connection.DatasourceConnectionProvider : Could not find datasource: java:comp/env/jdbc/dsJBPM javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime is not able to associate the operation's thread with any J2EE application component. This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request. Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".] at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:416) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:388) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144) at javax.naming.InitialContext.lookup(InitialContext.java:363) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767) at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083) at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384) ... 17 more [22/08/07 18:33:03:347 CEST] 0000005e SystemOut O 18:33:03 ERROR org.jbpm.job.executor.JobExecutorThread : exception in job executor thread. waiting 10000 milliseconds org.hibernate.HibernateException: Could not find datasource at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime is not able to associate the operation's thread with any J2EE application component. This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request. Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".] at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:416) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:388) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144) at javax.naming.InitialContext.lookup(InitialContext.java:363) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) ... 13 more Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767) at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083) at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384) ... 17 more The exception is raised even if there is no timer in the process definition. If I replace the local JNDI reference (java:comp/env/jdbc/datasource) with the global JNDI name (jdbc/dsOracle) the JobExecutorThread works fine (even if Websphere logs warning due to direct use of the global JNDI reference). The JobExecutorThread also works if I replace the datasource with the database access parameters (driver, url, ...). (sample ear is available to reproduce the bug if necessary)
    via by Jacques Desmazières,
  • When configuraing jBPM / Hibernate with a datasource in an Enterprise application, using a local JNDI reference (java:comp/env/...) the web application works properly, accessing the database without any problem. But if you declare the JobExecutorServlet in the web application's web.xml, each time the this servlet JobExecutorThread fires, it generates exceptions: [22/08/07 18:33:03:175 CEST] 0000005e SystemOut O 18:33:03 DEBUG org.jbpm.job.executor.JobExecutorThread : acquiring jobs for execution... [22/08/07 18:33:03:315 CEST] 0000005f javaURLContex E NMSV0310E: Une opération JNDI sur un nom "java:" ne peut pas aboutir car le contexte d'exécution du serveur ne peut pas associer l'unité d'exécution de l'opération à un composant d'application J2EE. Cette condition peut se produire lorsque le client JNDI utilisant le nom "java:" n'est pas exécuté sur l'unité d'exécution d'une demande d'application du serveur. Assurez-vous qu'une application J2EE n'exécute pas d'opérations JNDI sur des noms "java:" dans des blocs de code statiques ou dans des unités d'exécution créées par cette application J2EE. Un code de ce type ne s'exécute pas nécessairement sur l'unité d'exécution d'une demande d'application du serveur et n'est donc pas pris en charge par les opérations JNDI sur les noms "java:". Trace de pile d'exceptions : javax.naming.ConfigurationException [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".] at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:411) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:388) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144) at javax.naming.InitialContext.lookup(InitialContext.java:363) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767) at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083) at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384) ... 17 more [22/08/07 18:33:03:347 CEST] 0000005e SystemOut O 18:33:03 FATAL org.hibernate.connection.DatasourceConnectionProvider : Could not find datasource: java:comp/env/jdbc/dsJBPM javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime is not able to associate the operation's thread with any J2EE application component. This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request. Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".] at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:416) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:388) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144) at javax.naming.InitialContext.lookup(InitialContext.java:363) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767) at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083) at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384) ... 17 more [22/08/07 18:33:03:347 CEST] 0000005e SystemOut O 18:33:03 ERROR org.jbpm.job.executor.JobExecutorThread : exception in job executor thread. waiting 10000 milliseconds org.hibernate.HibernateException: Could not find datasource at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124) at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56) at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292) at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91) at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94) at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98) at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersistenceService.java:354) at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563) at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread.java:109) at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:56) Caused by: javax.naming.ConfigurationException: A JNDI operation on a "java:" name cannot be completed because the serverruntime is not able to associate the operation's thread with any J2EE application component. This condition can occur when the JNDI client using the "java:" name is not executed on the thread of a server application request. Make sure that a J2EE application does not execute JNDI operations on "java:" names within static code blocks or in threads created by that J2EE application. Such code does not necessarily run on the thread of a server application request and therefore is not supported by JNDI operations on "java:" names. [Root exception is javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:".] at com.ibm.ws.naming.java.javaURLContextImpl.throwConfigurationExceptionWithDefaultJavaNS(javaURLContextImpl.java:416) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:388) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:204) at com.ibm.ws.naming.java.javaURLContextRoot.lookup(javaURLContextRoot.java:144) at javax.naming.InitialContext.lookup(InitialContext.java:363) at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52) ... 13 more Caused by: javax.naming.NameNotFoundException: Name comp/env/jdbc not found in context "java:". at com.ibm.ws.naming.ipbase.NameSpace.getParentCtxInternal(NameSpace.java:1767) at com.ibm.ws.naming.ipbase.NameSpace.lookupInternal(NameSpace.java:1083) at com.ibm.ws.naming.ipbase.NameSpace.lookup(NameSpace.java:991) at com.ibm.ws.naming.urlbase.UrlContextImpl.lookup(UrlContextImpl.java:1263) at com.ibm.ws.naming.java.javaURLContextImpl.lookup(javaURLContextImpl.java:384) ... 17 more The exception is raised even if there is no timer in the process definition. If I replace the local JNDI reference (java:comp/env/jdbc/datasource) with the global JNDI name (jdbc/dsOracle) the JobExecutorThread works fine (even if Websphere logs warning due to direct use of the global JNDI reference). The JobExecutorThread also works if I replace the datasource with the database access parameters (driver, url, ...). (sample ear is available to reproduce the bug if necessary)
    via by Jacques Desmazières,
    • 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)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    3 more bugmates