You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stephen Ting <st...@shinyang.com.my> on 2002/08/22 05:34:23 UTC

my application stop running when upgrade to 4.1.9

I have problems delopying my application after upgrade from version
4.0.3 to 4.1.9 beta. i am running tomcat on windows xp. following is the
exception thrown.
I think the root cause is because of the windows nt file system. 
 
could someone pls show me where i get wrong?
 
thx
 
regards,
 
stephen
 
 
2002-08-22 10:26:33 ContextConfig[/web-einout] Exception processing JAR
at resource path /WEB-INF/lib/jakarta-oro.jar
javax.servlet.ServletException: Exception processing JAR at resource
path /WEB-INF/lib/jakarta-oro.jar
 at
org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:
930)
 at
org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:868
)
 at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647)
 at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.j
ava:243)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:166)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3445
)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
va:821)
 at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
 at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
 at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeploy
er.java:257)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
 at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java
:569)
 at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:411)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:36
8)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:166)
 at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
 at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
 at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
 at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
 at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2188)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
----- Root Cause -----
java.io.IOException: The system cannot find the path specified
 at java.io.WinNTFileSystem.createFileExclusively(Native Method)
 at java.io.File.checkAndCreate(File.java:1294)
 at java.io.File.createTempFile(File.java:1382)
 at java.io.File.createTempFile(File.java:1419)
 at sun.net.www.protocol.jar.URLJarFile$1.run(URLJarFile.java:169)
 at java.security.AccessController.doPrivileged(Native Method)
 at sun.net.www.protocol.jar.URLJarFile.retrieve(URLJarFile.java:164)
 at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:42)
 at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:78)
 at
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:
85)
 at
sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.ja
va:69)
 at
org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:
906)
 at
org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:868
)
 at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647)
 at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.j
ava:243)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:166)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3445
)
 at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja
va:821)
 at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
 at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
 at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeploy
er.java:257)
 at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
 at
org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java
:569)
 at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:411)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
 at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:36
8)
 at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu
pport.java:166)
 at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
 at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
 at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
 at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
 at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2188)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:510)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

Re: Tomcat 4.1.9 + MySQL + jdbc driver

Posted by Glenn Nielsen <gl...@mail.more.net>.
I have also seen this with the following setup.

Solaris 8 on Sun Sparc
Java 1.3.1_04
Tomcat 4.1.8/Jasper 1
mm.mysql 2.0.14
Apache 1.3.26 with mod_jk and Ajp13 connector.
DBCP

In my case from reviewing all of the tomcat logs I found that the
Communication link failure looks like a symptom of some other failure.
When reviewing my Engine logs for the ajp connector it looks
like Tomcat was not completing requests for a period of 5 minutes.
I saw a cascading of log entries like this in a 5 minute period where
over 100 new Ajp13Processor's were started.

2002-08-25 10:20:11 Ajp13Processor[8009][184] Starting background thread

I have seen this same behaviour a number of times, and each time the
length of the problem is about 5 minutes long.

I have also checked the CPU load stats for these time periods and I
am seeing the load increase by a factor of 3 while this is happening.
To a load > 1 on a single CPU system.

I checked the mysqld error logs, no errors reported.

These weren't due to a spike in the number of requests. And there was no
start/stop/reload of any Contexts which triggered this.  No JSP pages
were recompiled at the times this happened.  Nothing was changed.

I also start Tomcat with the java arg "-verbose:gc" so that garbage
collection data is logged.   I reviewed the GC times and I have several
long Full GC's of 15 and 22 seconds which might explain some of the
problems, but not a problem that seems to last 5 minutes.

I bet a thread stack dump while this is going on would be very interesting
reading.

I don't know yet what the source of my problem is.  The system Tomcat
is running on will be upgraded to faster dual CPU's and another 512MB of ram
in the next week or so.  Perhaps that will help.

I just thought the trouble shooting process I went through might help
you do forensics on your logs so you can track down your problem.

Regards,

Glenn

Paul Phillips wrote:
> I have used the Mark Matthews MySQL jdbc driver with Tomcat on three or 
> four projects and never had any trouble.
> 
> I recently started using the newest version of the driver, now called 
> MySQL Connector/J version 3.0.0 beta.  I am using it with Tomcat 4.1.9 
> on a Sun Ultra 5 with Solaris 9.  I am also using the DBCP connection 
> pool as described in the 4.1 docs.
> 
> I have never used this combination (the particular machine, Sol 9, this 
> new version of Tomcat and this driver) together to do database lookups 
> before, so I'm not sure where to look for the trouble.
> 
> However - the trouble is this...
> 
> I just installed my webapp a couple of days ago, for use in low level 
> production (meaning if there are problems, it is not the end of the 
> world...)
> 
> Each morning, when I come in, and fire up my webapp, the database 
> connections don't work.  The Tomcat logs report this:
> 
> java.sql.SQLException: Communication link failure: java.net.SocketException
>        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:810)
>        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1265)
>        at com.mysql.jdbc.Connection.execSQL(Connection.java:1935)
>        at 
> com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1800)
>        at 
> org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
>        at 
> org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
>        at 
> org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthen
> ticator.java:263)
> 
> and etc back through the trace.
> 
> So there is some problem with the socket.  If I simply shutdown and 
> restart Tomcat, the problem goes away and my app works fine and happily 
> all day long.
> 
> So, what would cause this to happen?  Connection pool problem?  Driver 
> problem?  I don't even know where to start looking...  I would 
> appreciate any ideas.
> 
> Regards,
> Paul Phillips
> 
> -- 
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

Posted by Paul Phillips <pa...@partitura.com>.
Hello -


> I had this same problem, appending "?autoReconnect=true" to your connect
> URL does work.
>

I tried this --

    <parameter>
      <name>url</name>
      <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
    </parameter>

in my server.xml and it DOES work.  Thanks to Glenn and Jay who suggested 
it.

Regards,
Paul Phillips

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

Posted by Glenn Nielsen <gl...@mail.more.net>.
I had this same problem, appending "?autoReconnect=true" to your connect URL does work.

Regards,

Glenn

Paul Phillips wrote:
> Hello
> 
>> I would suggest trying either of the following:
>>
>>  <parameter>
>>        <name>autoReconnect</name>
>>        <value>true</value>
>>     </parameter>
>>
> 
> I know that the above does not work...  I tried it.
> 
>> or
>>
>>     <parameter>
>>       <name>url</name>
>>
>> <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
>> </parameter>
>>
> 
> I didn't try this, because I think that the ? in the url is already 
> being provided by the code somewhere, so to add it here would duplicate it.
> 
>> From what I could tell by reading the code, there is some way to 
>> trigger an 
> 
> expire mechanism at regular intervals - I just don't know how to set 
> that up...
> 
> Thanks,
> Paul Phillips
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

Posted by Paul Phillips <pa...@partitura.com>.
Hello

> I would suggest trying either of the following:
>
>  <parameter>
>        <name>autoReconnect</name>
>        <value>true</value>
>     </parameter>
>

I know that the above does not work...  I tried it.

> or
>
>     <parameter>
>       <name>url</name>
>
> <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
> </parameter>
>

I didn't try this, because I think that the ? in the url is already being 
provided by the code somewhere, so to add it here would duplicate it.

>>From what I could tell by reading the code, there is some way to trigger an 
expire mechanism at regular intervals - I just don't know how to set that 
up...

Thanks,
Paul Phillips




my original message is below...


>
> I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc
> connection pool when used with MySQL.  Apparently MySQL kills off stale
> connections after an 8 hour period.  According to Mark Matthews (developer
> of the jdbc-mysql driver), I need to configure the pool to sweep out the
> stale connections, and initiate new ones.
>
> I have looked and looked in vain for documentation for DBCP that would
> explain how to set the configuration in my Tomcat server.xml file (using
> JNDI) that would enable this.  I can't find anything.  I've tried
> examining the source of DBCP, but I'm afraid that I can't figure it out.
>
> My Tomcat server.xml file uses this configuration below, which is right
> out of:
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-
> ho wto.html
>
>> From what I can tell, there are other parameters that  I can enter to
>> force
> the sweeping of stale connections.  However, I don't know what they are,
> or how to use them.  If anyone can give me an example of the correct
> syntax here, I would be very grateful, ( since my webapp dies every
> night, due to this problem!)
>
> Thanks --
>
> Paul Phillips
>
> (excerpt of server.xml...)
>
> <Context path="/DBTest" docBase="DBTest"
>         debug="5" reloadable="true" crossContext="true">
>
>   <Logger className="org.apache.catalina.logger.FileLogger"
>              prefix="localhost_DBTest_log." suffix=".txt"
>              timestamp="true"/>
>
>   <Resource name="jdbc/TestDB"
>                auth="Container"
>                type="javax.sql.DataSource"/>
>
>   <ResourceParams name="jdbc/TestDB">
>     <parameter>
>       <name>factory</name>
>       <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>     </parameter>
>     <parameter>
>       <name>maxActive</name>
>       <value>100</value>
>     </parameter>
>     <parameter>
>       <name>maxIdle</name>
>       <value>30000</value>
>     </parameter>
>     <parameter>
>       <name>maxWait</name>
>       <value>100</value>
>     </parameter>
>     <parameter>
>      <name>username</name>
>      <value>javauser</value>
>     </parameter>
>     <parameter>
>      <name>password</name>
>      <value>javadude</value>
>     </parameter>
>
>     <parameter>
>        <name>driverClassName</name>
>        <value>org.gjt.mm.mysql.Driver</value>
>     </parameter>
>
>     <parameter>
>       <name>url</name>
>       <value>jdbc:mysql://localhost:3306/javatest</value>
>     </parameter>
>   </ResourceParams>
> </Context>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org> For additional
> commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

Posted by Jay Gardner <gj...@qwest.net>.
Hi Paul,

I don't have experience with this pool, but I have experienced this
disconnection problem with mysql. Got around it using the mysql parameter
autoReconnect=true. I would suggest trying either of the following:

 <parameter>
       <name>autoReconnect</name>
       <value>true</value>
    </parameter>

or

    <parameter>
      <name>url</name>
      <value>jdbc:mysql://localhost:3306/javatest?autoReconnect=true</value>
    </parameter>

If one is successful, please report back so that we know if it worked for
you or not.


Regards,

--Jay Gardner

-----Original Message-----
From: Paul Phillips [mailto:paul@partitura.com]
Sent: Monday, August 26, 2002 10:04 PM
To: Tomcat Users List
Subject: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc
connection pool when used with MySQL.  Apparently MySQL kills off stale
connections after an 8 hour period.  According to Mark Matthews (developer
of the jdbc-mysql driver), I need to configure the pool to sweep out the
stale connections, and initiate new ones.

I have looked and looked in vain for documentation for DBCP that would
explain how to set the configuration in my Tomcat server.xml file (using
JNDI) that would enable this.  I can't find anything.  I've tried examining
the source of DBCP, but I'm afraid that I can't figure it out.

My Tomcat server.xml file uses this configuration below, which is right out
of:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-ho
wto.html

>>From what I can tell, there are other parameters that  I can enter to force
the sweeping of stale connections.  However, I don't know what they are, or
how to use them.  If anyone can give me an example of the correct syntax
here, I would be very grateful, ( since my webapp dies every night, due to
this problem!)

Thanks --

Paul Phillips

(excerpt of server.xml...)

<Context path="/DBTest" docBase="DBTest"
        debug="5" reloadable="true" crossContext="true">

  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_DBTest_log." suffix=".txt"
             timestamp="true"/>

  <Resource name="jdbc/TestDB"
               auth="Container"
               type="javax.sql.DataSource"/>

  <ResourceParams name="jdbc/TestDB">
    <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>100</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>30000</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>100</value>
    </parameter>
    <parameter>
     <name>username</name>
     <value>javauser</value>
    </parameter>
    <parameter>
     <name>password</name>
     <value>javadude</value>
    </parameter>

    <parameter>
       <name>driverClassName</name>
       <value>org.gjt.mm.mysql.Driver</value>
    </parameter>

    <parameter>
      <name>url</name>
      <value>jdbc:mysql://localhost:3306/javatest</value>
    </parameter>
  </ResourceParams>
</Context>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: sweeping stale connections - Commons DBCP and Tomcat 4.1.9

Posted by Mike Jackson <mj...@cdi-hq.com>.
Switch to poolman, I've never had this with it.  And I've used it
with Informix, Oracle, Postgres, Mysql and DB2.

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com 

> -----Original Message-----
> From: Paul Phillips [mailto:paul@partitura.com]
> Sent: Monday, August 26, 2002 9:04 PM
> To: Tomcat Users List
> Subject: sweeping stale connections - Commons DBCP and Tomcat 4.1.9
> 
> 
> I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc 
> connection pool when used with MySQL.  Apparently MySQL kills off stale 
> connections after an 8 hour period.  According to Mark Matthews 
> (developer 
> of the jdbc-mysql driver), I need to configure the pool to sweep out the 
> stale connections, and initiate new ones.
> 
> I have looked and looked in vain for documentation for DBCP that would 
> explain how to set the configuration in my Tomcat server.xml file (using 
> JNDI) that would enable this.  I can't find anything.  I've tried 
> examining 
> the source of DBCP, but I'm afraid that I can't figure it out.
> 
> My Tomcat server.xml file uses this configuration below, which is 
> right out 
> of:
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-ex
> amples-ho
> wto.html
> 
> >From what I can tell, there are other parameters that  I can 
> enter to force 
> the sweeping of stale connections.  However, I don't know what 
> they are, or 
> how to use them.  If anyone can give me an example of the correct syntax 
> here, I would be very grateful, ( since my webapp dies every 
> night, due to 
> this problem!)
> 
> Thanks --
> 
> Paul Phillips
> 
> (excerpt of server.xml...)
> 
> <Context path="/DBTest" docBase="DBTest"
>         debug="5" reloadable="true" crossContext="true">
> 
>   <Logger className="org.apache.catalina.logger.FileLogger"
>              prefix="localhost_DBTest_log." suffix=".txt"
>              timestamp="true"/>
> 
>   <Resource name="jdbc/TestDB"
>                auth="Container"
>                type="javax.sql.DataSource"/>
> 
>   <ResourceParams name="jdbc/TestDB">
>     <parameter>
>       <name>factory</name>
>       <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>     </parameter>
>     <parameter>
>       <name>maxActive</name>
>       <value>100</value>
>     </parameter>
>     <parameter>
>       <name>maxIdle</name>
>       <value>30000</value>
>     </parameter>
>     <parameter>
>       <name>maxWait</name>
>       <value>100</value>
>     </parameter>
>     <parameter>
>      <name>username</name>
>      <value>javauser</value>
>     </parameter>
>     <parameter>
>      <name>password</name>
>      <value>javadude</value>
>     </parameter>
> 
>     <parameter>
>        <name>driverClassName</name>
>        <value>org.gjt.mm.mysql.Driver</value>
>     </parameter>
> 
>     <parameter>
>       <name>url</name>
>       <value>jdbc:mysql://localhost:3306/javatest</value>
>     </parameter>
>   </ResourceParams>
> </Context>
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


sweeping stale connections - Commons DBCP and Tomcat 4.1.9

Posted by Paul Phillips <pa...@partitura.com>.
I'm using Tomcat 4.1.9.  I have been having a problem with the DBCP jdbc 
connection pool when used with MySQL.  Apparently MySQL kills off stale 
connections after an 8 hour period.  According to Mark Matthews (developer 
of the jdbc-mysql driver), I need to configure the pool to sweep out the 
stale connections, and initiate new ones.

I have looked and looked in vain for documentation for DBCP that would 
explain how to set the configuration in my Tomcat server.xml file (using 
JNDI) that would enable this.  I can't find anything.  I've tried examining 
the source of DBCP, but I'm afraid that I can't figure it out.

My Tomcat server.xml file uses this configuration below, which is right out 
of:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-ho
wto.html

>>From what I can tell, there are other parameters that  I can enter to force 
the sweeping of stale connections.  However, I don't know what they are, or 
how to use them.  If anyone can give me an example of the correct syntax 
here, I would be very grateful, ( since my webapp dies every night, due to 
this problem!)

Thanks --

Paul Phillips

(excerpt of server.xml...)

<Context path="/DBTest" docBase="DBTest"
        debug="5" reloadable="true" crossContext="true">

  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_DBTest_log." suffix=".txt"
             timestamp="true"/>

  <Resource name="jdbc/TestDB"
               auth="Container"
               type="javax.sql.DataSource"/>

  <ResourceParams name="jdbc/TestDB">
    <parameter>
      <name>factory</name>
      <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
      <name>maxActive</name>
      <value>100</value>
    </parameter>
    <parameter>
      <name>maxIdle</name>
      <value>30000</value>
    </parameter>
    <parameter>
      <name>maxWait</name>
      <value>100</value>
    </parameter>
    <parameter>
     <name>username</name>
     <value>javauser</value>
    </parameter>
    <parameter>
     <name>password</name>
     <value>javadude</value>
    </parameter>

    <parameter>
       <name>driverClassName</name>
       <value>org.gjt.mm.mysql.Driver</value>
    </parameter>

    <parameter>
      <name>url</name>
      <value>jdbc:mysql://localhost:3306/javatest</value>
    </parameter>
  </ResourceParams>
</Context>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Redirects by TOMCAT in server.xml?

Posted by Alexander Schmidt <as...@i5.informatik.rwth-aachen.de>.
Hi!
I will explain my problem better!
I have an application opencms. With this application you can create and
manage HTML-Sites.
The program uses Tomcat 4.0! To let me show the sites, i have to type in the
browser
the URL "http://localhost:8080/opencms/opencms/COLANgamma/index.html" , but
it is too long for me.
So i want to redirect it. I only want to type in the URL
"http://localhost:8080/COLANgamma/index.html". I want to do the redirection
with TOMCAT 4.0 in that way, that i configure the server.xml.
But I don´t find any solution. I know that there is a possibility with
Apache, but we don´t use it.

Thanks
      A.Schmidt


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Redirects and URL-Rewriting in server.xml

Posted by Milt Epstein <me...@uiuc.edu>.
On Fri, 23 Aug 2002, Alexander Schmidt wrote:

> Hello!
> Can I do in the server.xml file redirect or URL-Rewriting and when how?
> I want when i type in colangamma he goes to the site
> opencms/opencms/Colangamma!Who can help me?

First of all, be clear in your usage of "URL-Rewriting".  Because in
the servlet world, that term refers to rewriting the URL to include
the session id, in the case that you don't want to or can't use
cookies to manage sessions.

Second, I think you should elaborate on what your situation/problem
is.  That is, what application(s)/context(s) do you have, what's your
current URL mapping scheme, what you'd like it to be, etc.  That will
better allow people to help you.  The above is certainly not clear to
me (e.g. what you you mean by "when I type in colangamma"?).

Milt Epstein
Research Programmer
Systems and Technology Services (STS)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Redirects and URL-Rewriting in server.xml

Posted by Alexander Schmidt <as...@i5.informatik.rwth-aachen.de>.
Hello!
Can I do in the server.xml file redirect or URL-Rewriting and when how?
I want when i type in colangamma he goes to the site
opencms/opencms/Colangamma!Who can help me?

Thanks
    A. Schmidt



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


URL Rewriting with Tomcat 4.0.1?

Posted by Alexander Schmidt <as...@i5.informatik.rwth-aachen.de>.
Hello!
I have an URL e.g. /opencms/opencms/colangamma but want to have /colangamma.
So i think i have to do URL-Rewriting.
How can i do it only with Tomcat 4.0.1? Or is there no possibility.

Thanks
      Alex


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat 4.1.9 + MySQL + jdbc driver

Posted by "Peter T. Abplanalp" <pt...@psaconsultants.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Aug 22, 2002 at 07:50:19PM -0500, Paul Phillips wrote:

> Each morning, when I come in, and fire up my webapp, the database 
> connections don't work.  The Tomcat logs report this:

this is probably due to the fact that mysql closes the idle
connections.  you can try adding autoReconnect=true to your db url, a
la:

  jdbc:mysql://localhost:3306/test?autoReconnect=true

that way if mysql has closed the other side of the connection due to
idleness, the driver will reconnect.

fyi, there is a list for this driver at java@lists.mysql.com.  see
http://www.mysql.com for more info.

- -- 
Peter Abplanalp

Email:   pta@psaconsultants.com
PGP:     pgp.mit.edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9Zf6qggA8sH0iRXQRAhP7AKCzHIK6JRsFHzpqQMRNESdaBQCfGACdHhKP
DyitTVmFcg+M8Ro0TyvMkps=
=5UvH
-----END PGP SIGNATURE-----

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat 4.1.9 + MySQL + jdbc driver

Posted by Andrew Conrad <an...@attbi.com>.
If it never fails during the day, I would assume it's in use most of the
day, correct?  So I would think that there is some kind of issue between
the MySQL driver and DBCP about connection timeout's.  You may want to
try another driver (maybe even from another source) to see what happens.


- Andrew

> -----Original Message-----
> From: Paul Phillips [mailto:paul@partitura.com] 
> Sent: Thursday, August 22, 2002 8:50 PM
> To: Tomcat Users List
> Subject: Tomcat 4.1.9 + MySQL + jdbc driver
> 
> 
> I have used the Mark Matthews MySQL jdbc driver with Tomcat 
> on three or 
> four projects and never had any trouble.
> 
> I recently started using the newest version of the driver, 
> now called MySQL 
> Connector/J version 3.0.0 beta.  I am using it with Tomcat 
> 4.1.9 on a Sun 
> Ultra 5 with Solaris 9.  I am also using the DBCP connection pool as 
> described in the 4.1 docs.
> 
> I have never used this combination (the particular machine, 
> Sol 9, this new 
> version of Tomcat and this driver) together to do database 
> lookups before, 
> so I'm not sure where to look for the trouble.
> 
> However - the trouble is this...
> 
> I just installed my webapp a couple of days ago, for use in low level 
> production (meaning if there are problems, it is not the end of the 
> world...)
> 
> Each morning, when I come in, and fire up my webapp, the database 
> connections don't work.  The Tomcat logs report this:
> 
> java.sql.SQLException: Communication link failure: 
> java.net.SocketException
>         at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:810)
>         at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1265)
>         at com.mysql.jdbc.Connection.execSQL(Connection.java:1935)
>         at 
> com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatemen
> t.java:1800)
>         at 
> org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
>         at 
> org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
>         at 
> org.apache.catalina.authenticator.FormAuthenticator.authentica
> te(FormAuthen
> ticator.java:263)
> 
> and etc back through the trace.
> 
> So there is some problem with the socket.  If I simply 
> shutdown and restart 
> Tomcat, the problem goes away and my app works fine and 
> happily all day 
> long.
> 
> So, what would cause this to happen?  Connection pool 
> problem?  Driver 
> problem?  I don't even know where to start looking...  I 
> would appreciate 
> any ideas.
> 
> Regards,
> Paul Phillips
> 
> --
> To unsubscribe, e-mail:   
> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Tomcat 4.1.9 + MySQL + jdbc driver

Posted by Paul Phillips <pa...@partitura.com>.
I have used the Mark Matthews MySQL jdbc driver with Tomcat on three or 
four projects and never had any trouble.

I recently started using the newest version of the driver, now called MySQL 
Connector/J version 3.0.0 beta.  I am using it with Tomcat 4.1.9 on a Sun 
Ultra 5 with Solaris 9.  I am also using the DBCP connection pool as 
described in the 4.1 docs.

I have never used this combination (the particular machine, Sol 9, this new 
version of Tomcat and this driver) together to do database lookups before, 
so I'm not sure where to look for the trouble.

However - the trouble is this...

I just installed my webapp a couple of days ago, for use in low level 
production (meaning if there are problems, it is not the end of the 
world...)

Each morning, when I come in, and fire up my webapp, the database 
connections don't work.  The Tomcat logs report this:

java.sql.SQLException: Communication link failure: java.net.SocketException
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:810)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1265)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:1935)
        at 
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1800)
        at 
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:445)
        at 
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
        at 
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthen
ticator.java:263)

and etc back through the trace.

So there is some problem with the socket.  If I simply shutdown and restart 
Tomcat, the problem goes away and my app works fine and happily all day 
long.

So, what would cause this to happen?  Connection pool problem?  Driver 
problem?  I don't even know where to start looking...  I would appreciate 
any ideas.

Regards,
Paul Phillips

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>