Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC Realm using tomcat and oracle is not working for second time onwords.

Nazeer Ahammad
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm trying to execute one simple login authotication program using JDBCRealms. I wrote one program it was asking user name and password when i run first time, next time onwords it was not asking username and password. I restarted tomacat but no use, but if i restart my machine then if i run that application it will ask (Because it is first firm time). i tried using session.invalidate(),session.setMaxAge() and session timeout in dd(deployment discriptor) but i didn't get solution.So please help me how it is storing sessions ? where it is storing sessions? and how can i kill that sessions?

Used softwares:

tomcat 7
JDK 1.6
eclipse ide

used programs and configuration file are below:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" id="WebApp_ID" version="3.0">

<web-resource-name>JDBC Realm Example</web-resource-name>

context.xml in meta-inf folder
<?xml version="1.0" encoding="UTF-8"?>
<Realm className="org.apache.catalina.realm.JDBCRealm"

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Home page</title>
Index page
Invoke Generic Servlet

Thanks and Regards,
Nazeer Ahammad.
Tim Holloway
Saloon Keeper
Posts: 18325
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Helpful hint: We have a "Code" button on the message editor. It lays down special text tags that can be used to wrap pre-formatted text such as Java code and XML and make it more readable.

The session information is stored in the TOMCAT_HOME/work directory, I believe. For best results, I like to clean out the work, temp, and logs directory before starting Tomcat. Also, if I am deploying a WAR file, I remove the exploded WAR from the webapps directory, since a newer WAR file will not replace older/obsolete exploded WAR directory.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic