0

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.

1 Answers1

0

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");
Noah
  • 259
  • 6
  • 12