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.

link|improve this question
feedback

1 Answer

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");
link|improve this answer
feedback

Your Answer

 
or
required, but never shown