Add localDataSource="true" to the realm when using local database.


Make sure you use the same name for your database everywhere in context.xml.


Try removing the server.xml file and adding it again to the project, and do a Clean Build.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Java : Datasource et action servlet indisponible
    via by Unknown author,
  • Tomcat - User - JNDI Could not find datasource
    via by Unknown author,
  • EntityManager JNDI - name not found
    via Stack Overflow by plewand
    • javax.naming.NameNotFoundException: El nombre jdbc no este asociado a este contexto at org.apache.naming.NamingContext.lookup( at org.apache.naming.NamingContext.lookup( at org.apache.naming.SelectorContext.lookup( at javax.naming.InitialContext.lookup( at org.hibernate.connection.DatasourceConnectionProvider.configure( at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider( at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider( at org.hibernate.cfg.SettingsFactory.createConnectionProvider( at org.hibernate.cfg.SettingsFactory.buildSettings( at org.hibernate.cfg.Configuration.buildSettings( at org.hibernate.cfg.Configuration.buildSessionFactory( at at at

    Users with the same issue

    6 times, last one,
    1 times, last one,
    2 times, last one,
    13 times, last one,
    Unknown visitor1 times, last one,
    29 more bugmates