Re: Tomcat mysteriously shuts down

2007-02-19 Thread raine king

OK I figured it out:

Me and a couple testers were all running versions of Tomcat and once in a 
while we would use the same machine, and we hadn't changed the shutdown 
port/message(server.xml) so we were occasionally shutting down one another's 
Tomcats with shutdown.sh!


Thanks everyone for you're help.


From: raine king [EMAIL PROTECTED]
Reply-To: Tomcat Users List users@tomcat.apache.org
To: users@tomcat.apache.org
Subject: Re: Tomcat mysteriously shuts down
Date: Thu, 15 Feb 2007 13:55:19 +

Hmm this may actually be working--I changed the port and so far it hasn't 
shutdown--I'll leave it over the weekend and see what happens...


How do I check if another app is sending Tomcat messages?  Does tomcat log 
somewhere who it got SHUTDOWN commands from?


As for the second bit--I installed tomcat myself.


From: David Delbecq [EMAIL PROTECTED]
Reply-To: Tomcat Users List users@tomcat.apache.org
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Tomcat mysteriously shuts down
Date: Thu, 15 Feb 2007 14:08:33 +0100

Normally, tomcat shutsdown  is a localhost running application sends a
shutdown command to the localhost server command port (8005). You can
try to change this port, in case another app is doing this. (replace
server element in server.xml by server port=8555 for example.
You can also try to change to change the shutdown command
server shutdown=TEST_SHUTDOWN_TEST
Also, did you install tomcat manually or using redhat distribution. It
may be that some redhat tools are configured to remove from memory
inactive servers (i have never heard of this, but it wouldn't be the
first oddity of tomcat/redhat :p)


En l'instant précis du 02/15/07 13:33, Nadav Steindler s'exprimait en
ces termes:

 That's just it--there's nothing wierd in the catalina.out it just has:

 1) The lines for starting up tomcat
 2) The log messages for my servlet
 3) The bit I showed you where the servlet shuts down when I stopped
 sending it messages for a few minutes

 There's no errors or anything in the log.



 By the way, this is repeatable--I just let Tomcat sit without sending
 it anything for 7-15 minutes and it shuts down.

 ALSO I just noticed it only happens on our Linux Redhat 4 machine--not
 on the Redhat 3 machine which we have used until now. (We are trying
 to move the product to Redhat 4 with the Java5 JVM--so far this has
 just meant configuring tomcat to use the Java5 jvm)

 The environment where Tomcat shuts down unexpectedly is:
 Machine - RH 4
 Java - /usr/java/jdk1.5.0_06
 Tomacat - jakarta-tomcat-5.0.28

 The one where it works normally is:
 Machine - RH 3
 Java - /usr/lib/jvm/java-1.4.2-ibm-1.4.2.0
 Tomacat - jakarta-tomcat-5.0.28

 I'm running the exact same copy of the servlet and Tomcat, just on a
 different machine running off a shared hard disk--  I just change a
 line in the catalina.out to use the Java5 JVM on the RedHat 4 machine.






 From: Andre Prasetya [EMAIL PROTECTED]
 Reply-To: Tomcat Users List users@tomcat.apache.org
 To: Tomcat Users List users@tomcat.apache.org
 Subject: Re: Tomcat mysteriously shuts down
 Date: Thu, 15 Feb 2007 17:56:22 +0700

 why dont you post the catalina.out entry before pausing coyote ? the 
one

 that you post is the regular log for shutting down tomcat

 On 2/15/07, Nadav Steindler [EMAIL PROTECTED] wrote:

 When my servlet isn't sent any requests for about 15 minutes, tomcat
 shuts
 down.  In particular:

 1) The Tomcat process no longer appears when I do ps
 2) The catalina.out ends with:

 Feb 14, 2007 2:12:38 PM org.apache.coyote.http11.Http11Protocol pause
 INFO: Pausing Coyote HTTP/1.1 on http-9007
 Feb 14, 2007 2:12:39 PM org.apache.catalina.core.StandardService stop
 INFO: Stopping service Catalina
 Feb 14, 2007 2:12:39 PM
 org.apache.catalina.core.StandardHostDeployerremove
 INFO: Removing web application at context path /myservlet
 Feb 14, 2007 2:12:39 PM
 org.apache.catalina.core.StandardHostDeployerremove
 INFO: Removing web application at context path /myservlet2
 Feb 14, 2007 2:12:39 PM
 org.apache.catalina.core.StandardHostDeployerremove
 INFO: Removing web application at context path /admin
 Feb 14, 2007 2:12:39 PM org.apache.catalina.logger.LoggerBase stop
 INFO: unregistering logger
 Catalina:type=Logger,path=/admin,host=localhost
 Feb 14, 2007 2:12:39 PM
 org.apache.catalina.core.StandardHostDeployerremove
 INFO: Removing web application at context path /webdav
 Feb 14, 2007 2:12:39 PM
 org.apache.catalina.core.StandardHostDeployerremove
 INFO: Removing web application at context path /servlets-examples
 Feb 14, 2007 2:12:39 PM
 org.apache.catalina.core.StandardHostDeployerremove
 INFO: Removing web application at context path /jsp-examples
 Feb 14, 2007 2:12:39 PM
 org.apache.catalina.core.StandardHostDeployerremove
 INFO: Removing web application at context path /balancer
 Feb 14, 2007 2:12:39 PM
 org.apache.catalina.core.StandardHostDeployerremove
 INFO: Removing web application at context path /myservlet3
 Feb 14, 2007 

Re: OutOfMemoryError (but not really out of memory?) cause tomcat processes to hang

2007-02-19 Thread Ronald Klop

It helped us to upgrade to java 1.5.0_10. There are fixes for memory leaks in 
native memory. They do not show up in the java heap.

Ronald.

On Wed Feb 07 23:34:45 CET 2007 Tomcat Users List users@tomcat.apache.org 
wrote:


---
Version Information:

---
Red Hat Linux: 2.4.21-4.ELsmp #1 SMP i686 i686 i386 GNU/Linux
Apache: 2.0.54
mod_jk: 1.2.20
tomcat: 4.1.34
java: 1.5.0_06 (build 1.5.0_06-b05)



---
Problem description:

---

Under heavy load, after running for some time, some tomcat instances throw
OutOfMemoryErrors and then become unresponsive. 


Using jmap -heap just after such an error occurs reports plenty of available
memory. Watching the heap before the tomcats get into this type of
situation reveals no telltale growth in memory usage.

We currently have Xmx set to 256M, we have tried increasing and decreasing
this value and there is no change in the behavior.

Questions: 
Is it possible that the initial OutOfMemory error occurs when a
large 
garbage collection is taking place and an OutOfMemoryError is thrown


before the memory can be reclaimed throwing the whole system into
some
sort of bad state? If so, how do we combat this behavior?

Is one of the tomcat threads running out of memory, and killing
itself,
thus freeing the memory? If this is what is happening, does anyone
have 
any advice on catching the tomcat memory usage just prior to going
into 
a bad state?



Based on other's reports of similar problems we have investigated a number
of system resources and their limits (file descriptors, threads, etc) with
no luck. (below are some statistics that seem to show that these other
areas are not the problem).

One perhaps telling piece of information is that once a tomcat has gotten
into this state, we find that many connections to apache end up in the
SYN_RECV state (as reported by netstat). It appears that tomcat's listener
thread is still accepting connections, but something goes wrong in the
handoff to the processor threads such that the connection is left in
SYN_RECV. This is curious as a stack trace of tomcat's threads report many
(20+) processor threads in await() waiting for the next thing to process.

I have included as much relevant information as I can think of below, but am
happy to provide additional information should anyone have any ideas as to
what may be going wrong.


We would be very thankful to hear from anyone who may have any experience of
similar problems, or guidance with what to try as next steps.



---
Version Information:

---
Red Hat Linux: 2.4.21-4.ELsmp #1 SMP i686 i686 i386 GNU/Linux
Apache: 2.0.54
mod_jk: 1.2.20
tomcat: 4.1.34
java: 1.5.0_06 (build 1.5.0_06-b05)


---
System setup:

---

We are running apache to serve static content, and mod_jk with balanced
workers to forward requests for dynamic content to 5 tomcat instances. The
following are the relevant settings:


Apache settings (httpd.conf):

Timeout 300
KeepAlive On
MaxKeepAliveRequests 100

IfModule prefork.c
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 200
MaxRequestsPerChild 100
/IfModule



mod_jk settings (worker.properties)

worker.list=loadbalancer

worker.tomcat1.port=11009
worker.tomcat1.host=localhost
worker.tomcat1.type=ajp13
worker.tomcat1.socket_timeout=30
worker.tomcat1.reply_timeout=6
worker.tomcat1.connection_pool_size=1
worker.tomcat1.connection_pool_minsize=1
worker.tomcat1.connection_pool_timeout=300
worker.tomcat1.lbfactor=1
worker.tomcat1.recover_time=600

### (same settings for tomcat2 - tomcat5) ###

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers= tomcat1, tomcat2, tomcat3,
tomcat4, tomcat5


tomcat settings (server.xml)

Connector className=org.apache.ajp.tomcat4.Ajp13Connector
port=11009 minProcessors=5 maxProcessors=100
acceptCount=10 debug=0 enableLookups=false/




After running for some time (anywhere from 20 minutes to 12 hours depending
on load), we see one instance of tomcat stop responding. The following are
the errors reported in vairous logs.


---
catalina.out error messages (stderr/stdout from catalina.sh):

---

2007-02-07 12:43:22 Ajp13Processor[15009][3] 
process: invoke java.lang.OutOfMemoryError: Java heap space



Re: Can't find classes in jar files in WEB-INF

2007-02-19 Thread David Smith
You don't need to tell tomcat to look in WEB-INF/lib/*.jar.  Tomcat does
that automatically per spec.  I'm guessing there is something wrong with
the way your jar was created or a permissions problem.

Try testing the jar with

$JAVA_HOME/bin/jar tf whatever.jar
(linux/maxos syntax)
or
%JAVA_HOME\bin\jar tf whatever.jar
(windows syntax)

to be sure it's valid.  The command above lists all the files in the jar
file.  Then be sure permissions are set so the user tomcat runs as can
read it.  One last thing to look for is any errors further up in the
logs above the class not found exception.

--David

aladdin wrote:

Thanks for the tip!

I don't think I'd have a conflict with all the classes in my application.  
Although some of my classes have common names, like user.java (compiled,
of course, to user.class), they are all member of just one of three packages:
infoisland, dbMgr, and utils, so I don't think the names are colliding.  
Loading the app bombs out as tomcat is loading when it can't find my filter,
CheckUser (makes sure users are logged in), which is in the infoIsland 
package.

However, your comment is telling: WEB-INF itself is not checked or scanned
for .jar files at all.  So, if I make sure the WEB-INF/classes subdirectory 
is empty, how do I tell tomcat to go get classes out of the 
WEB-INF/lib/whatever.jar file?

Thanks.

On Sunday 18 February 2007 20:05, David Smith wrote:
  

It should be noted there are only a couple of places .jar files are
allowed in tomcat:

1. WEB-INF/lib
2. common/lib of the tomcat installation directory

WEB-INF itself is not checked or scanned for .jar files at all.  In
addition, any files in the classes directory will override their
equivalent in the lib directory.  This occurs regardless of it being in
WEB-INF/classes or common/classes

As to the issue below, are you sure you don't have similar classes (in
name and package) in both common/lib and WEB-INF/lib?  Seems like
there's a classloader issue at work here.  Take a look at the
classloader howto at
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It
might offer some ideas.

--David

aladdin wrote:


When I put my webapp.jar file in the WEB-INF directory, it doesn't find
the app.  When I exploded it into the classes directory, and associated
subdirectories, they are found fine, but I get this problem (the one
below).

This, it turns out, is triggered by the fact I have the webapp.jar file
in the lib directory and all the classes unpacked in the classes
directory (both under WEB-INF, of course).  Getting rid of the webapp.jar
file in the lib directory solves the problem below, but now tomcat won't
use that the jar file in the lib directory, even though when it's
unpacked in the classes directory, he seems perfectly happy.  Is there
some magic I need for tomcat to use .jar files in the WEB-INF/lib
directory, like an entry in web.xml or server.xml?

On Friday 16 February 2007 22:52, aladdin wrote:
  

I was getting a message like SEVERE PersistenceManager persistence not
enabled, or something like that (I don't remember) so I disabled
(commented out) the Manager tag in server.xml that configured the
PersistenceManager. Now, I'm getting

Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
modified INFO: Additional JARs have been added
Feb 16, 2007 9:26:34 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started

over and over in the log files.  Anyone know what's causing this?  I
thought maybe tomcat was restarting, but the PID doesn't change.  It
seems to work, but it's filling up my log files.

TIA





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



Re: Can't find classes in jar files in WEB-INF

2007-02-19 Thread aladdin
Here's a snippet of my web.xml that shows the filter:


  servlet
  servlet-nameReqMgr/servlet-name
  servlet-classinfoIsland.ReqMgr/servlet-class
  /servlet
  servlet-mapping
  servlet-nameReqMgr/servlet-name
  url-pattern/members/servlet/ReqMgr/url-pattern
  /servlet-mapping

  !-- Filters Here --
  filter
filter-nameCheckUser/filter-name
filter-classinfoIsland.CheckUser/filter-class
init-param
  param-nameloginPage/param-name
  param-value/login.jsp/param-value
/init-param
  /filter
  filter-mapping
filter-nameCheckUser/filter-name
url-pattern/members/*/url-pattern
  /filter-mapping

Interesting, though, the filter is AFTER the servlet.  Does that mean tomcat 
is finding them?

However, it all works when the classes are exploded, filters, servlets,  all.

I've tried the jar -tvf, and it works OK.  In fact, I just jar 'em up right 
from the WEB-INF/classes directory, move 'em over to lib, and delete the 
directories underneath classes.  That's the way I produce the jar.  Is there 
something supposed to be in it that I'm missing?

On Monday 19 February 2007 08:02, David Smith wrote:
 You don't need to tell tomcat to look in WEB-INF/lib/*.jar.  Tomcat does
 that automatically per spec.  I'm guessing there is something wrong with
 the way your jar was created or a permissions problem.

 Try testing the jar with

 $JAVA_HOME/bin/jar tf whatever.jar
 (linux/maxos syntax)
 or
 %JAVA_HOME\bin\jar tf whatever.jar
 (windows syntax)

 to be sure it's valid.  The command above lists all the files in the jar
 file.  Then be sure permissions are set so the user tomcat runs as can
 read it.  One last thing to look for is any errors further up in the
 logs above the class not found exception.

 --David

 aladdin wrote:
 Thanks for the tip!
 
 I don't think I'd have a conflict with all the classes in my application.
 Although some of my classes have common names, like user.java (compiled,
 of course, to user.class), they are all member of just one of three
  packages: infoisland, dbMgr, and utils, so I don't think the names are
  colliding. Loading the app bombs out as tomcat is loading when it can't
  find my filter, CheckUser (makes sure users are logged in), which is in
  the infoIsland package.
 
 However, your comment is telling: WEB-INF itself is not checked or
  scanned for .jar files at all.  So, if I make sure the WEB-INF/classes
  subdirectory is empty, how do I tell tomcat to go get classes out of the
 WEB-INF/lib/whatever.jar file?
 
 Thanks.
 
 On Sunday 18 February 2007 20:05, David Smith wrote:
 It should be noted there are only a couple of places .jar files are
 allowed in tomcat:
 
 1. WEB-INF/lib
 2. common/lib of the tomcat installation directory
 
 WEB-INF itself is not checked or scanned for .jar files at all.  In
 addition, any files in the classes directory will override their
 equivalent in the lib directory.  This occurs regardless of it being in
 WEB-INF/classes or common/classes
 
 As to the issue below, are you sure you don't have similar classes (in
 name and package) in both common/lib and WEB-INF/lib?  Seems like
 there's a classloader issue at work here.  Take a look at the
 classloader howto at
 http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html.  It
 might offer some ideas.
 
 --David
 
 aladdin wrote:
 When I put my webapp.jar file in the WEB-INF directory, it doesn't find
 the app.  When I exploded it into the classes directory, and associated
 subdirectories, they are found fine, but I get this problem (the one
 below).
 
 This, it turns out, is triggered by the fact I have the webapp.jar file
 in the lib directory and all the classes unpacked in the classes
 directory (both under WEB-INF, of course).  Getting rid of the
  webapp.jar file in the lib directory solves the problem below, but now
  tomcat won't use that the jar file in the lib directory, even though
  when it's unpacked in the classes directory, he seems perfectly happy. 
  Is there some magic I need for tomcat to use .jar files in the
  WEB-INF/lib directory, like an entry in web.xml or server.xml?
 
 On Friday 16 February 2007 22:52, aladdin wrote:
 I was getting a message like SEVERE PersistenceManager persistence not
 enabled, or something like that (I don't remember) so I disabled
 (commented out) the Manager tag in server.xml that configured the
 PersistenceManager. Now, I'm getting
 
 Feb 16, 2007 9:26:34 PM org.apache.catalina.loader.WebappClassLoader
 modified INFO: Additional JARs have been added
 Feb 16, 2007 9:26:34 PM org.apache.catalina.core.StandardContext reload
 INFO: Reloading this Context has started
 
 over and over in the log files.  Anyone know what's causing this?  I
 thought maybe tomcat was restarting, but the PID doesn't change.  It
 seems to work, but it's filling up my log files.
 
 TIA

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

DBCP Logging

2007-02-19 Thread news
Hello List,

I've configured DBCP on my Tomcat 5.5.20 Installation.
Resource name=jdbc/myDB
  auth=Container
  type=javax.sql.DataSource
 maxActive=10
   maxIdle=2
   maxWait=1
  username=aUser
  password=secret
   driverClassName=com.sybase.jdbc3.jdbc.SybDriver
   factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
   url=jdbc:sybase:Tds:194.111.13.30:5000/?charset=iso_1 /

This runs great and I'm really happy with it until it comes to logging
and/or monitoring.
What do I have to do if I want to know the state of the connection pool? How
can I see how many connections are currently in use? Or - more generally -
How can I set up logging for the pool? 

Thanks!

Jan

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



Re: DBCP Logging

2007-02-19 Thread David Delbecq
Lambda probe is a usefull webapplication you can deploy under tomcat and
that, amongst many features, allows you to see the state of your
connection pools.

En l'instant précis du 02/19/07 14:40, [EMAIL PROTECTED] s'exprimait en
ces termes:
 Hello List,

 I've configured DBCP on my Tomcat 5.5.20 Installation.
 Resource name=jdbc/myDB
   auth=Container
   type=javax.sql.DataSource
  maxActive=10
maxIdle=2
maxWait=1
   username=aUser
   password=secret
driverClassName=com.sybase.jdbc3.jdbc.SybDriver
factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
url=jdbc:sybase:Tds:194.111.13.30:5000/?charset=iso_1 /

 This runs great and I'm really happy with it until it comes to logging
 and/or monitoring.
 What do I have to do if I want to know the state of the connection pool? How
 can I see how many connections are currently in use? Or - more generally -
 How can I set up logging for the pool? 

 Thanks!

 Jan

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

   


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



Re: IOException writing to /usr/share/tomcat5/conf/tomcat-users.xml.new

2007-02-19 Thread Tom Robinson

Markus Schönhaber wrote:

Tom Robinson wrote:


Markus Schönhaber wrote:



Just a WAG: maybe it's not really a permisson problem but the
tomcat-users.xml that is somehow corrupt. If you post it's content here,
we can take a look and see if we spot something obviously wrong.
Yes, it's far fetched, but I'm out of ideas.

Since I'm all out of ideas myself:

?xml version='1.0' encoding='utf-8'?
tomcat-users
   role rolename=manager/
   role rolename=admin/
   user username=manager password=secret roles=manager,admin/
/tomcat-users


No, there's nothing wrong with this. So, my WAG was just that: a WAG.
Sorry.

Regards
  mks

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


I still don't know what the problem is.

I've re-installed tomcat5 and the manager webapp but continually get the 
IOException on tomcat-users.xml.new. :-/


Well, in all reality, it was only a temporary solution. I've switched to a 
org.apache.catalina.realm.JNDIRealm and have users assigned to the manager role 
in LDAP. This works just fine and is probably a bit more secure.


Thanks to all for your help.

t.

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



Tomcat default context

2007-02-19 Thread Gardner, Brad
 

I am using tomcat 5.5.20 and attempting to set up a default context
without placing the context tag inside of the server.xml file.  I
created the ROOT.xml file under Tomcat Home Dir/conf/engine/host/
and placed this tag into the file:

 

Context docBase=mywebapp/

 

This resulted in no change, and the default tomcat page still appears
when I view my webapp.  I have also tried adding path= with the same
result.  This tag works fine when placed inside server.xml, but I am
trying to avoid that now.  Any ideas on what I may be missing or
mis-understanding?



RE: Tomcat default context

2007-02-19 Thread Propes, Barry L [GCG-NAOT]
didn't know it was possibleto set up a default context outside of the 
server.xml file.
I thought Tomcat required that.

-Original Message-
From: Gardner, Brad [mailto:[EMAIL PROTECTED]
Sent: Monday, February 19, 2007 10:43 AM
To: users@tomcat.apache.org
Subject: Tomcat default context


 

I am using tomcat 5.5.20 and attempting to set up a default context
without placing the context tag inside of the server.xml file.  I
created the ROOT.xml file under Tomcat Home Dir/conf/engine/host/
and placed this tag into the file:

 

Context docBase=mywebapp/

 

This resulted in no change, and the default tomcat page still appears
when I view my webapp.  I have also tried adding path= with the same
result.  This tag works fine when placed inside server.xml, but I am
trying to avoid that now.  Any ideas on what I may be missing or
mis-understanding?


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



Re: Tomcat mysteriously shuts down

2007-02-19 Thread David Kerber

raine king wrote:

OK I figured it out:

Me and a couple testers were all running versions of Tomcat and once 
in a while we would use the same machine, and we hadn't changed the 
shutdown port/message(server.xml) so we were occasionally shutting 
down one another's Tomcats with shutdown.sh!

D'oh!!





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



RE: Tomcat default context

2007-02-19 Thread Gardner, Brad
This is from the documentation that comes with tomcat 5

Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended
to place Context elements directly in the server.xml file

Doing it outside the server.xml file allows you to make changes without
restarting tomcat.  Nice feature, but still working on the root context.

-Original Message-
From: Propes, Barry L [GCG-NAOT] [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 19, 2007 11:48 AM
To: Tomcat Users List
Subject: RE: Tomcat default context

didn't know it was possibleto set up a default context outside of
the server.xml file.
I thought Tomcat required that.

-Original Message-
From: Gardner, Brad [mailto:[EMAIL PROTECTED]
Sent: Monday, February 19, 2007 10:43 AM
To: users@tomcat.apache.org
Subject: Tomcat default context


 

I am using tomcat 5.5.20 and attempting to set up a default context
without placing the context tag inside of the server.xml file.  I
created the ROOT.xml file under Tomcat Home Dir/conf/engine/host/
and placed this tag into the file:

 

Context docBase=mywebapp/

 

This resulted in no change, and the default tomcat page still appears
when I view my webapp.  I have also tried adding path= with the same
result.  This tag works fine when placed inside server.xml, but I am
trying to avoid that now.  Any ideas on what I may be missing or
mis-understanding?


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


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



RE: Tomcat default context

2007-02-19 Thread Propes, Barry L [GCG-NAOT]
oh, ok. Hadn't gone down that road yet. Good to know.

Then would it be 
Context docBase=/mywebapp/  ?


-Original Message-
From: Gardner, Brad [mailto:[EMAIL PROTECTED]
Sent: Monday, February 19, 2007 10:52 AM
To: Tomcat Users List
Subject: RE: Tomcat default context


This is from the documentation that comes with tomcat 5

Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended
to place Context elements directly in the server.xml file

Doing it outside the server.xml file allows you to make changes without
restarting tomcat.  Nice feature, but still working on the root context.

-Original Message-
From: Propes, Barry L [GCG-NAOT] [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 19, 2007 11:48 AM
To: Tomcat Users List
Subject: RE: Tomcat default context

didn't know it was possibleto set up a default context outside of
the server.xml file.
I thought Tomcat required that.

-Original Message-
From: Gardner, Brad [mailto:[EMAIL PROTECTED]
Sent: Monday, February 19, 2007 10:43 AM
To: users@tomcat.apache.org
Subject: Tomcat default context


 

I am using tomcat 5.5.20 and attempting to set up a default context
without placing the context tag inside of the server.xml file.  I
created the ROOT.xml file under Tomcat Home Dir/conf/engine/host/
and placed this tag into the file:

 

Context docBase=mywebapp/

 

This resulted in no change, and the default tomcat page still appears
when I view my webapp.  I have also tried adding path= with the same
result.  This tag works fine when placed inside server.xml, but I am
trying to avoid that now.  Any ideas on what I may be missing or
mis-understanding?


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


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


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



tomcat connector

2007-02-19 Thread Alice \(Wong\) Ng
Hey tomcat-user,

 

We are trying to use tomcat connector to make IIS talk to tomcat.  

 

Recently we have run into a couple issues with the tomcat connector.  We
are running into deployment issues where simply placing it on a box is
not behaving like we want it to.  I thought this was more of a one time
thing, but sometimes we have to restart IIS multiple times before the
DLL is loaded.  This of course would be very, very bad.  

 

Our question will be if there is tomcat connector is working properly
with IIS, and if it can scale in production level environment?

 

Thanks,

:0) Alice

 



RE: Tomcat default context

2007-02-19 Thread Caldarale, Charles R
 From: Gardner, Brad [mailto:[EMAIL PROTECTED]
 Subject: Tomcat default context
 
 I created the ROOT.xml file under Tomcat Home
Dir/conf/engine/host/
 and placed this tag into the file:
 
 Context docBase=mywebapp/

Don't put your webapp in the Host's appBase directory; if you do it
may be deployed twice, once as the name on the .xml file, and once as
the name of the appBase sub-directory.  Keep the webapp outside of
Tomcat's directory structure, and use an absolute path on the docBase
attribute.

 This resulted in no change, and the default tomcat page still appears
 when I view my webapp.

You need to delete Tomcat's ROOT directory and everything in it.  (Or
rename it to something other than ROOT if you want to keep it around.)

 I have also tried adding path= with the same result.

The path attribute is not allowed unless the Context is inside
server.xml, which you're trying to avoid.

 Any ideas on what I may be missing or mis-understanding?

You're not removing Tomcat's original default context.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



Tomcat Cobertura

2007-02-19 Thread dhay
Hi,

We're trying to instrument a war file using Cobertura, and gather the
coverage details when deployed and used under Tomcat.

Below is a thread from the Cobertura list - I'm having problems when I run
tomcat5.exe (which we use in our product) with the instrumented jar.  In
this mode, Cobertura saves the instrumented data when the web server is
shutdown.  If I run tomcat using startup.bat, everything works great.  With
tomcat5.exe, no data is saved when tomcat shuts down.

Does anyone know what is causing this, and how I might work around it?

cheers,

David

- Forwarded by David Hay/Lex/Lexmark on 02/19/2007 12:30 PM -
   
 John W. Lewis   
 [EMAIL PROTECTED] 
 com   To 
   [EMAIL PROTECTED]  
 02/10/2007 10:42   cc 
 AM[EMAIL PROTECTED] 
   net
   Subject 
   RE: [Cobertura-devel] creating  
   instrumented war
   
   
   
   
   
   




This code runs during Cobertura initialization:

 private static void initialize()
 {
  // Hack for Tomcat - by saving project data right now we force loading
  // of classes involved in this process (like ObjectOutputStream)
  // so that it won't be necessary to load them on JVM shutdown
  if (System.getProperty(catalina.home) != null)
  {
   saveGlobalProjectData();

   // Force the class loader to load some classes that are
   // required by our JVM shutdown hook.
   // TODO: Use ClassLoader.loadClass(whatever); instead
   ClassData.class.toString();
   CoverageData.class.toString();
   CoverageDataContainer.class.toString();
   FileLocker.class.toString();
   HasBeenInstrumented.class.toString();
   LineData.class.toString();
   PackageData.class.toString();
   SourceFileData.class.toString();
  }

I'm wondering if catalina.home is not set when you run as a service?

John

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 09, 2007 6:14 PM
To: John W. Lewis
Cc: [EMAIL PROTECTED]
Subject: RE: [Cobertura-devel] creating instrumented war

Hi John,

I see cobertura.ser in the ...\tomcat\bin dir getting updated on startup
(timestamp changes) and log shows it found it too.  Just not on shutdown.
Delay doesn't help.

If you could look for tomcat special case I'd appreciate it.

cheers,

David




 John W. Lewis
 [EMAIL PROTECTED]
 com   To
   [EMAIL PROTECTED]
 02/09/2007 05:54   cc
 PM[EMAIL PROTECTED]
   net
   Subject
   RE: [Cobertura-devel] creating
   instrumented war










It might be due to a different working directory while running as a
service.  Unless you are starting the tomcat jvm while passing in the java
property that tells where the cobertura.ser file is, the file will end up
in the working directory.  I would search the entire hard drive for a
cobertura.ser file.  If you see two, it may be that one was written by the
service.  That would be the working directory.

The other thing is that I would try putting in a delay of about a minute
before calling cobertura-report just to give the java process enough time
to exit.

The other thing is that I do remember some kind of special case code for
tomcat.  I can look for that if the other two things above do not help.

Another thing is that are you sure the instrumented war is in use when you
start it up as a service?

John

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, February 09, 2007 3:59 PM
To: John W. Lewis
Cc: [EMAIL PROTECTED]
Subject: RE: [Cobertura-devel] creating instrumented war

Thanks!  That works - I'd overlooked it.

However, I am running into an issue with Tomcat not updating the

Connection pool problem DBCP - 4.1.3

2007-02-19 Thread Propes, Barry L [GCG-NAOT]

This is driving me crazy. I'm finally close, I think, on getting this solved.

Problem is I seem to either get Connection is closed or Exhausted resultset, 
depending where I put my close statement.


I've got the following up at the top, which replaces my driver reference that 
was previously there.

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);
// Look up our data source
DataSource ds = (DataSource)
  envCtx.lookup(jdbc/myoracle);
// Allocate and use a connection from the pool
Connection connection = ds.getConnection();

Statement selstmt = connection.createStatement();

String prepSQL = SELECT AID, ACTIVE, REQUESTOR_NAME..., +
 PHONE_NUM,DATE_REQ,...  +
   +
 FROM table a INNER JOIN table b  +
 ON a.CTRL_ID = b.CTRL_ID  +
 WHERE AID = ?;

PreparedStatement prepstmt = connection.prepareStatement(prepSQL);
prepstmt.setString(1, aidstrd);
ResultSet admsql = prepstmt.executeQuery();
admsql.next();

(etc., etc.)

admsql.close();
selstmt.close();
connection.close();

If I move up connection.close, I get the Connection is closed statement, 
otherwise I get exhausted result set. 
Any idea what gives?


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



RE: Connection pool problem DBCP - 4.1.3

2007-02-19 Thread Mike Quilleash
Need a bit more info.  DB type and version, JDBC driver version,
ResultSet loop/access code.

Generally the pseudo code should be...


Open Connection
try
{
  Prepare Statement
  try
  {
Execute Query
try
{
  while ( resultSet.next() )
  {
// process row here
  }
}
finally
{
  Close ResultSet
}
  }
  finally
  {
Close PreparedStatement 
  }
}
finally
{
  Close Connection
}


All of the closing should be done in finally blocks so they happen even
if you get an exception.

-Original Message-
From: Propes, Barry L [GCG-NAOT] [mailto:[EMAIL PROTECTED] 
Sent: 19 February 2007 18:22
To: Tomcat Users List
Subject: Connection pool problem DBCP - 4.1.3


This is driving me crazy. I'm finally close, I think, on getting this
solved.

Problem is I seem to either get Connection is closed or Exhausted
resultset, depending where I put my close statement.


I've got the following up at the top, which replaces my driver reference
that was previously there.

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env); // Look up
our data source DataSource ds = (DataSource)
  envCtx.lookup(jdbc/myoracle);
// Allocate and use a connection from the pool Connection connection =
ds.getConnection();

Statement selstmt = connection.createStatement();

String prepSQL = SELECT AID, ACTIVE, REQUESTOR_NAME..., +
 PHONE_NUM,DATE_REQ,...  +
   +
 FROM table a INNER JOIN table b  +
 ON a.CTRL_ID = b.CTRL_ID  +
 WHERE AID = ?;

PreparedStatement prepstmt = connection.prepareStatement(prepSQL);
prepstmt.setString(1, aidstrd);
ResultSet admsql = prepstmt.executeQuery(); admsql.next();

(etc., etc.)

admsql.close();
selstmt.close();
connection.close();

If I move up connection.close, I get the Connection is closed statement,
otherwise I get exhausted result set. 
Any idea what gives?


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



 This e-mail is bound by the terms and conditions described at 
http://www.subexazure.com/mail-disclaimer.html


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



RE: Connection pool problem DBCP - 4.1.3

2007-02-19 Thread Propes, Barry L [GCG-NAOT]
ok, I'll send that, too. Sorry about that.

-Original Message-
From: Mike Quilleash [mailto:[EMAIL PROTECTED]
Sent: Monday, February 19, 2007 1:08 PM
To: Tomcat Users List
Subject: RE: Connection pool problem DBCP - 4.1.3


Need a bit more info.  DB type and version, JDBC driver version,
ResultSet loop/access code.

Generally the pseudo code should be...


Open Connection
try
{
  Prepare Statement
  try
  {
Execute Query
try
{
  while ( resultSet.next() )
  {
// process row here
  }
}
finally
{
  Close ResultSet
}
  }
  finally
  {
Close PreparedStatement 
  }
}
finally
{
  Close Connection
}


All of the closing should be done in finally blocks so they happen even
if you get an exception.

-Original Message-
From: Propes, Barry L [GCG-NAOT] [mailto:[EMAIL PROTECTED] 
Sent: 19 February 2007 18:22
To: Tomcat Users List
Subject: Connection pool problem DBCP - 4.1.3


This is driving me crazy. I'm finally close, I think, on getting this
solved.

Problem is I seem to either get Connection is closed or Exhausted
resultset, depending where I put my close statement.


I've got the following up at the top, which replaces my driver reference
that was previously there.

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env); // Look up
our data source DataSource ds = (DataSource)
  envCtx.lookup(jdbc/myoracle);
// Allocate and use a connection from the pool Connection connection =
ds.getConnection();

Statement selstmt = connection.createStatement();

String prepSQL = SELECT AID, ACTIVE, REQUESTOR_NAME..., +
 PHONE_NUM,DATE_REQ,...  +
   +
 FROM table a INNER JOIN table b  +
 ON a.CTRL_ID = b.CTRL_ID  +
 WHERE AID = ?;

PreparedStatement prepstmt = connection.prepareStatement(prepSQL);
prepstmt.setString(1, aidstrd);
ResultSet admsql = prepstmt.executeQuery(); admsql.next();

(etc., etc.)

admsql.close();
selstmt.close();
connection.close();

If I move up connection.close, I get the Connection is closed statement,
otherwise I get exhausted result set. 
Any idea what gives?


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



 This e-mail is bound by the terms and conditions described at 
http://www.subexazure.com/mail-disclaimer.html



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


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



Re: Connection pool problem DBCP - 4.1.3

2007-02-19 Thread --

I think you should also call

prepstmt.close()

(before closing the connection).

Besides 


selstmt

seems not to be used at all.

Bye 


This is driving me crazy. I'm finally close, I think, on getting this solved.

Problem is I seem to either get Connection is closed or Exhausted resultset, 
depending where I put my close statement.


I've got the following up at the top, which replaces my driver reference that 
was previously there.

Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup(java:comp/env);
// Look up our data source
DataSource ds = (DataSource)
  envCtx.lookup(jdbc/myoracle);
// Allocate and use a connection from the pool
Connection connection = ds.getConnection();

Statement selstmt = connection.createStatement();

String prepSQL = SELECT AID, ACTIVE, REQUESTOR_NAME..., +
 PHONE_NUM,DATE_REQ,...  +
   +
 FROM table a INNER JOIN table b  +
 ON a.CTRL_ID = b.CTRL_ID  +
 WHERE AID = ?;

PreparedStatement prepstmt = connection.prepareStatement(prepSQL);
prepstmt.setString(1, aidstrd);
ResultSet admsql = prepstmt.executeQuery();
admsql.next();

(etc., etc.)

admsql.close();
selstmt.close();
connection.close();

If I move up connection.close, I get the Connection is closed statement, otherwise I get exhausted result set. 
Any idea what gives?



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


  



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



RE: Connection pool problem DBCP - 4.1.3

2007-02-19 Thread Propes, Barry L [GCG-NAOT]
Johnny, you were correct.

that selstmt connection statement was not being utilized, but sure must have 
had an adverse impact, because I think I've got it working ok now!

Thanks a bunch, guys!

-Original Message-
From: -- [mailto:[EMAIL PROTECTED]
Sent: Monday, February 19, 2007 2:06 PM
To: Tomcat Users List
Subject: Re: Connection pool problem DBCP - 4.1.3


I think you should also call

prepstmt.close()

(before closing the connection).

Besides 

selstmt

seems not to be used at all.

Bye 

 This is driving me crazy. I'm finally close, I think, on getting this solved.

 Problem is I seem to either get Connection is closed or Exhausted resultset, 
 depending where I put my close statement.


 I've got the following up at the top, which replaces my driver reference that 
 was previously there.

 Context initCtx = new InitialContext();
 Context envCtx = (Context) initCtx.lookup(java:comp/env);
 // Look up our data source
 DataSource ds = (DataSource)
   envCtx.lookup(jdbc/myoracle);
 // Allocate and use a connection from the pool
 Connection connection = ds.getConnection();

 Statement selstmt = connection.createStatement();

 String prepSQL = SELECT AID, ACTIVE, REQUESTOR_NAME..., +
PHONE_NUM,DATE_REQ,...  +
    +
FROM table a INNER JOIN table b  +
ON a.CTRL_ID = b.CTRL_ID  +
WHERE AID = ?;

 PreparedStatement prepstmt = connection.prepareStatement(prepSQL);
 prepstmt.setString(1, aidstrd);
 ResultSet admsql = prepstmt.executeQuery();
 admsql.next();

 (etc., etc.)

 admsql.close();
 selstmt.close();
 connection.close();

 If I move up connection.close, I get the Connection is closed statement, 
 otherwise I get exhausted result set. 
 Any idea what gives?


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


   


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


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



Start Tomcat Error

2007-02-19 Thread Xian Qing
I have tomcat 4.1.24 and Eclipse 3.1.2. When I start Tomcat from
Eclipse, I get error below. Please help me to fix.


GlobalResourcesLifecycleListener: Exception creating UserDatabase
MBeans for UserDatabase
javax.management.MalformedObjectNameException: Missing value in
properties list
at
javax.management.ObjectName.createPropertiesMap(ObjectName.java:222)
at javax.management.ObjectName.parse(ObjectName.java:93)
at javax.management.ObjectName.init(ObjectName.java:43)
at
org.apache.catalina.mbeans.MBeanUtils.createObjectName(MBeanUtils.java:1608)
at
org.apache.catalina.mbeans.MBeanUtils.createMBean(MBeanUtils.java:761)
at
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:299)
at
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:223)
at
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:181)
at
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:149)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2183)
at
org.apache.catalina.startup.Catalina.start(Catalina.java:512)
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.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24


Thanks.

Xian



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



Re: DBCP Logging

2007-02-19 Thread Yannick Haudry

If your datasource is not managed through your container but
application driven, I guess Lambda probe (which is a great
application) will not be able to give you information about it ? Is
there a way to programmatically log the number of connections in use,
etc ... ?

Thanks
Yannick

On 2/19/07, David Delbecq [EMAIL PROTECTED] wrote:

Lambda probe is a usefull webapplication you can deploy under tomcat and
that, amongst many features, allows you to see the state of your
connection pools.

En l'instant précis du 02/19/07 14:40, [EMAIL PROTECTED] s'exprimait en
ces termes:
 Hello List,

 I've configured DBCP on my Tomcat 5.5.20 Installation.
 Resource name=jdbc/myDB
   auth=Container
   type=javax.sql.DataSource
  maxActive=10
maxIdle=2
maxWait=1
   username=aUser
   password=secret
driverClassName=com.sybase.jdbc3.jdbc.SybDriver
factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
url=jdbc:sybase:Tds:194.111.13.30:5000/?charset=iso_1 /

 This runs great and I'm really happy with it until it comes to logging
 and/or monitoring.
 What do I have to do if I want to know the state of the connection pool? How
 can I see how many connections are currently in use? Or - more generally -
 How can I set up logging for the pool?

 Thanks!

 Jan

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




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


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



request.getParameter() in JSP misinterpreting foreign characters

2007-02-19 Thread Ramez Ghazzaoui

Hi,

Back in May 2006, I had trouble Configuring Tomcat HTTP server to 
generate proper links for non-English file names in a Directory Listing. 
Mr. Mark Thomas proposed a solution that worked: He told me to set 
URIEncoding=UTF-8 in the connector (presumably in server.xml).


This fixed the Directory Listing problem, but ...

Today I realized that this very solution has broken the Java 
request.getParameter() method in JSP. Now, with the URIEncoding set to 
UTF-8, this Java method is misinterpreting non-English characters. When 
I invoke from the browser the following address: 
http://localhost/main.jsp?path=olé (or the equivalent 
http://localhost/main.jsp?path=ol%E9) a call to 
request.getParameter(path) from within main.jsp returns ol? where the 
question mark is character number 65533. That's way off from 233 (which 
is the correct U-dec for eacute, or é).


When I remove the URIEncoding=UTF-8 attribute from my connector, 
request.getParameter(path) returns olé as expected, and the JSP works 
as intended. However, of course, this breaks directory listings as 
described in my 26 May 2006 posting titled How do I configure Tomcast 
HTTP server to generate working links for French file names in Tomcat 
Directory Listing?.


Is there a way to make French characters work both in Directory Listings 
and in GET parameters?


Thanks,

-Ramez


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



Connection Pooling Question

2007-02-19 Thread Marc Farrow

Slightly off topic, but the core of what I want is being done in the source
code of Tomcat. I am trying to use the Apache Commons DBCP classes to create
my own connection pooling factory that I can use within my servlet container
(Tomcat) and also in stand alone programs.  I see how the Datasource that
Tomcat creates when you use its connection pooling is put into a JNDI
context, but I have scoured over the Tomcat source code and I have not been
able to find the code that is actually doing the context bindings and where
the information is being held.  Can someone point me in the right direction
of the source code to review and also any advanced JNDI tutorials that
teach you how to bind to a context that can be reused by external resources
(meaning another JVM).

Also, has anyone seen or done this type of solution before?

Thank you,

--
Marc Farrow


RE: DBCP Logging

2007-02-19 Thread Stephens, Daniel
We wrote a simple method to return some stats. It's kinda crude, and may not
be a 100% accurate, but here is what we did. Hope it helps. We used this
documentation here 

http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/dbcp/Basic
DataSource.html

public static void printDataSourceStats(DataSource ds,String dbname,
javax.servlet.jsp.JspWriter out) throws SQLException {
BasicDataSource bds = (BasicDataSource) ds;
try {
 int bdsNumActive = bds.getNumActive();
 int bdsMaxActive = bds.getMaxActive();
 int bdsNumIdle = bds.getNumIdle();
 long bdsMaxWait = bds.getMaxWait();
 String fontcolor = ;

if (bdsNumActive = 400) {
 fontcolor = font color=green;
} else if (bdsNumActive  400  bdsNumActive = 500) {
 fontcolor = font color=orange;
} else {
 fontcolor = font color=red;
}
out.print(table cellpadding='3' cellspacing='0');
out.print(tr);
out.print(td class=v11 border_botdot
borderg_r + dbname +  DataSource/td);
out.print(/tr);
out.print(tr);
out.print(td height='24'
class='columnhead9 border_r' align='center' alt='connections that are
processing'# Active Connections/td);
out.print(td height='24'
class='columnhead9 border_r' align='center' alt='total size of pool'Maximum
Active Connections/td);  
out.print(td height='24'
class='columnhead9 border_r' align='center' alt='connections that are idle
in the pool'# of Idle Connections/td);
out.print(td height='24'
class='columnhead9 border_r' align='center'Maxium Wait period before
timeout/td); 
out.print(/tr);
out.print(tr);
out.print(td class='v11 border_botdot
borderg_r' +fontcolor + bdsNumActive + /font/td);
out.print(td class='v11 border_botdot
borderg_r' + bdsMaxActive + /td);
out.print(td align='left' class='v11
border_botdot borderg_r' + bdsNumIdle + /td);
out.print(td align='left' class='v11
border_botdot borderg_r' + bdsMaxWait + /td);
out.print(/tr);
out.print(/table);
} catch(Exception e) {
e.printStackTrace();
}
 } 

-Original Message-
From: Yannick Haudry [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 19, 2007 2:37 PM
To: Tomcat Users List
Subject: Re: DBCP Logging

If your datasource is not managed through your container but application
driven, I guess Lambda probe (which is a great
application) will not be able to give you information about it ? Is there a
way to programmatically log the number of connections in use, etc ... ?

Thanks
Yannick

On 2/19/07, David Delbecq [EMAIL PROTECTED] wrote:
 Lambda probe is a usefull webapplication you can deploy under tomcat 
 and that, amongst many features, allows you to see the state of your 
 connection pools.

 En l'instant précis du 02/19/07 14:40, [EMAIL PROTECTED] s'exprimait en 
 ces termes:
  Hello List,
 
  I've configured DBCP on my Tomcat 5.5.20 Installation.
  Resource name=jdbc/myDB
auth=Container
type=javax.sql.DataSource
   maxActive=10
 maxIdle=2
 maxWait=1
username=aUser
password=secret
 driverClassName=com.sybase.jdbc3.jdbc.SybDriver
 factory=org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory
 
  url=jdbc:sybase:Tds:194.111.13.30:5000/?charset=iso_1 /
 
  This runs great and I'm really happy with it until it comes to 
  logging and/or monitoring.
  What do I have to do if I want to know the state of the connection 
  pool? How can I see how many connections are currently in use? Or - 
  more generally - How can I set up logging for the pool?
 
  Thanks!
 
  Jan
 
  
  - To start a new topic, e-mail: users@tomcat.apache.org To 
  unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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

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


-
The information in this 

Installing Tomcat 6.0.9 on Sun Solaris

2007-02-19 Thread Daniel Gresh

Hi all,

I was having some more problems with some older Tomcat installations, so 
I decided to upgrade to the newest release and download it fresh this 
time instead of using an existing build from awhile back.


I've been trying to set up Tomcat 6.0.9, but I'm afraid I'm having some
problems.

I've been following the installation instructions in RUNNING.txt.
Basically, it tells me to download the binary distribution, unpack it,
make sure JDK1.5 or greater is installed, and run the server. I also need to 
set up a CATALINA_BASE,

After downloading the binary distribution, I uncompressed it to $CATALINA_HOME. 
Then, I created a new
directory, and set that to be
$CATALINA_BASE. Then, I took the appropriate directories out of $CATALINA_HOME 
and put them in $CATALINA_BASE, according to RUNNING.txt. Then, I started
up the server and set it to use $CATALINA_BASE with
$CATALINA_HOME/bin/startup.sh -Dcatalina.base=$HOME/dtomcat. This
gave me the following output:

Using CATALINA_BASE:   /u/dgresh/dtomcat
Using CATALINA_HOME:   /u/dgresh/apache-tomcat-6.0.9
Using CATALINA_TMPDIR: /u/dgresh/dtomcat/temp
Using JRE_HOME:   /usr/local/jdk1.5.0_06

and then gave me a command prompt. So I navigated to http://localhost:8080,
and I got a connection failed error. I searched through the
documentation, and found that an issue with ports might be causing the
problem. I edited the $CATALINA_BASE/conf/server.xml file, and changed
the server port from 8005 to 8007, and the connector port from 8080 to
8082. Then, I navigated to http://localhost:8082, and got the
same connection failed error. 


Furthermore, I'm running into problems when I go to shutdown Tomcat.
When I run $CATALINA_HOME/bin/shutdown.sh, I get the following output:

java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at
org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:215)
   at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)

I'm not sure what that means, even after a web search. 


There's one more thing that is confusing me. RUNNING.txt says that all I
need to do to install Tomcat is unpack it to a directory, have JDK1.5+
installed, and startup the server. However, the setup instructions at
the Tomcat website have something about running it as a UNIX daemon
(http://tomcat.apache.org/tomcat-6.0-doc/setup.html). I'm not exactly sure if 
this is needed, but I tried to follow the instructions, so I downloaded the
commnons-daemon file and placed the necessary files in
$CATALINA_HOME/bin. However, I cannot run tar xvfz jsvc.tar.gz, as the
-z argument is not being recognized. The directions said GNU TAR was
needed, so I searched the web for that, but I came to a confusing site
that said something about FTPing the GNU TAR files, and I didn't know
where to go from there.

So is there simply something I missed about configuring Tomcat for
proper use on my localhost? Or is this a problem with my Tomcat installation?

If you could offer any advice, I'd be very appreciative.

Thanks,
Dan



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



Re: Installing Tomcat 6.0.9 on Sun Solaris

2007-02-19 Thread Hassan Schroeder

On 2/19/07, Daniel Gresh [EMAIL PROTECTED] wrote:


I've been following the installation instructions in RUNNING.txt.
Basically, it tells me to download the binary distribution, unpack it,
make sure JDK1.5 or greater is installed, and run the server. I also need to 
set up a CATALINA_BASE,


No, you don't. Until you've gotten the basic installation down, stay out
of the advanced configuration section. :-)

If you follow *exactly* the steps before that, it should just work. If it
doesn't, e.g., you're still getting a connection failed error, check to
see whether the process is running or not. If not, check the logs, and
if so, check for firewall/iptables/whatever problems.

Good luck,
--
Hassan Schroeder  [EMAIL PROTECTED]

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



Re: Installing Tomcat 6.0.9 on Sun Solaris

2007-02-19 Thread Daniel Gresh
Hi thanks for the reply.

I cleared my CATALINA_BASE variable so it would take on the default
$CATALINA_HOME variable. I then moved my conf lib logs temp webapps work
directories back into $CATALINA_HOME. Then, I used startup.sh, and it
WORKED! Hooray! I can shutdown and startup the server when I do not have
a $CATALINA_BASE. When I try to setup a $CATALINA_BASE by moving the
aforementioned directories to $HOME/dtomcat, I get the error I posted in
my original message. 

Is there anything I missed when setting up $CATALINA_BASE?

I moved the conf, lib, logs, temp, work, and webapp directories to
$CATALINA_BASE. Should I have copied them, therefore leaving a copy in
$CATALINA_HOME? After that, I use startup.sh and supply the
-Dcatalina.base=$HOME/dtomcat argument to startup.sh, and it says it's
using the appropriate directory. However, startup.sh does not start the
server apparently; I cannot connect to it from a browser, and I get the
error I posted when I try to use shutdown.sh.

There's obviously something I missed. Do I need to edit some files or
something?

Thanks a lot,
Dan

On Mon, 2007-02-19 at 17:11, Hassan Schroeder wrote:
 On 2/19/07, Daniel Gresh [EMAIL PROTECTED] wrote:
 
  I've been following the installation instructions in RUNNING.txt.
  Basically, it tells me to download the binary distribution, unpack it,
  make sure JDK1.5 or greater is installed, and run the server. I also need 
  to set up a CATALINA_BASE,
 
 No, you don't. Until you've gotten the basic installation down, stay out
 of the advanced configuration section. :-)
 
 If you follow *exactly* the steps before that, it should just work. If it
 doesn't, e.g., you're still getting a connection failed error, check to
 see whether the process is running or not. If not, check the logs, and
 if so, check for firewall/iptables/whatever problems.
 
 Good luck,
 -- 
 Hassan Schroeder  [EMAIL PROTECTED]
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


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



Re: Installing Tomcat 6.0.9 on Sun Solaris

2007-02-19 Thread Hassan Schroeder

On 2/19/07, Daniel Gresh [EMAIL PROTECTED] wrote:


However, startup.sh does not start the
server apparently; I cannot connect to it from a browser


You need to look in your server logs for the underlying problem that's
preventing Tomcat from starting.

--
Hassan Schroeder  [EMAIL PROTECTED]

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



RE: Installing Tomcat 6.0.9 on Sun Solaris

2007-02-19 Thread Caldarale, Charles R
 From: Daniel Gresh [mailto:[EMAIL PROTECTED] 
 Subject: Re: Installing Tomcat 6.0.9 on Sun Solaris
 
 When I try to setup a $CATALINA_BASE by moving the
 aforementioned directories to $HOME/dtomcat, I get
 the error I posted in my original message. 

The real question is:  why are you trying to do this?  Unless you intend
to run multiple instances of Tomcat simultaneously, the exercise is
pointless.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



RE: Re: HOW TO turn on client Certificate with pop choose a digital certificate window

2007-02-19 Thread Zhan, Jimmy
Hi,
   Thanks!
   Could you give me some more detail information? Such as sample config
file, code or links. 

Jimmy ZHAN

-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker
Sent: Friday, February 16, 2007 7:59 PM
To: users@tomcat.apache.org
Subject: Re: HOW TO turn on client Certificate with pop choose a
digital certificate window

I can see two ways to do this:
1) Tomcat-Specific:  Use clientAuth=want on the Connector, and
configure 
the webapp to use BASIC auth in web.xml.  You then add a Valve that
looks 
for the cert, and authenticates the user based on the cert if possible.
2) Similar in that you still have clientAuth=want, but you have a
Filter 
in your webapp that looks for the cert, and if it doesn't find it it
returns 
a proper 401 response asking for Basic auth.  While this is portable
across 
containers, it has the downside that it doesn't allow you to use 
container-managed security (e.g. security-constraint).

Zhan, Jimmy [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Hi,
   I have set up HTTPS for tomcat without client certificate, and it is
running good.  Now I want to turn on the client certificate.
   How can to config the tomcat, let pop a Choose a digital
certificate window, allow clients pick Choose a digital certificate,
   If failed , pop a new window to allow user input User Name and
Password.
   In file servrer.xml ,  if change clientAuth=true, then when client
is not in the truststoreFile,
The page cannot be display comes out.
  If change clientAuth=want, then, tomcat ignores the result of
checking client certificate.
  Thanks in advance!!
Jimmy ZHAN
Cash America International
-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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



RE: HOW TO turn on client Certificate with pop choose a digital certificate window

2007-02-19 Thread Zhan, Jimmy
Hi,

  But why it doesn't work in that way.

  I use IE 6. and only change value of clientAuth. False/want, tomcat
works, 
  set clientAuth=true,
  The page cannot be display comes out.
  
 Must I missing some thing! More idea?

  Thanks

Jimmy

-Original Message-
From: Pulkit Singhal [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 16, 2007 4:24 PM
To: Tomcat Users List
Subject: Re: HOW TO turn on client Certificate with pop choose a
digital certificate window

For IE if you try to go to a https URL directly that requires Client
Authn,
IE itself will pop u a winddow.

On 2/15/07, Zhan, Jimmy [EMAIL PROTECTED] wrote:

 Hi,
I have set up HTTPS for tomcat without client certificate, and it
is
 running good.  Now I want to turn on the client certificate.
How can to config the tomcat, let pop a Choose a digital
 certificate window, allow clients pick Choose a digital certificate,
If failed , pop a new window to allow user input User Name and
 Password.
In file servrer.xml ,  if change clientAuth=true, then when
client
 is not in the truststoreFile,

 The page cannot be display comes out.
   If change clientAuth=want, then, tomcat ignores the result of
 checking client certificate.
   Thanks in advance!!
 Jimmy ZHAN
 Cash America International

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



Re: request.getParameter() in JSP misinterpreting foreign characters

2007-02-19 Thread Mark Thomas
Ramez Ghazzaoui wrote:
 Is there a way to make French characters work both in Directory Listings
 and in GET parameters?

All your pages need to include the following at the start:
%@ page pageEncoding=UTF-8 %

The correct UTF-8 encoding for your request is:
http://localhost/main.jsp?path=ol%C3%A9

HTH,

Mark


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



Re: request.getParameter() in JSP misinterpreting foreign characters

2007-02-19 Thread Markus Schönhaber
Ramez Ghazzaoui wrote:

 Today I realized that this very solution has broken the Java
 request.getParameter() method in JSP. Now, with the URIEncoding set to
 UTF-8, this Java method is misinterpreting non-English characters. When
 I invoke from the browser the following address:
 http://localhost/main.jsp?path=olé (or the equivalent
 http://localhost/main.jsp?path=ol%E9) a call to
 request.getParameter(path) from within main.jsp returns ol? where the
 question mark is character number 65533. That's way off from 233 (which
 is the correct U-dec for eacute, or é).

If you tell Tomcat that you'll provide URIs which are encoded in UTF-8 then do 
as you said and provide UTF-8-encoded URIs. Your example above should 
therefore look like
http://localhost/main.jsp?path=ol%C3%A9

If you're using HTML-forms with method=GET, set the accept-charset attribute 
of the form to UTF-8.

 Is there a way to make French characters work both in Directory Listings
 and in GET parameters?

Yes. See above.

Regards
  mks

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



Problem seting up Tomcat SSL

2007-02-19 Thread Anthony Liu
Hi, people,

It's been 3 years since I used Tomcat the last time.  When I return to it these 
days, I am having a hard time getting the SSL to work.

I've created a keystore using keytool and put the .keystore file under 
C:\Tomcat_6\conf\

I am using JRE 6.

After I read the on-line doc, I put this in the server.xml:


-- Define a non-blocking Java SSL Coyote HTTP/1.1 Connector on port 8443 --

Connector protocol=org.apache.coyote.http11.Http11NioProtocol
   port=8443 minSpareThreads=5 maxSpareThreads=75
   enableLookups=true disableUploadTimeout=true 
   acceptCount=100  maxThreads=200
   scheme=https secure=true SSLEnabled=true
   keystoreFile=C:/Tomcat_6/conf/.keystore keystorePass=changeit
   clientAuth=false sslProtocol=TLS/

Turning the SSLEngine on or off makes no difference.

  !--APR library loader. Documentation at /docs/apr.html --
  Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on /

So, what's going on?  What I am missing?

By the way, I am not sure what is APR, and I did not install native libraries 
at Tomcat Installation.

Thanks.

 
-
TV dinner still cooling?
Check out Tonight's Picks on Yahoo! TV.

Found a product for running Tomcat off CDROM -have anybody tried it?

2007-02-19 Thread David Wishnie

Hello,

I've found a product on freshmeat.net that allows to run tomcat-based
websites off cdrom, allowing to produce
CDs that work on Windows, MacOS X and Linux at the same time (also it seems
to support perl,
python, php  mysql). Apache is used for serving static content, and it has
a nice support
for stopping everything and releasing the media.

   http://www.stunnix.com/prod/aws/overview.shtml

Have anybody tried it?

Seems useful..

Thanks for your input!
 David


Re: request.getParameter() in JSP misinterpreting foreign characters

2007-02-19 Thread Ramez Ghazzaoui
Thank you guys. Sounds like I need to either write or find a method that 
converts strings to UTF-8. I'll try this tomorrow.


BTW I am not using HTML forms, just building URIs dynamically and 
sticking them into a href=... anchors. That's where the GET part comes 
into play :)


Cheers,

-Ramez

Markus Schönhaber wrote:

Ramez Ghazzaoui wrote:

  

Today I realized that this very solution has broken the Java
request.getParameter() method in JSP. Now, with the URIEncoding set to
UTF-8, this Java method is misinterpreting non-English characters. When
I invoke from the browser the following address:
http://localhost/main.jsp?path=olé (or the equivalent
http://localhost/main.jsp?path=ol%E9) a call to
request.getParameter(path) from within main.jsp returns ol? where the
question mark is character number 65533. That's way off from 233 (which
is the correct U-dec for eacute, or é).



If you tell Tomcat that you'll provide URIs which are encoded in UTF-8 then do 
as you said and provide UTF-8-encoded URIs. Your example above should 
therefore look like

http://localhost/main.jsp?path=ol%C3%A9

If you're using HTML-forms with method=GET, set the accept-charset attribute 
of the form to UTF-8.
  
  


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