Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My authentication fails with

java.sql.SQLException: no such table: credentials

where credentials is the name of the user/password table. I have checked the db file and the table is there. I think you also get this error when sqlite jdbc can't even find the file.

I am specifying my realm in a META-INF/context.xml file. Is there any trick to getting the path right? I have tried just about everything I can think of.

share|improve this question

You need your bean to be instantiated by something which knows how to handle the @Resrouce annotation. JSP itself doesn't know how.

In this case it would be simpler to locate the DataSource in the JNDI context:

Context initContext = new InitialContext();
Context envContext  = (Context) initContext.lookup("java:/comp/env");
DataSource ds = (DataSource) envContext.lookup("jdbc/myDS");
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.