Servlet Context unable to find the stated resource

javax.naming.NameNotFoundException
Javadoc
at org.apache.naming.NamingContext.lookup
(source)

Typical Exception Messages

  1. Name jdbc is not bound in this Context
  2. Name [comp/env] is not bound in this Context. Unable to find [comp].
  3. Name java:comp is not bound in this Context
  4. Unable to build entity manager factory
  5. Name comp is not bound in this Context
  6. Name [BeanManager] is not bound in this Context. Unable to find [BeanManager].
  7. Name [UserDatabase] is not bound in this Context. Unable to find [UserDatabase].
  8. Name [comp/env] is not bound in this Context. Unable to find [comp].
  9. El nombre jdbc no este asociado a este contexto
  10. Name java: is not bound in this Context

Specific cases

Solution

rp, 5 months ago

You are likely missing a resource definition under <GlobalNamingResources> in your Tomcat's server.xml file. Please ensure all specified resources are defined here first.

External results for this pattern (444)

  1. mlvo83via GitHub1 month ago
    Error creating bean with name 'entityManagerFactory' defined in org.baeldung.config.PersistenceJNDIConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in org.baeldung.config.PersistenceJNDIConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.sql.DataSource]: Factory method 'dataSource' threw exception; nested exception is javax.naming.NameNotFoundException: Name [jdbc/BaeldungDatabase] is not bound in this Context. Unable to find [jdbc].
    Show stack trace
  2. 843840via Oracle Community2 months ago
    Name jdbc is not bound in this Context
    Show stack trace
  3. 843840via Oracle Community3 months ago
    Name jdbc is not bound in this Context
    Show stack trace
  4. 843840via Oracle Community3 months ago
    Name jdbc is not bound in this Context
    Show stack trace
  5. Sarithavia Stack Overflow3 months ago
    Name [comp/env] is not bound in this Context. Unable to find [comp].
    Show stack trace
  6. Name [comp/env] is not bound in this Context. Unable to find [comp].
    Show stack trace
  7. phillipuniversevia GitHub3 months ago
    Name [blCustomerService] is not bound in this Context. Unable to find [blCustomerService].
    Show stack trace
  8. 807591via Oracle Community4 months ago
    Name JDBC is not bound in this Context
    Show stack trace
  9. Name comp is not bound in this Context
    Show stack trace
  10. kumarkrish85via GitHub4 months ago
    Name [comp/env] is not bound in this Contex t. Unable to find [comp].
    Show stack trace