You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Wang, Ningjun (LNG-NPV)" <ni...@lexisnexis.com> on 2007/05/02 15:40:26 UTC

Can't get Session persistence to work using org.apache.catalina.session.JDBCStore

I try to setup session persistence using database. I created the file
context.xml under the META-INF directory of my WAR file

<Context>
  <WatchedResource>WEB-INF/web.xml</WatchedResource>
  <Manager distributable="true"
className="org.apache.catalina.session.PersistentManager" debug="5"
saveOnRestart="true">
    <Store debug="99" className="org.apache.catalina.session.JDBCStore"
      driverName="oracle.jdbc.OracleDriver"
 
connectionURL="jdbc:oracle:thin:myuser/mypassword@myhost:1521:MYSID"
    	 sessionAppCol="App" sessionDataCol="Data" sessionIdCol="Id"
    	 sessionLastAccessedCol="LastAccessed"
sessionMaxInactiveCol="MaxInactive" 
       sessionValidCol="Valid" sessionTable="TomcatSession" />
  </Manager>  
</Context>

I have created the database table TomcatSession. When start the Tomcat
server, I always get the following:

INFO  - The database connection is null or was found to be closed.
Trying to re-open it.

Hitting several pages that use session.setAttribute(), the databasse
table is still empty. Nothing is tored in the database.

How can I trouble shooting this problem?

Ningjun Wang
Consulting Software Engineer
 
LexisNexis Global Solutions Dev
SWFT Solutions Engineering
New Providence, NJ
(908) 665-6787


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Can't get Session persistence to work using org.apache.catalina.session.JDBCStore

Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Wang-

Your listener is either not started or is blocked (perhaps by a firewall)
verify the default Oracle Port is listening at 1521
netstat -a | grep 1521
(this will verify the Oracle listener is at least listening)
verify the SERVICE NAME you have for SID is the same as SERVICE_NAME in your 
tnsnames.ora
verify the HOST you have for host is the same as HOST in your tnsnames.ora

then
ping the host
ping myhost

then tnsping the service_name
tnsping MYSID

Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Wang, Ningjun (LNG-NPV)" <ni...@lexisnexis.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Wednesday, May 02, 2007 9:40 AM
Subject: Can't get Session persistence to work using 
org.apache.catalina.session.JDBCStore


I try to setup session persistence using database. I created the file
context.xml under the META-INF directory of my WAR file

<Context>
  <WatchedResource>WEB-INF/web.xml</WatchedResource>
  <Manager distributable="true"
className="org.apache.catalina.session.PersistentManager" debug="5"
saveOnRestart="true">
    <Store debug="99" className="org.apache.catalina.session.JDBCStore"
      driverName="oracle.jdbc.OracleDriver"

connectionURL="jdbc:oracle:thin:myuser/mypassword@myhost:1521:MYSID"
    sessionAppCol="App" sessionDataCol="Data" sessionIdCol="Id"
    sessionLastAccessedCol="LastAccessed"
sessionMaxInactiveCol="MaxInactive"
       sessionValidCol="Valid" sessionTable="TomcatSession" />
  </Manager>
</Context>

I have created the database table TomcatSession. When start the Tomcat
server, I always get the following:

INFO  - The database connection is null or was found to be closed.
Trying to re-open it.

Hitting several pages that use session.setAttribute(), the databasse
table is still empty. Nothing is tored in the database.

How can I trouble shooting this problem?

Ningjun Wang
Consulting Software Engineer

LexisNexis Global Solutions Dev
SWFT Solutions Engineering
New Providence, NJ
(908) 665-6787


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org