db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "M. Sean Gilligan" <Sean_Gilli...@catalla.com>
Subject Re: Torque using Tomcat
Date Thu, 23 Dec 2004 02:30:34 GMT
Hi Henning,

Thanks again for your help.  (I got sidetracked for a few days.)

>"M. Sean Gilligan" <Sean_Gilligan@catalla.com> writes:
>
>>>"M. Sean Gilligan" <Sean_Gilligan@catalla.com> writes:
>>>
>>>>I'm using Torque 3.1.1 with Tomcat 5.0.28 and MySQL.  In a Tomcat context.xml
file I've defined a JNDI DataSource and in torque.prorperties the JndiDataSourceFactory factory
is being used.  The webapp works fine until the webapp is realoaded.  The first database access
after a reload gives this stack trace:
>>>
>>>I remember this from a dim and distant past. It was some serialization
>>>issue. Can you please look into your catalina.out and maybe look into the
>>>list archives?
>
>>Hi Henning.
>
>>Thanks for your response.
>
>>What do you mean by a "serialization issue"?
>
>Your container probably tries to save the existing session on a
>restart (because reloading your webapp is nothing but a restart of
>your application) and falls over its feets. When it comes up again,
>its session information is incomplete and you get strange errors.

What would Torque have to do with the Http session?  I don't understand the connection here.

>
>Try the following thing. I assume now, that you use Tomcat5:
>
>- open your tomcat/conf/server.xml file
>
>- look for the <Context> element for your application.
>
>- if you don't have one, you must create one. The result should look like
>  this:
>
><Context path="/your-app-here" reloadable="true">
>   <Manager className="org.apache.catalina.session.StandardManager"
>            distributable="false" pathname="" />
></Context>
>
>Important is the 'pathname=""'
>
>Stop Tomcat. Nuke the contents of the work/ and the temp/
>directory. Start again. See if the problem vanishes. If yes, you have
>a serialization issue with Torque.

I did what you said and the problem did not go away.  To be clear: the problem is fixed by
a restart of Tomcat and only occurs when you reload the webapp after it has been loaded once.
 I followed your instructions (which included a restart of Tomcat) tried to login once and
it worked, the restarted the webapp and tried to login again and got the same stack trace.

One variation from your procedure is that I'm not editing server.xml but specifying a Context.xml
in the Tomcat <deployment> ANT task.

The version I just tested is like this:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="/path/to/webapp" path="/my" reloadable="true">
  <Manager className="org.apache.catalina.session.StandardManager"
           distributable="false" pathname="" />
  <Resource auth="Container" name="jdbc/mysqldb" type="javax.sql.DataSource"/>
  <Resource auth="Container" name="jdbc/pgdb" type="javax.sql.DataSource"/>
  <ResourceParams name="jdbc/mysqldb">
    <parameter>
      <name>url</name>
      <value>jdbc:mysql://localhost/mysqldb</value>
    </parameter>
    <parameter>
      <name>username</name>
      <value>xxx</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>xxx</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>org.gjt.mm.mysql.Driver</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>5000</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>4</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>2</value>
    </parameter>
  </ResourceParams>
  <ResourceParams name="jdbc/pgdb">
    <parameter>
      <name>url</name>
      <value>jdbc:postgresql: pgdb</value>
    </parameter>
    <parameter>
      <name>username</name>
      <value>xxx</value>
    </parameter>
    <parameter>
      <name>password</name>
      <value>xxx</value>
    </parameter>
    <parameter>
      <name>driverClassName</name>
      <value>org.postgresql.Driver</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>5000</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>4</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>2</value>
    </parameter>
  </ResourceParams>
</Context>

Any further information and/or suggestions would be greatly appreciated.
Thanks,

Sean

-- 
---------------------------------------------------------------------------
M. Sean Gilligan                    : 831-466-9788 x11
Catalla Systems, Inc.               : http://www.vblogcentral.com
---------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message