Jdk1.3
Win 2000
Jakarta Tomcat 4.0.3

Class Path
C:\Program
Files\Borland\InterClient\interclient.jar;C:\DSA\Javaapps\Java-1.1\;C:\JavaD
ev\begJavobj\Code\Chapter16\SRS;c:\jdk1.3\;c:\package\;c:\homeschoolbroker;C
:\jakarta-tomcat-4.0.3\common\lib\servlet.jar;C:\jakarta-tomcat-4.0.3\webapp
s\apress\web-inf\classes;

I have two users configured in mysql SessionTracking and LibraryManager
When I log onto the servlet and go through basic authentication, and then
create a session, I get the following exception when both the JDBCRealm and
JDBCStore are running.

The Exception
The exception I'm getting is
java.io.IOException: Stream closed
        at
java.io.BufferedInputStream.ensureOpen(BufferedInputStream.java:123)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:273)
        at
java.io.ObjectInputStream.readFullyInternal(ObjectInputStream.java:1780)
        at java.io.ObjectInputStream.bufferData(ObjectInputStream.java:1750)
        at java.io.ObjectInputStream.readShort(ObjectInputStream.java:1935)
        at
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:842)
        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:168)
        at
org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStr
eam.java:103)
        at org.apache.catalina.session.JDBCStore.load(JDBCStore.java:518)
        at
org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:295)
        at org.apache.catalina.session.StoreBase.run(StoreBase.java:350)
        at java.lang.Thread.run(Thread.java:484)













Web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app PUBLIC
  '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN'
  'http://java.sun.com/j2ee/dtds/web-app_2_3.dtd'>

<web-app>

  <servlet>
    <servlet-name>login</servlet-name>
    <servlet-class>chapter2.login</servlet-class>
  </servlet>

  <taglib>
    <taglib-uri>/library2</taglib-uri>
    <taglib-location>/WEB-INF/lib/taglib.tld</taglib-location>
  </taglib>


****************************************************************************
I physically took out this portion because of the bug I told you about. I
just pasted it in here so you could see what it looked like
****************************************************************************
*************

<!--Define a Security Constraint on this Application -->
<security-constraint>
        <web-resource-collection>
                <web-resource-name>Library Application</web-resource-name>
                <url-pattern>/*</url-pattern>
        </web-resource-collection>

        <auth-constraint>
                <role-name>LibraryManager</role-name>
        </auth-constraint>
</security-constraint>


<!-- Login configuration for this application -->
        <login-config>
                <auth-method>BASIC</auth-method>
                        <realm-name>Library Mananger</realm-name>
        </login-config>




</web-app>


The server.xml file  ( let me know if you want all of it, this is the
relative portion pertaining to JDBCStore.

<!--This is the JDBCStore that I wrote you about in the email -->
<Manager className="org.apache.catalina.session.PersistentManager"
              debug="99"
              saveOnRestart="true"
              maxActiveSessions="-1"
              minIdleSwap="-1"
              maxIdleSwap="-1"
              maxIdleBackup="-1">
              <Store className="org.apache.catalina.session.JDBCStore"
                         driverName="org.gjt.mm.mysql.Driver"

connectionURL="jdbc:mysql://localhost/tomcatsessions?user=SessionTracking;pa
ssword=tracking"
             sessionTable="sessions"
             sessionIdCol="id"
             sessionDataCol="data"
             sessionValidCol="valid"
             sessionMaxInactiveCol="maxinactive"
             sessionLastAccessedCol="lastaccess"
             checkInterval="60"
             debug="99" />

        </Manager>


 </Context>

This is the JDBCRealm portion of the server.xml

<Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
          driverName="org.gjt.mm.mysql.Driver"
          connectionURL="jdbc:mysql://localhost/tomcatusers"
                  connectionName="LibraryManager"
                  connectionPassword="home7lib8"
          userTable="users" userNameCol="user_name" userCredCol="user_pass"
          userRoleTable="users_roles" roleNameCol="role_name" />






-----Original Message-----
From: Paul D. Bain [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 17, 2002 3:05 PM
To: Tomcat Users List
Subject: Re: Please recommend book or Other Help

At Wednesday 7/17/02 12:00 PM, you wrote:
>I'm having problems with JDBCRealms and JDBCStore in Tomcat.
>They seem buggy to me.

         Could you please furnish us with more information? It would be
helpful to us to know your configuration, e.g., server.xml, web.xml,
version of JDK being used, classpath, etc.



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to