Re: SSL error when invoking web service

2008-01-23 Thread Rizwan Merchant


Thanks for the response.
The client can be any one who wants to post an XML message to this URL. 
So you could create an xml message and post the request using https.
Not sure why the client would need to 'add' this certificate. We have 
written code to connect to many such web services and we never need to 
add certificates from the server we are connecting to? For example, if 
we need to use Fedex's API service, we need to send the request using 
https, but we have never added any certificates from them on our server.




Bill Barker wrote:
Rizwan Merchant [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
  

Hi,

We have a web based application running on Tomcat 6. The server.xml file
is configured so that the application can handle incoming https requests
on port 443 (default). When a user hits the URL http://www.mydomain.com,
it automatically redirects to https://www.mydomain.com (due to security
constraint set up in web.xml).

We also have a web service running which is invoked by posting the
request message to http://www.mydomain.com/rpc2
I am trying to enforce ssl on this service as well, but when a message
is posted to https://www.mydomain.com/rpc2 (secure using https
protocol), the client is seeing the following error:
(Posting the message to http://www.mydomain.com/rpc2 works fine)

*Error 60:SSL certificate problem, verify that the CA cert is OK.
Details: error:14090086:SSL
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed*




You didn't say what the client is so I can't offer much on how to fix it. 
But the error is saying that the client couldn't find the CA certificate 
that signed your Tomcat server certificate in it's list of trusted CAs.  As 
a result, the client correctly desides not to trust your Tomcat server.


You need to add the CA certificate to the client's trusted certificate list, 
as explained in the documentation for the client (but probably cacerts.pem).


  

Basically, the https is working fine on the website, but not for the web
service (which, from what I understand, is being handled by a separate
servlet, rpc2).

Any ideas please?

Thanks,
-Rizwan Merchant.











  

-
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]

SSL error when invoking web service

2008-01-22 Thread Rizwan Merchant


Hi,

We have a web based application running on Tomcat 6. The server.xml file 
is configured so that the application can handle incoming https requests 
on port 443 (default). When a user hits the URL http://www.mydomain.com, 
it automatically redirects to https://www.mydomain.com (due to security 
constraint set up in web.xml).


We also have a web service running which is invoked by posting the 
request message to http://www.mydomain.com/rpc2
I am trying to enforce ssl on this service as well, but when a message 
is posted to https://www.mydomain.com/rpc2 (secure using https 
protocol), the client is seeing the following error:

(Posting the message to http://www.mydomain.com/rpc2 works fine)

*Error 60:SSL certificate problem, verify that the CA cert is OK. 
Details: error:14090086:SSL 
routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed*


Basically, the https is working fine on the website, but not for the web 
service (which, from what I understand, is being handled by a separate 
servlet, rpc2).


Any ideas please?

Thanks,
-Rizwan Merchant.



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

Listing of sessions fails in web application manager

2007-11-21 Thread Rizwan Merchant


Hi,
We just upgraded from tomcat 5.5.20 to tomcat 6.0. When I access the 
manager page ( http://{ip_address}/manager/html), I can see the apps 
listed and corresponding session counts for each app. But when I click 
on the session count for my app, I get an error as below..


*Message:* 


FAIL - Encountered exception org.apache.jasper.JasperException: 
javax.servlet.ServletException: java.lang.StackOverflowError


Any  ideas why this might be happening?

Thanks for the help.

-Rizwan Merchant.


-
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: Listing of sessions fails in web application manager

2007-11-21 Thread Rizwan Merchant

Here is the platform and jvm information.
Tomcat Version 	JVM Version 	JVM Vendor 	OS Name 	OS Version 	OS 
Architecture
Apache Tomcat/6.0.14 	1.6.0_02-b05 	Sun Microsystems Inc. 	Linux 
2.6.18-1.2798.fc6 	i386



Tomcat is downloaded from apache site.

We use a service script to start tomcat (shown below)

JAVA_HOME=/usr/local/java
CATALINA_HOME=/home/myapp/tomcat
TOMCAT_USER=myapp

# for multi instances adapt those lines.
TMP_DIR=/var/tmp
PID_FILE=/var/run/jsvc-myapp.pid
CATALINA_BASE=$CATALINA_HOME

source /home/myapp/.bash_profile
#CATALINA_OPTS=-Djava.library.path=/home/jfclere/jakarta-tomcat-connectors/jni/native/.libs 
-Xmx1000m

CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar:\
$CATALINA_HOME/bin/commons-logging-api.jar

case $1 in
 start)
   #
   # Start Tomcat
   #
   $CATALINA_HOME/bin/jsvc \
   -user $TOMCAT_USER \
   -home $JAVA_HOME \
   -Dcatalina.home=$CATALINA_HOME \
   -Dcatalina.base=$CATALINA_BASE \
   -Djava.io.tmpdir=$TMP_DIR \
   -wait 10 \
   -pidfile $PID_FILE \
   -outfile $CATALINA_HOME/logs/catalina.out \
   -errfile '1' \
   $CATALINA_OPTS \
   -cp $CLASSPATH \
   org.apache.catalina.startup.Bootstrap
   #
   # To get a verbose JVM
   #-verbose \
   # To get a debug of jsvc.
   #-debug \
   exit $?
   ;;



Caldarale, Charles R wrote:
From: Rizwan Merchant [mailto:[EMAIL PROTECTED] 
Subject: Listing of sessions fails in web application manager


But when I click on the session count for my app, I get an error as


below..
  
*Message:* 
FAIL - Encountered exception 
org.apache.jasper.JasperException: 
javax.servlet.ServletException: java.lang.StackOverflowError



Works fine for me on two different platforms (WinXP and proprietary)
with both JRE 1.5 and 1.6, no special heap or stack settings.

What platform and JVM are you using?  Is your Tomcat downloaded from
tomcat.apache.org, or do you have some 3rd-party repackaged version?
Have you set any command line parameters for the JVM?

 - 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]


  


-
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: Listing of sessions fails in web application manager

2007-11-21 Thread Rizwan Merchant


I will have to shut down production and restart to see what happens if I 
use the normal start up scripts.


But I also noticed another thing. Sometimes when I click on the session 
count, I get the same page back with the exception error. Other times, I 
get a page with some of the session details and then a page below it 
with the error. Not all the sessions show up (my count says 120 but only 
around 10 are showing up).


Caldarale, Charles R wrote:
From: Rizwan Merchant [mailto:[EMAIL PROTECTED] 
Subject: Re: Listing of sessions fails in web application manager


Here is the platform and jvm information.
Tomcat is downloaded from apache site.



That all looks good.

  

CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar:\
$CATALINA_HOME/bin/commons-logging-api.jar



The above is a bit troublesome.  The only thing normally needed for
Tomcat 6.0 on the -cp line is bootstrap.jar; why do you have all the
others?  This probably isn't the cause of the problem, but it's worth
clearing up to avoid confusion.

What happens if you run Tomcat with the normal startup.sh or catalina.sh
scripts?

 - 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]


  


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

Access Valve

2007-10-31 Thread Rizwan Merchant


Hi,
I am trying to set up the access valve so that we can analyze our 
traffic using the softwares that are out there.
I noticed that when I turn on the access valve, it logs requests for 
every little item on the page, all the images etc. Is there a way I can 
have tomcat log only one line for every session? Or is there a way to 
exclude requests made for images and certain other types of files?


Thanks,
-Rizwan Merchant.

-
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: Access Valve

2007-10-31 Thread Rizwan Merchant


Thanks Chris,
Does that mean that I need to set the value of an attribute in my code, 
and check that value in the valve? That seems intrusive as I have to set 
up my code to handle this.


Let me step back a little. Can you tell me..what if I leave it the way 
it is and let it log everything. Would this slow down the application 
since it will be doing a LOT of writing to the access log file? Or am I 
worrying too much about this?
My main reason to log less is so that tomcat is not bogged down because 
of how much it is writing to the access log..


Thanks,
-Riz.

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rizwan,

Rizwan Merchant wrote:
  

Hi,
I am trying to set up the access valve so that we can analyze our
traffic using the softwares that are out there.
I noticed that when I turn on the access valve, it logs requests for
every little item on the page, all the images etc. Is there a way I can
have tomcat log only one line for every session?



One line for every session? Or one line for the first request processed
by a keepalive connection?

  

Or is there a way to
exclude requests made for images and certain other types of files?



It looks like the only way to do either of these things is to use the
condition attribute of the valve. Check out the docs for that
attribute -- it might give you some ideas.

http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHKPV+9CaO5/Lv0PARAg9UAKC6jZzhQ4+Mqj7ZiE4ln8RaQC9CYACggx1B
RMYXs+J0ZSoFYXdGKxZkU9A=
=xCzU
-END PGP SIGNATURE-

-
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 clustering and nightly processes

2007-07-26 Thread Rizwan Merchant


Hi,
We have a server in production currently and are thinking about 
implementing clustering to achieve load balancing and scalability.

Currently we have some processes that run nightly, for example

1. Users upload files that are processed later at night.
2. order updates (we retrieve all orders from db to determine if they 
have been delivered using Fedex's web service, etc).
3. Manifest submissions - generate a report from the orders of the day 
to submit to various companies via FTP


The above are just some examples. As you can see, we have a fair amount 
of stuff going on in the background during off peak hours.


My question is this. Once we implement clustering, how can the above be 
handled. The above processes cannot be running on all instances of the 
tomcat servers. For example, if a file is uploaded for processing later, 
then that file should be processed only once, but as many times as there 
are server instances (since they are all running same copies of the 
application code).


I hope my concern makes sense, and would appreciate some insight into 
this before we consider this cluster implementation further.


Thanks,
-Rizwan Merchant.

-
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: JSP Reload problem (wierd)

2006-12-24 Thread Rizwan

Hi,

This is usually a problem with IE, it caches your pages for you. This might 
be the reason.
Try doing the same in some other browser. (Firefox usually doesnt cache the 
pages.)


If u still have the problem in other browsers, you might have to enable 
autoreload in tomcat to recomplie jsps or reload classes whenever

there is a change to the file.

Hope this helps.

Rizwan.

- Original Message - 
From: Mon Cab [EMAIL PROTECTED]

To: Tomcat Usergroup users@tomcat.apache.org
Sent: Monday, December 25, 2006 12:26 PM
Subject: JSP Reload problem (wierd)



I am using WinSCP to open and edit jsp's on my remote Tomcat server.  I
open the file from the server to edit and add a hello world into the
Login jsp.  Then I request the page in IE 6 and it loads the page and
hello world is displayed.  The page loads within a second (is this
enough time for a jsp to compile ??!).

Then I edit the file in WinSCP again to remove the hello world from
the login jsp, and I click on ctrl + refresh in IE6.  The login page
reloads almost immediately and hello world is still displaying.  I hit
ctrl refresh over and over, and cant get rid of hello world.  I check
Login.jsp on the server ant hello world is definitely not in there.


I go into the work directory
tomcat5.0/work/Catalina/localhost/myWebapp and notice that the
Login_jsp.java file is 3 hours old.  I delete this as well as the
Login_jsp.class file.  I try reload the page (ctrl +refresh).  Hello
world is still displaying.

I look in the work folder.  No new Login_jsp.java file, and no new
Login_jsp.class file.

I add aagh into the Login.jsp file.  Hit reload in explorer and
aagh displays.  But there is still no new Login_jsp.java file,
and no new Login_jsp.class file

If I rename the file to Login1.jsp and then click on reload in IE6,
after the third attempt Tomcat realizes there's no JSP file and logs an
error in catalina.log.  Then if I rename the Login.jsp back to
Login.jsp, tomcat reloads the file and displays it correctly.

What is going on??  I feel like I'm in the Twilight zone.





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

-
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]



Context problem in tomcat 5.5

2006-12-05 Thread Rizwan Ahmad

Hi,

I am new to tomcat. I just installed tomcat 5.5 on my machine having windows
XP platform. I am trying to deploy a war file naming samena.war where
samena is the context name. When I startup tomcat it automatically unpacks
war file but when I try to access my website using
http://localhost:8080/samena/ it says *The requested resource (/samena/) is
not available.*

I also don't find any context name specified anywhere for
http://localhost:8080/servlets-examples/ provided with the tomcat.

I am also attaching my web.xml file so that it can help you in suggesting a
solution to me.

Thanks in advance.

Rizwan Ahmad
?xml version = '1.0' encoding = 'windows-1252'?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
  descriptionEmpty web.xml file for Web Application/description
  servlet
servlet-nameCompanyController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.CompanyController/servlet-class
  /servlet
  servlet
servlet-nameCategoryController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.CategoryController/servlet-class
  /servlet
  servlet
servlet-nameServlet1/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.Servlet1/servlet-class
  /servlet
  servlet
servlet-nameContactController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.ContactController/servlet-class
  /servlet
  servlet
servlet-nameCountryController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.CountryController/servlet-class
  /servlet
  servlet
servlet-nameDeptController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.DeptController/servlet-class
  /servlet
  servlet
servlet-nameRegionController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.RegionController/servlet-class
  /servlet
  servlet
servlet-nameLoginController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.LoginController/servlet-class
  /servlet
  servlet
servlet-nameCompanyController1/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.CompanyController1/servlet-class
  /servlet
  servlet
servlet-nameActivityController/servlet-name
servlet-classcom.teralight.samena.activity.controller.ActivityController/servlet-class
  /servlet
  servlet
servlet-nameCommitteeController/servlet-name
servlet-classcom.teralight.samena.committee.controller.CommitteeController/servlet-class
  /servlet
  servlet
servlet-nameJoinController/servlet-name
servlet-classcom.teralight.samena.committee.controller.JoinController/servlet-class
  /servlet
  servlet
servlet-nameCommitteeMemberController/servlet-name
servlet-classcom.teralight.samena.committee.controller.CommitteeMemberController/servlet-class
  /servlet
  servlet
servlet-nameEmailController/servlet-name
servlet-classcom.teralight.samena.activity.controller.EmailController/servlet-class
  /servlet
  servlet
servlet-nameRegistrationController/servlet-name
servlet-classcom.teralight.samena.crm.membership.controller.RegistrationController/servlet-class
  /servlet
  servlet
servlet-namePaymentController/servlet-name
servlet-classcom.teralight.samena.crm.membership.controller.PaymentController/servlet-class
  /servlet
  servlet
servlet-nameMembersStatusController/servlet-name
servlet-classcom.teralight.samena.crm.membership.controller.MembersStatusController/servlet-class
  /servlet
  servlet
servlet-nameSearchController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.SearchController/servlet-class
  /servlet
  servlet
servlet-nameContactUsController/servlet-name
servlet-classcom.teralight.samena.general.controller.ContactUsController/servlet-class
  /servlet
  servlet
servlet-nameCareerController/servlet-name
servlet-classcom.teralight.samena.general.controller.CareerController/servlet-class
  /servlet
  servlet
servlet-nameEventController/servlet-name
servlet-classcom.teralight.samena.events.controller.EventController/servlet-class
  /servlet
  servlet
servlet-nameContactRightsController/servlet-name
servlet-classcom.teralight.samena.general.controller.ContactRightsController/servlet-class
  /servlet
  servlet
servlet-nameUploadController/servlet-name
servlet-classcom.teralight.samena.crm.membership.controller.UploadController/servlet-class
  /servlet
  servlet
servlet-nameContactGroupController/servlet-name
servlet-classcom.teralight.samena.crm.contact.controller.ContactGroupController/servlet-class
  /servlet
  session-config
session-timeout30/session-timeout
  /session-config
  mime-mapping
extensionhtml/extension
mime-typetext/html/mime-type
  /mime-mapping
  mime-mapping
extensiontxt/extension
mime-typetext/plain/mime-type
  /mime-mapping
/web

monitoring open connections to tomcat

2006-11-14 Thread Rizwan Merchant


Hi,
We are running a couple of webapps on the same tomcat instance. We are 
using apache web server along with the mod_jk connector to forward 
requests to tomcat.


A couple of weeks ago we had a situation where the tomcat process ran 
out of file connections (we got an error of the sort too many open 
files). I dont have the exact error on me, but as per our developer, as 
a security measure linux restricts the number of connections (files, 
sockets, etc) a process can use and the default is 1024.


The number of open connections can be viewed using the command
lsof -p pid

We had to restart the server at that point, and have been monitoring 
this ever since. I now see that the number is creeping up again, and I 
have noticed many entries of the following type
jsvc26517 tomcat   90u  sock0,56921708 can't 
identify protocol


Can anyone identify what this can't identify protocol means? There are 
quite a few of them and I am wondering if this is causing the problem 
when the server is running for a while.


Any help would be appreciated.

Thanks,
-Riz.


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



Session count in tomcat manager

2006-10-12 Thread Rizwan Merchant


Hi,
I am using tomcat 5.5.15 to host 2 applications (2 contexts). I am 
trying to figure out how to monitor the application statistics using the 
tomcat manager.


I noticed that when I restart the tomcat server the Active Sessions 
count for one of the applications remains the same as it was before the 
server was shut down. Does this make sense? I should add that we are 
using mod_jk to forward requests from apache web server to tomcat. Does 
it sound like the sessions are hanging around when they actually 
shouldnt? the other counts are resetting correctly, just the active 
session that stays the same.


Below is the stats from the app I am referring to. The stats are right 
after start up of tomcat. Is this normal, or do I need to look into this 
further?


Thanks,
-Riz.

Start time: Thu Oct 12 02:33:55 EDT 2006 Startup time: 4 ms TLD scan 
time: 0 ms
Active sessions: 81 Session count: 0 Max active sessions: 0 Rejected 
session creations: 0 Expired sessions: 0 Longest session alive time: 0 s 
Average session alive time: 0 s Processing time: 0 ms

JSPs loaded: 0 JSPs reloaded: 0

-
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: jvm thread dump

2006-10-12 Thread Rizwan Merchant


Thanks Chris. You have been very helpful. I will implement your 
recommendations and see what happens.
Quick question, when you look at a thread dump, how do you tell which 
threads are idle?


Also, any inputs on my other postings regarding the session count and 
catalina.out logging?


http://mail-archives.apache.org/mod_mbox/tomcat-users/200610.mbox/[EMAIL 
PROTECTED]

http://mail-archives.apache.org/mod_mbox/tomcat-users/200610.mbox/[EMAIL 
PROTECTED]

Thanks again,
-Riz.

Christopher Schultz wrote:

Riz,

  

here is the thread dump from when the app hung.
Any insights?



Well, a quick run-through of the thread dump suggests that your DBCP was
definitely stalled for some reason.

I counted about 70 idle threads, about 30 threads waiting on database
connections, and maybe 15 doing other things (handling requests,
accepting socket connections, running Telnet (wtf?) and a few threads
doing SMTP. There were also a few Quartz threads running, which I
assume were performing some kind of batch operations or something. Most
of them were either idle of sending email messages. Maybe one of two
were hung in the DBCP wait like the others.

Note that not all of your threads were hung while trying to
authenticate. That probably means that some of your users had
authenticated before your connection pool dried up, and were trying to
do other things.

I'm guessing that you have a connection leak, somewhere. Do you always
use Spring to manage your connections, or do you sometimes get a
connection using the DBCP directly?

I'm asking because it's more likely that you have a connection leak in
/your/ code than there is a connection leak in Spring (no offense ;).
Check for the places where you handle JDBC connections yourself and make
sure that you are following all the rules:

1. Make sure you close your statements, result sets, and connection
   objects in a finally block.
2. Make sure that you surround everything from #1 in try/catch blocks
   and LOG ALL EXCEPTIONS.

Here are some helpful suggestions above and beyond the above rules:

1. Make sure that you catch all possible exceptions (potentially
   re-throwing them) and rollback if you are inside a transaction.
2. Turn on abandoned connection logging in development (and production
   if you can afford it). There's nothing better than empirical evidence
   to help you solve problems. The performance hit you take by turning
   on this debugging information is well worth it compared to server
   downtime due to connection pool exhaustion.
3. Set your connection pool size in development to a fixed size of 1
   (yes, that's ONE). This will help you find connection leakages ASAP,
   since the first time it happens, you're screwed right away.
   If you have only one place in your code where connections are leaked,
   it may take a long time to exhaust a connection pool containing 50
   connections. If you drop it down to 1, you'll know right away ;)

Lastly, you should ask on the Spring list if there are any known
connection leaks in your version of Spring (you are not likely to get a
warm response to that question, but it needs to be asked), but only
after you have audited your own code.

-chris


  


-
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: jvm thread dump

2006-10-12 Thread Rizwan Merchant


Chris,
I cant thank you enough for all your help. If only there was a rating 
system on this forum! ;)


thing is, I am not using ant System.out commands in my app. I have log4j 
set up in the app which is logging to a different log file that rolls 
nightly.
But I am seeing the same log messages (info level from the application) 
being dumped into catalina.out, so these are definitely not System.out 
logs.

any idea how to turn off logging these log4j messages to catalina.out?
I do have a log4j.properties file in CATALINA_HOME/common/classes 
(attached for your reference). Other than that, I do not know how the 
log messages are ending up in catalina.out


thanks,
-Riz.


#
# Configures Log4j as the Tomcat system logger
#

#
# Configure the logger to output info level messages into a rolling log file.
#
#log4j.rootLogger=INFO, R

#
# To continue using the catalina.out file (which grows forever),
# comment out the above line and uncomment the next.
#
log4j.rootLogger=ERROR, A1

#
# Configuration for standard output (catalina.out).
#
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
#
# Print the date in ISO 8601 format
#
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#
# Configuration for a rolling log file (tomcat.log).
#
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.DatePattern='.'-MM-dd
#
# Edit the next line to point to your logs directory.
# The last part of the name is the log file name.
#
log4j.appender.R.File=/usr/local/tomcat/logs/tomcat.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
#
# Print the date in ISO 8601 format
#
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#
# Application logging options
#
#log4j.logger.org.apache=DEBUG
#log4j.logger.org.apache=INFO
#log4j.logger.org.apache.struts=DEBUG
#log4j.logger.org.apache.struts=INFO



You can't roll catalina.out. I read that thread, and the response you
got that said don't log to stdout was right: just don't do it. Since
you are using log4j already, have log4j log to a different log file that
/does/ roll. You shoudln't have any System.out or System.err usage in
your webapp.

  

http://mail-archives.apache.org/mod_mbox/tomcat-users/200610.mbox/[EMAIL 
PROTECTED]



I'll answer this one separately. Look for a followup post.

-chris


  


-
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: catalina.out not rolling

2006-10-11 Thread Rizwan Merchant


Thanks for the response.
So how do I stop tomcat from logging to catalina.out and into a 
different file?
Basically I want to send all tomcat output to a file that can roll on a 
daily basis.

Any ideas or examples?

Thanks,
-Riz.

David Smith wrote:
Catalina.out is the redirected standard output (Console output in 
log4j parlance) of tomcat.  I don't think you can roll it in log4j.  
Best bet is to steer as much logging as possible away from 
catalina.out into a file logger you can roll.


--David

Rizwan Merchant wrote:



Hi,
We are trying to use log4j to roll the catalina.out file on a daily 
basis. The attached log4j.properties file has been placed in the 
CATALINA_HOME/common/classes directory. But the file does not roll over.


Please help. catalina file is getting long.

Thanks,
-Riz.



#
# Configures Log4j as the Tomcat system logger
#

#
# Configure the logger to output info level messages into a rolling 
log file.

#
#log4j.rootLogger=INFO, R

#
# To continue using the catalina.out file (which grows forever),
# comment out the above line and uncomment the next.
#
log4j.rootLogger=INFO, A1

#
# Configuration for standard output (catalina.out).
#
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
#
# Print the date in ISO 8601 format
#
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#
# Configuration for a rolling log file (tomcat.log).
#
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.DatePattern='.'-MM-dd
#
# Edit the next line to point to your logs directory.
# The last part of the name is the log file name.
#
log4j.appender.R.File=/usr/local/tomcat/logs/tomcat.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
#
# Print the date in ISO 8601 format
#
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#
# Application logging options
#
#log4j.logger.org.apache=DEBUG
#log4j.logger.org.apache=INFO
#log4j.logger.org.apache.struts=DEBUG
#log4j.logger.org.apache.struts=INFO

 




-
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]



Re: jvm thread dump

2006-10-10 Thread Rizwan Merchant


Thanks for the response Chris.
Actually, we had a bit of a situation yesterday, it seems the threads 
were all locked up and/or the db connection pool was not handing out 
connections. I am not sure what happened and have been monitoring the 
threads ever since.


Below are some threads from the dump when the above problem happened. I 
have no idea what caused the problem, I do know that the mail server I 
was trying to connect to was flaky, that would explain thread 
http-443-Processor75 but I have no clue why the dbcp connection 
pooling failed.


Chris, are you familiar with Spring at all? Would you be able to answer 
a few questions for me on this subject (we can take the topic offline as 
it is not relevant here).


Thanks for your help. Appreciate it.

-Riz.

http-443-Processor75 daemon prio=1 tid=0x09fbc620 nid=0x330a runnable 
[0x07d76000..0x07d790c0]

   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:129)
   at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:79)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
   - locked 0x5cd7e218 (a java.io.BufferedInputStream)
   at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:57)
   at 
com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1327)

   at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1191)
   at 
com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:311)

   at javax.mail.Service.connect(Service.java:233)
   at 
org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:373)
   at 
org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:326)
   at 
org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:322)
   at 
com.cwsi.eshipper.service.impl.EmailManagerImpl.sendMessageWithAttachments(EmailManagerImpl.java:209)
   at 
com.cwsi.eshipper.service.impl.EmailManagerImpl.onChargeCard(EmailManagerImpl.java:277)
   at 
com.cwsi.eshipper.service.impl.CCTransactionManagerImpl.emailReceipt(CCTransactionManagerImpl.java:435)
   at 
com.cwsi.eshipper.service.impl.CCTransactionManagerImpl.processPostAuth(CCTransactionManagerImpl.java:246)

   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:585)
   at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
   at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
   at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
   at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)

   at $Proxy10.processPostAuth(Unknown Source)
   at 
com.cwsi.eshipper.service.impl.CarrierServiceManagerImpl.shipOrder(CarrierServiceManagerImpl.java:262)

   at sun.reflect.GeneratedMethodAccessor462.invoke(Unknown Source)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:585)
   at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
   at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
   at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
   at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)

   at $Proxy19.shipOrder(Unknown Source)
   at 
com.cwsi.eshipper.web.OrderManagerAction.save_internal(OrderManagerAction.java:456)
   at 
com.cwsi.eshipper.web.OrderManagerAction.save(OrderManagerAction.java:1439)

   at sun.reflect.GeneratedMethodAccessor2710.invoke(Unknown Source)
   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:585)
   at 
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
   at 
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
   at 

Re: jvm thread dump

2006-10-10 Thread Rizwan Merchant


Appreciate all your help.
Basically, we could not log into the system at all (which sounded like 
the app could not get a connection to the db to authenticate my user 
name and password). I had someone else try to log in, but he could not 
either.


Here are our tomcat and dbcp settings. We are using hibernate and spring 
to configure the settings...


   Connector port=8080 maxHttpHeaderSize=8192
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false redirectPort=443 acceptCount=100
  connectionTimeout=2 disableUploadTimeout=true /
 


   !-- Define a SSL HTTP/1.1 Connector on port 443 --

   Connector port=443 maxHttpHeaderSize=8192
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false disableUploadTimeout=true
  acceptCount=100 scheme=https secure=true
  clientAuth=false sslProtocol=TLS 
keystoreFile=** keystorePass=** /



   !-- Define an AJP 1.3 Connector on port 8009 --
   Connector port=8009
  enableLookups=false redirectPort=443 
protocol=AJP/1.3 /


   !-- Define a Proxied HTTP/1.1 Connector on port 8082 --
   !-- See proxy documentation for more information about using this. --
   !--
   Connector port=8082
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false acceptCount=100 
connectionTimeout=2

  proxyPort=80 disableUploadTimeout=true /
   --

DBCP settings using Spring's applicationContext...


   bean id=dataSource 
class=org.apache.commons.dbcp.BasicDataSource destroy-method=close
   property name=driverClassName 
value=${hibernate.connection.driver_class} /

   property name=url value=${hibernate.connection.url} /
   property name=username 
value=${hibernate.connection.username} /
   property name=password 
value=${hibernate.connection.password} /

   /bean
  


   !-- Hibernate SessionFactory --
   bean id=sessionFactory
   class=org.springframework.orm.hibernate3.LocalSessionFactoryBean
   property name=dataSource ref=dataSource /
  
   property name=mappingDirectoryLocations

   list
   valueclasspath:com/cwsi/eshipper/model/value
   
valueclasspath:com/cwsi/eshipper/carrier/purolator/model/value

   valueclasspath:com/cwsi/eshipper/carrier/cws/model/value
   /list
   /property
   property name=hibernateProperties
   props
   prop key=hibernate.dialect
   ${hibernate.dialect}
   /prop
   prop key=hibernate.show_sqlfalse/prop
   prop key=hibernate.generate_statisticstrue/prop
 prop key=hibernate.dbcp.maxActive30/prop
 prop key=hibernate.dbcp.whenExhaustedAction20/prop
prop key=hibernate.dbcp.maxWait1000/prop
prop key=hibernate.dbcp.maxIdle10/prop   
/props

   /property
   property name=eventListeners
   map
   entry key=merge
   bean 
class=org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener 
/

   /entry
   /map
   /property
   /bean


Christopher Schultz wrote:

Riz,

  

Actually, we had a bit of a situation yesterday, it seems the threads
were all locked up and/or the db connection pool was not handing out
connections. I am not sure what happened and have been monitoring the
threads ever since.



Well, there's yer problem ;)

  

Below are some threads from the dump when the above problem happened. I
have no idea what caused the problem, I do know that the mail server I
was trying to connect to was flaky, that would explain thread
http-443-Processor75 but I have no clue why the dbcp connection
pooling failed.



Hmm, let's take a look.

  

http-443-Processor75 daemon prio=1 tid=0x09fbc620 nid=0x330a runnable
[0x07d76000..0x07d790c0]
   at java.net.SocketInputStream.socketRead0(Native Method)
   at java.net.SocketInputStream.read(SocketInputStream.java:129)
   at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:79)
   at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
   at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
   - locked 0x5cd7e218 (a java.io.BufferedInputStream)
   at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:57)
   at
com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1327)



That looks like a perfectly reasonable thread dump. The thread is
runnable (i.e. not waiting for a lock) and in the method you expected
(something to do with SMTP). I don't see a problem, unless you observed
that particular thread taking forever or something like that.

For servlets that send email even semi-frequently, I usually recommend
dropping the email into a queue and having another thread do all of the
email sending. That frees your 

catalina.out not rolling

2006-10-10 Thread Rizwan Merchant


Hi,
We are trying to use log4j to roll the catalina.out file on a daily 
basis. The attached log4j.properties file has been placed in the 
CATALINA_HOME/common/classes directory. But the file does not roll over.


Please help. catalina file is getting long.

Thanks,
-Riz.
#
# Configures Log4j as the Tomcat system logger
#

#
# Configure the logger to output info level messages into a rolling log file.
#
#log4j.rootLogger=INFO, R

#
# To continue using the catalina.out file (which grows forever),
# comment out the above line and uncomment the next.
#
log4j.rootLogger=INFO, A1

#
# Configuration for standard output (catalina.out).
#
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
#
# Print the date in ISO 8601 format
#
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#
# Configuration for a rolling log file (tomcat.log).
#
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
log4j.appender.R.DatePattern='.'-MM-dd
#
# Edit the next line to point to your logs directory.
# The last part of the name is the log file name.
#
log4j.appender.R.File=/usr/local/tomcat/logs/tomcat.log
log4j.appender.R.layout=org.apache.log4j.PatternLayout
#
# Print the date in ISO 8601 format
#
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

#
# Application logging options
#
#log4j.logger.org.apache=DEBUG
#log4j.logger.org.apache=INFO
#log4j.logger.org.apache.struts=DEBUG
#log4j.logger.org.apache.struts=INFO

-
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: jvm thread dump

2006-10-10 Thread Rizwan Merchant


I had to restart tomcat, but I am not sure if there was a simpler way to 
solve the problem at that time.
There were threads that were waiting on loading user from db (for 
authentication), which explains why I couldnt login.
I can send the thread dump (of hen the problem occurred)  tomorrow from 
work..dont have it on me right now.
The settings I sent were on production. only the https threads will make 
connections to db.


You suggested setting the debug options. We are using BasicDataSource 
from apache dbcp for pooling, and the methods to set the debug options 
you mentioned have been deprecated. Would it be ok to set these values 
anyways?

Good idea to set the pool to 1 in development. Will try that.

Martin, I am using hibernate and spring to inject the datasource into 
the session factory bean. We did not set a maxActive value on the 
dataSource, but did on the hibernate properties. Any idea which value 
will be used (the default of the datasource, or the hibernate value)? 
The settings are shown below, can  you recommend ideal/better values?


Thanks,
-Riz.

   bean id=propertyConfigurer
   
class=org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

   property name=locations
   list
   value/WEB-INF/hibernate.properties/value
   value/WEB-INF/eshipper.properties/value
   /list
   /property
   /bean

   bean id=dataSource 
class=org.apache.commons.dbcp.BasicDataSource destroy-method=close
   property name=driverClassName 
value=${hibernate.connection.driver_class} /

   property name=url value=${hibernate.connection.url} /
   property name=username 
value=${hibernate.connection.username} /
   property name=password 
value=${hibernate.connection.password} /

   /bean
  


   !-- Hibernate SessionFactory --
   bean id=sessionFactory
   class=org.springframework.orm.hibernate3.LocalSessionFactoryBean
   property name=dataSource ref=dataSource /
  
   property name=mappingDirectoryLocations

   list
   valueclasspath:com/cwsi/eshipper/model/value
   
valueclasspath:com/cwsi/eshipper/carrier/purolator/model/value

   valueclasspath:com/cwsi/eshipper/carrier/cws/model/value
   /list
   /property
   property name=hibernateProperties
   props
   prop key=hibernate.dialect
   ${hibernate.dialect}
   /prop
   prop key=hibernate.show_sqlfalse/prop
   prop key=hibernate.generate_statisticstrue/prop
 prop key=hibernate.dbcp.maxActive30/prop
 prop key=hibernate.dbcp.whenExhaustedAction20/prop
prop 
key=hibernate.dbcp.maxWait${hibernate.connection.maxWait}/prop
prop key=hibernate.dbcp.maxIdle10/prop   
/props

   /property
   property name=eventListeners
   map
   entry key=merge
   bean 
class=org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener 
/

   /entry
   /map
   /property
   /bean


Christopher Schultz wrote:

Riz,

  

Basically, we could not log into the system at all (which sounded like
the app could not get a connection to the db to authenticate my user
name and password). I had someone else try to log in, but he could not
either.



That sounds like a wild guess at the problem. Your previous thread dump
only included 3 threads. How many were waiting on DBCP for a JDBC
connection? What did you have to do in order to get the server working
again? Re-start Tomcat? Bounce the database? OR, did it clear itself up
after a while.

Oh, and also: was this in your production or development environment?

  

   Connector port=8080 maxHttpHeaderSize=8192
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75




Note that you have 3 connectors (HTTP, HTTPS, and AJP13) and each of
them have a lot of potential threads in there. Your server will accept
as many as 150 + 150 + 150 connections simultaneously. If they all need
database connections, you're screwed, 'cause you only have between 10
and 30 (right?):

  

 prop key=hibernate.dbcp.maxActive30/prop
 prop key=hibernate.dbcp.whenExhaustedAction20/prop
prop key=hibernate.dbcp.maxWait1000/prop
prop key=hibernate.dbcp.maxIdle10/prop  




I'm not sure how to set it up using hibernate's wrapper around DBCP, but
I recommend setting the following debug options on the connection pool:

!-- Some debugging settings --
parameter
nameremoveAbandoned/name
valuetrue/value
/parameter
parameter
nameremoveAbandonedTimeout/name
value300/value
/parameter
parameter

tomcat manager security

2006-10-06 Thread Rizwan Merchant


Hi,
Can someone give me some insight into how secure the tomcat manager page 
is on a production application? Currently we have an application running 
on the production box, and we also have the manager running (password 
protected of course) so that we can access the tomcat status pages to 
determine the memory usage and thread information. Is this safe to run 
this manager, or should I be disabling this to avoid someone hacking the 
manager page and potentially creating havoc..


thanks,
-Riz.

-
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 memory usage questions

2006-10-03 Thread Rizwan Merchant

Hi,
We recently developed and deployed a web based application using the 
following technologies...


Struts
Spring
Hibernate 3.0
Mysql 5.0
tomcat 5.5
Linux Fedora Core 4

After the system went live, I have been monitoring the CPU and memory 
usages. I dread the outOfMemory errors and am a little paranoid about it.


There are 2 main processes I am monitoring, tomcat and mysqld.
The tomcat process memory usage is slowly creeping up...after 8 hours of 
application usage it is at 13.3% and the mysqld memory usage is at 1.3%.


I am wondering what kind of pattern I should be observing for the memory 
usages. Should it go up and then down again (like the CPU usage)? Or is 
it ok for it to slowly go up (the way it is doing right now)? The swap 
memory is not being used, so I am guessing thats a good thing.


Also, someone told me that hibernate and spring will try and cache 
everything it can, which could be the cause of the memory creeping up 
slowly. Is this true? and if it is, will this be a problem when the 
memory gets to a high number like 80 or 90% ?


Also, is there a way to tell if there are any processes spawned by 
tomcat that are hanging around uselessly?


Any help, ideas, tips would be appreciated. I am just concerned about 
having any memory issues with this LIVE application.


Thanks,
-Riz.

http://forum.springframework.org/newreply.php?do=newreplyp=79473

-
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 memory usage questions

2006-10-03 Thread Rizwan Merchant


Thanks for the response Robert.
Is it abnormal to see the mem usage % for tomcat to go as high as 80 or 
90%? Currently its only at 11%, but I am wondering at what point I 
should start panicking. :)


Robert Harper wrote:

The memory should peak at some point and the go up and down with need. There
are a few things you have to be aware of though. The garbage collector is a
very low priority thread so if your server never has a dull moment, you end
up exhausting memory just because the garbage collector does not get a
chance to run.

Care in development should be taken with respect to use of objects and
having circular references. You can cause memory leaks with circular
references because you might leave free and object from the servlet but then
have two objects referring to each other and the GC will not see them as
having gone out of scope. Another thing to think about is if you are doing a
lot of string concatenation the StringBuffer object is much better to use
than the String object. StringBuffer will be easier on memory and more
efficient.



Robert S. Harper
Information Access Technology, Inc.

-Original Message-
From: Rizwan Merchant [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 03, 2006 7:41 AM

To: tomcat
Subject: tomcat memory usage questions

Hi,
We recently developed and deployed a web based application using the 
following technologies...


Struts
Spring
Hibernate 3.0
Mysql 5.0
tomcat 5.5
Linux Fedora Core 4

After the system went live, I have been monitoring the CPU and memory 
usages. I dread the outOfMemory errors and am a little paranoid about it.


There are 2 main processes I am monitoring, tomcat and mysqld.
The tomcat process memory usage is slowly creeping up...after 8 hours of 
application usage it is at 13.3% and the mysqld memory usage is at 1.3%.


I am wondering what kind of pattern I should be observing for the memory 
usages. Should it go up and then down again (like the CPU usage)? Or is 
it ok for it to slowly go up (the way it is doing right now)? The swap 
memory is not being used, so I am guessing thats a good thing.


Also, someone told me that hibernate and spring will try and cache 
everything it can, which could be the cause of the memory creeping up 
slowly. Is this true? and if it is, will this be a problem when the 
memory gets to a high number like 80 or 90% ?


Also, is there a way to tell if there are any processes spawned by 
tomcat that are hanging around uselessly?


Any help, ideas, tips would be appreciated. I am just concerned about 
having any memory issues with this LIVE application.


Thanks,
-Riz.

http://forum.springframework.org/newreply.php?do=newreplyp=79473

-
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]



Re: Shutdown log - deallocating instances

2006-09-29 Thread Rizwan Merchant


Thanks Charles.
Is there any other way to know which servlets are casuing this issue??
So, i  I dont fix this problem, is there a potential of a break down in 
the near future?


Any one else encounter this problem? What are the typical causes?

-Riz.

Caldarale, Charles R wrote:
From: Rizwan Merchant [mailto:[EMAIL PROTECTED] 
Subject: Shutdown log - deallocating instances


Off late, I have been noticing that during a shutdown of the server I 
see a message

Waiting for xx instance(s) to be deallocated



This message is logged up to three times for each servlet that has a
non-zero allocation count, waiting for it to decrement to zero.  After
the third message, the ServletWrapper code just goes on and calls the
servlet's destroy() method.  Looks like you have two servlets that
aren't always terminating properly.  Unfortunately, the log message
provides no information about which servlets those might be.  The code
in question is in the unload() method of

container/catalina/src/share/org/apache/catalina/core/StandardWrapper.ja
va

around line 1300 in 5.5.20 if you want to change it to display more
information.

 - 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]


  


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



Shutdown log - deallocating instances

2006-09-28 Thread Rizwan Merchant


Hi,
We have been running a couple of web application on a tomcat 5.5 server. 
The OS is Linux based FC4.
Off late, I have been noticing that during a shutdown of the server I 
see a message

Waiting for xx instance(s) to be deallocated

The xx number varies (today it was 154). Can someone tell me what this 
means and if I should worry about this at all? So far the server behaves 
well and we have not come across any hanging type situations. But we are 
slowly moving into full production mode and I want to make sure this 
will not cause a problem down the line...


Thanks for the help.

Here is the log from the last shutdown...

2006-09-28 21:45:06,722 [main] INFO  
org.apache.catalina.core.StandardWrapper - Waiting for 1 instance(s) to 
be deallocated
2006-09-28 21:45:07,742 [main] INFO  
org.apache.catalina.core.StandardWrapper - Waiting for 1 instance(s) to 
be deallocated
2006-09-28 21:45:08,762 [main] INFO  
org.apache.catalina.core.StandardWrapper - Waiting for 1 instance(s) to 
be deallocated
2006-09-28 21:45:08,866 [main] INFO  
org.apache.catalina.core.StandardWrapper - Waiting for 154 instance(s) 
to be deallocated
2006-09-28 21:45:09,885 [main] INFO  
org.apache.catalina.core.StandardWrapper - Waiting for 154 instance(s) 
to be deallocated
2006-09-28 21:45:10,905 [main] INFO  
org.apache.catalina.core.StandardWrapper - Waiting for 154 instance(s) 
to be deallocated
2006-09-28 21:45:11,820 [main] INFO  
org.apache.coyote.http11.Http11BaseProtocol - Stopping Coyote HTTP/1.1 
on http-8080





-
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: Fw: SSL with Tomcat and Apache..IE problems

2006-05-28 Thread Rizwan Merchant


Thanks.
Could you please tell me or direct me to some resource that indicates 
how to have Apache handle SSL? Would there be separate SSL definitions 
for each virtual host? or just one for all virtual hosts?


Appreciate all the help I am getting here...

Martin Gainty wrote:
Follow up on Bill's advice to use jsvc as Tomcat launcher and then 
front-ending with Apache to handle the SSL
If you are using jsvc I would setup the CLASSPATH following advice by 
David Erickson at

http://marc.theaimsgroup.com/?l=tomcat-userm=108578233003073w=2
he discovers that tools/commons-daemon/bootsrap is the correct config 
which is defined here

CLASSPATH=$CLASSPATH:\

 $JAVA_HOME/lib/tools.jar:\
 $DAEMON_HOME/dist/commons-daemon.jar:\
 $CATALINA_HOME/bin/bootstrap.jar:\
 $CATALINA_HOME/common/lib/log4j-1.2.8.jar:\
 $CATALINA_HOME/common/classes


Bon Chance,
Martin --

This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please 
notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - From: Bill Barker [EMAIL PROTECTED]
To: users@tomcat.apache.org
Sent: Saturday, May 27, 2006 9:06 PM
Subject: Re: SSL with Tomcat and Apache..IE problems




Rizwan Merchant [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]


Thanks Bill,
Can  I change the redirect port in server.xml from 8443 to 443? 
Currently, we are running tomcat as non-root user (tomcat user). 
Will we need to change this as well?




Well, since you are fronting with Apache, you could setup Apache to 
handle the SSL requests on 443 (probably easiest).  Then you just 
configure that VirtualHost to forward all to Tomcat.


Baring that, you can use the 'jsvc' program from commons-daemon 
(which is bundled in a tarball with the Tomcat distro) to allow 
Tomcat to bind to 443 as root, and then switch to a non-privileged 
user to handle requests.



Bill Barker wrote:
Rizwan Merchant [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]


We are running tomcat 5.5.16 on Fedora Core 4 OS. We just 
installed apache2.0 as a front to serve the pages using the mod_jk 
connector. There are 2 apps on tomcat (virtual hosting), one of 
which needs to be SSL enabled (lets say app1 and app2, app2 is the 
one that needs to be SSL enabled).


Everything seems to be working fine on FireFox, both apps can be 
accessed fine. When we access www.app1.com pages are served as 
expected, and when we access www.app2.com the browser detects the 
certificate and switches to https


But things are not well when it comes to IE. www.app1.com works 
the same as FF, and the app can be accessed. But when we try to 
access www.app2.com, IE shows the certificate and asks if we would 
like to proceed. When we click on 'Yes', the browser cannot find 
the app after that and returns Page cannot be displayed error. 
Also, directly accessing the https site by using the URL 
https://www.app2.com:8443 works fine on IE as well.
so its basically the switching from http to https for app2 that 
doesnt seem to work.





This used to pop up all the time when more people were using TC 4 
:). What it happining is that IE gets confused easily when you 
redirect to to a non-default SSL port.  This is especially true if 
the next page that you hit also does a redirect.


The solution is to use the default SSL port of 443 (either that, or 
don't use IE ;-).




I dont understand why this works on FF but not on IE..!
I hope someone can shed some light on this. I can post the 
httpd.conf , server.xml and workers.properties files if that helps..


Thanks,
-Riz.



-
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]







-
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

SSL with Tomcat and Apache..IE problems

2006-05-27 Thread Rizwan Merchant


We are running tomcat 5.5.16 on Fedora Core 4 OS. We just installed 
apache2.0 as a front to serve the pages using the mod_jk connector. 
There are 2 apps on tomcat (virtual hosting), one of which needs to be 
SSL enabled (lets say app1 and app2, app2 is the one that needs to be 
SSL enabled).


Everything seems to be working fine on FireFox, both apps can be 
accessed fine. When we access www.app1.com pages are served as expected, 
and when we access www.app2.com the browser detects the certificate and 
switches to https


But things are not well when it comes to IE. www.app1.com works the same 
as FF, and the app can be accessed. But when we try to access 
www.app2.com, IE shows the certificate and asks if we would like to 
proceed. When we click on 'Yes', the browser cannot find the app after 
that and returns Page cannot be displayed error. Also, directly 
accessing the https site by using the URL https://www.app2.com:8443 
works fine on IE as well.
so its basically the switching from http to https for app2 that doesnt 
seem to work.


I dont understand why this works on FF but not on IE..!
I hope someone can shed some light on this. I can post the httpd.conf , 
server.xml and workers.properties files if that helps..


Thanks,
-Riz.



-
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: SSL with Tomcat and Apache..IE problems

2006-05-27 Thread Rizwan Merchant

Hi,
Thanks for the response.

apache is listening on standard port 80. Tomcat is listening on standard 
port 8080 with a  redirect to 8443 for SSL connections. So the request 
http://www.app2.com comes in on port 80 (apache) and then the mod_jk 
connector forwards this request to 8080 (which is then redirected to 
8443). The web.xml file of app2 specifies the security-constraint to 
ensure all pages are SSL encrypted.


Snippets from all the relevant files are shown below (with tags to 
indicate start and end of each file). 


!--START Apache Virtual Hosting Snippet--

VirtualHost *:80
   ServerName www.app2.net
   DocumentRoot /var/www/www.app2.net/html
   ServerAdmin [EMAIL PROTECTED]
   ErrorLog /var/log/httpd/www.app2.net-error_log
   CustomLog /var/log/httpd/www.app2.net-access_log common
   JkMount / worker1
   JkMount /* worker1
/VirtualHost


VirtualHost *:80
   ServerName www.app1.ca
   DocumentRoot /var/www/www.app1.ca/html
   ServerAdmin [EMAIL PROTECTED]
   ErrorLog /var/log/httpd/www.app1.ca-error_log
   CustomLog /var/log/httpd/www.app1.ca-access_log common
   JkMount / worker1
   JkMount /* worker1
/VirtualHost

!--END Apache Virtual Hosting Snippet--


!--START Tomcat Connector/Virtual Hosting Snippet--

   Connector port=8080 maxHttpHeaderSize=8192
  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false redirectPort=8443 acceptCount=100
  connectionTimeout=2 disableUploadTimeout=true /
   !-- Note : To disable connection timeouts, set connectionTimeout value
to 0 --
 
   !-- Define a SSL HTTP/1.1 Connector on port 8443 --
  
   Connector port=8443 maxHttpHeaderSize=8192

  maxThreads=150 minSpareThreads=25 maxSpareThreads=75
  enableLookups=false disableUploadTimeout=true
  acceptCount=100 scheme=https secure=true
  clientAuth=false sslProtocol=TLS 
keystoreFile=/home/rmerchant/cww.keystore keystorePass=abcdef /
  


   !-- Define an AJP 1.3 Connector on port 8009 --
   Connector port=8009
  enableLookups=false redirectPort=8443 
protocol=AJP/1.3 /


  Host name=www.app2.net appBase=/home/app2/webapp 
unpackWARs=true autoDeploy=true

   xmlValidation=false xmlNamespaceAware=false
  /Host

  Host name=www.app1.ca appBase=/home/app1/webapp 
unpackWARs=true autoDeploy=true

   xmlValidation=false xmlNamespaceAware=false
  /Host

  Listener className=org.apache.jk.config.ApacheConfig
modJk=/usr/lib/httpd/modules/mod_jk.so
workersConfig=/etc/httpd/conf/workers.properties/

!--END Tomcat Connector/Virtual Hosting Snippet--


!--START WORKERS.PROPERTIES FILE--

workers.tomcat_home=/usr/local/tomcat 
workers.java_home=/usr/local/java 
ps=/ 
worker.list=worker1 
worker.worker1.port=8009

worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1 
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=worker1 
worker.inprocess.type=jni 
worker.inprocess.class_path=$(workers.tomcat_home)$(ps)lib$(ps)tomcat.jar 
worker.inprocess.cmd_line=start 
worker.inprocess.jvm_lib=$(workers.java_home)$(ps)jre$(ps)lib$(ps)i386$(ps)classic$(ps)libjvm.so 
worker.inprocess.stdout=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stdout

worker.inprocess.stderr=$(workers.tomcat_home)$(ps)logs$(ps)inprocess.stderr

!--END WORKERS.PROPERTIES FILE--


!--WEB.XML SNIPPET FOR APP2--
security-constraint
   web-resource-collection
 web-resource-nameapp2/web-resource-name
url-pattern/*/url-pattern
   http-methodGET/http-method
 http-methodPOST/http-method
   /web-resource-collection
   user-data-constraint
   transport-guaranteeCONFIDENTIAL/transport-guarantee
  /user-data-constraint
/security-constraint


Wade Chandler wrote:

--- Rizwan Merchant [EMAIL PROTECTED]
wrote:

  

We are running tomcat 5.5.16 on Fedora Core 4 OS. We
just installed 
apache2.0 as a front to serve the pages using the
mod_jk connector. 
There are 2 apps on tomcat (virtual hosting), one of
which needs to be 
SSL enabled (lets say app1 and app2, app2 is the one
that needs to be 
SSL enabled).


Everything seems to be working fine on FireFox, both
apps can be 
accessed fine. When we access www.app1.com pages are
served as expected, 
and when we access www.app2.com the browser detects
the certificate and 
switches to https


But things are not well when it comes to IE.
www.app1.com works the same 
as FF, and the app can be accessed. But when we try
to access 
www.app2.com, IE shows the certificate and asks if
we would like to 
proceed. When we click on 'Yes', the browser cannot
find the app after 
that and returns Page cannot be displayed error.
Also, directly 
accessing the https site by using the URL
https://www.app2.com:8443 
works fine on IE as well.

so its basically the switching from http to https
for app2 that doesnt

Re: SSL with Tomcat and Apache..IE problems

2006-05-27 Thread Rizwan Merchant
P.S if it were up to me, I wouldnt use IE for anything..been having too 
many problems with IE and SSL, IE and struts, etc etc
Unfortunately, as a web-app developer, we have to cater to 80% of the 
population that still uses IE !!! :)


Bill Barker wrote:
Rizwan Merchant [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
  
We are running tomcat 5.5.16 on Fedora Core 4 OS. We just installed 
apache2.0 as a front to serve the pages using the mod_jk connector. There 
are 2 apps on tomcat (virtual hosting), one of which needs to be SSL 
enabled (lets say app1 and app2, app2 is the one that needs to be SSL 
enabled).


Everything seems to be working fine on FireFox, both apps can be accessed 
fine. When we access www.app1.com pages are served as expected, and when 
we access www.app2.com the browser detects the certificate and switches to 
https


But things are not well when it comes to IE. www.app1.com works the same 
as FF, and the app can be accessed. But when we try to access 
www.app2.com, IE shows the certificate and asks if we would like to 
proceed. When we click on 'Yes', the browser cannot find the app after 
that and returns Page cannot be displayed error. Also, directly 
accessing the https site by using the URL https://www.app2.com:8443 works 
fine on IE as well.
so its basically the switching from http to https for app2 that doesnt 
seem to work.





This used to pop up all the time when more people were using TC 4 :).  What 
it happining is that IE gets confused easily when you redirect to to a 
non-default SSL port.  This is especially true if the next page that you hit 
also does a redirect.


The solution is to use the default SSL port of 443 (either that, or don't 
use IE ;-).


  

I dont understand why this works on FF but not on IE..!
I hope someone can shed some light on this. I can post the httpd.conf , 
server.xml and workers.properties files if that helps..


Thanks,
-Riz.



-
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]



Re: More virtual hosting problems!!

2006-05-15 Thread Rizwan Merchant


So what would my context.xml look like if I did not want to name my app 
ROOT.war.
Say I want to name my app under rizapps something like myapplication.war 
...what would the settings be for docbase and path in this case? i.e 
there would be no ROOT application under rizapps.


Thanks again! :)

Parsons Technical Services wrote:
I need to clarify that the context.xml should be part of the war. Note 
I said should (my opinion again)for easy deployment of the app.


To deploy a new app riz2, simply place the war in the rizapps folder. 
It should auto deploy and show up as www.eshipper.com/riz2 .


The ROOT.war is a special case that deploys the app as the default app 
(same as path=).


If you bundle the context.xml as part of the war it will be used. You 
can find further details for using the context at 
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html


Doug


- Original Message - From: Rizwan Merchant 
[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Sunday, May 14, 2006 5:20 PM
Subject: Re: More virtual hosting problems!!




Doug,
Thanks for your efforts to help. I am back with more questions. Hope 
you can still help.


I created a folder called $CATALINA_HOME/rizapps like you suggested
I added a war file called ROOT.war to this directory
The entry for the virtual host in my $CATALINA_HOME/conf/server.xml 
looks like this..


 Host name=www.eshipper.com appBase=rizapps 
unpackWARs=true autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
 /Host

As you suggested, I also created a folder called 
$CATALINA_HOME/rizapps/META-INF with a file called context.xml which 
looks like this

Context displayName=riz docBase=ROOT
/Context

The above works perfectly, but how do I add more apps to the rizapps 
folder? When I tried to change ROOT.war to riz.war (and 
correspondingly change the docBase to riz) it stopped working (not 
sure why).
So if I have another app war called riz2.war where would i put this 
and what entry would i need to make in the context.xml file under the 
META-INF directory? Can I have more than 1 context element entry in 
the context.xml file (1 for each app under rizapps)??


Hope my question is clear and that you can help me here.

Thanks,
-Riz.




Parsons Technical Services wrote:


First to your issue below.

Problems:
The workDir belongs in the Host section and not in the context.
The path to the workDir end in an underscore.
The default app is usually in a folder called ROOT.
The appBase would be better somewhere other than webapps. Maybe 
rizapps(my opinion) Otherwise it would conflict with an app called 
riz deployed in the default host.


 Host name=www.riz.com appBase=rizapps unpackWARs=true
autoDeploy=true  workDir=work/Catalina/riz

  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase=ROOT path=
   /Context
 /Host

There is a way to use the ROOT.xml to deploy the default app for a 
context. I am not familiar with it but this is my best guess.


To retry your first attempt:
Remove the Context element from above.
Deploy you app in a war named ROOT.war
Use META-INF/context.xml not ROOT.xml
In the  META-INF/context.xml file remove the path element.


I ain't perfect so I may have a goof or three in the above stuff.

Doug


- Original Message - From: Rizwan Merchant 
[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, May 12, 2006 4:39 PM
Subject: Re: More virtual hosting problems!!




dug deeper and figured that everytime I undeploy (delete the 
expanded application directory and replace the war file), the 
virtual host does not get resolved the first time the app is 
deployed. have to shut down the server and restart for it to work!


any ideas? Please help...

Rizwan Merchant wrote:


Ok to add to the mix, here is some more weird stuff.
I have the virtual host stuff working using the following entry in 
the server.xml


 Host name=www.riz.com appBase=webapps/riz 
unpackWARs=true autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase= path=
  workDir=work/Catalina/riz/_
   /Context
 /Host

when i start the server and type www.riz.com in the browser, it 
doesnt resolve. I then have to shut down the server and restart 
before www.riz.com gets resolved.
So basically for my virtual hosting to work, I have to start the 
server twice to make it work!!!


Weird

Tim Lucia wrote:
The link/text you posted says except when statically defining a 
Context in
server.xml, which was the case in the example from the OP...  
The above

statement is exactly opposite of what you posted, is it not?  To my
recollection, and despite the fact that it is (now) frowned upon,
path=/something has always worked in server.xml... since my 
days with

Tomcat 3.x.

Tim


-Original Message-
From: Parsons Technical Services 
[mailto:[EMAIL PROTECTED] Sent: Friday, May 12, 
2006 7:57 AM

To: Tomcat

Re: More virtual hosting problems!!

2006-05-14 Thread Rizwan Merchant


Doug,
Thanks for your efforts to help. I am back with more questions. Hope you 
can still help.


I created a folder called $CATALINA_HOME/rizapps like you suggested
I added a war file called ROOT.war to this directory
The entry for the virtual host in my $CATALINA_HOME/conf/server.xml 
looks like this..


 Host name=www.eshipper.com appBase=rizapps unpackWARs=true 
autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
 /Host

As you suggested, I also created a folder called 
$CATALINA_HOME/rizapps/META-INF with a file called context.xml which 
looks like this

Context displayName=riz docBase=ROOT
/Context

The above works perfectly, but how do I add more apps to the rizapps 
folder? When I tried to change ROOT.war to riz.war (and correspondingly 
change the docBase to riz) it stopped working (not sure why).
So if I have another app war called riz2.war where would i put this and 
what entry would i need to make in the context.xml file under the 
META-INF directory? Can I have more than 1 context element entry in the 
context.xml file (1 for each app under rizapps)??


Hope my question is clear and that you can help me here.

Thanks,
-Riz.



  


Parsons Technical Services wrote:


First to your issue below.

Problems:
The workDir belongs in the Host section and not in the context.
The path to the workDir end in an underscore.
The default app is usually in a folder called ROOT.
The appBase would be better somewhere other than webapps. Maybe 
rizapps(my opinion) Otherwise it would conflict with an app called 
riz deployed in the default host.


 Host name=www.riz.com appBase=rizapps unpackWARs=true
autoDeploy=true  workDir=work/Catalina/riz

  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase=ROOT path=
   /Context
 /Host

There is a way to use the ROOT.xml to deploy the default app for a 
context. I am not familiar with it but this is my best guess.


To retry your first attempt:
Remove the Context element from above.
Deploy you app in a war named ROOT.war
Use META-INF/context.xml not ROOT.xml
In the  META-INF/context.xml file remove the path element.


I ain't perfect so I may have a goof or three in the above stuff.

Doug


- Original Message - From: Rizwan Merchant 
[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, May 12, 2006 4:39 PM
Subject: Re: More virtual hosting problems!!




dug deeper and figured that everytime I undeploy (delete the expanded 
application directory and replace the war file), the virtual host 
does not get resolved the first time the app is deployed. have to 
shut down the server and restart for it to work!


any ideas? Please help...

Rizwan Merchant wrote:


Ok to add to the mix, here is some more weird stuff.
I have the virtual host stuff working using the following entry in 
the server.xml


 Host name=www.riz.com appBase=webapps/riz 
unpackWARs=true autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase= path=
  workDir=work/Catalina/riz/_
   /Context
 /Host

when i start the server and type www.riz.com in the browser, it 
doesnt resolve. I then have to shut down the server and restart 
before www.riz.com gets resolved.
So basically for my virtual hosting to work, I have to start the 
server twice to make it work!!!


Weird

Tim Lucia wrote:
The link/text you posted says except when statically defining a 
Context in
server.xml, which was the case in the example from the OP...  The 
above

statement is exactly opposite of what you posted, is it not?  To my
recollection, and despite the fact that it is (now) frowned upon,
path=/something has always worked in server.xml... since my days 
with

Tomcat 3.x.

Tim


-Original Message-
From: Parsons Technical Services 
[mailto:[EMAIL PROTECTED] Sent: Friday, May 12, 2006 
7:57 AM

To: Tomcat Users List
Subject: Re: More virtual hosting problems!!

From  http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

And look at the path element.

 The value of this field must not be set except when statically 
defining a Context in server.xml, as it will be inferred from the 
filenames used for either the .xml context file or the docBase. 


Now there is the issue of Tomcat version. What version is running?

I was basing my info on an assumption of a 5.5.x path.

The 5.0.x path is different.

Doug


- Original Message - From: Tim Lucia [EMAIL PROTECTED]
To: 'Tomcat Users List' users@tomcat.apache.org
Sent: Friday, May 12, 2006 6:48 AM
Subject: RE: More virtual hosting problems!!



Where is this documented?  I have had no problem doing this.  
Since I now

put context files in conf/[Engine]/[Host], I went back and added

Context
 docBase=d:/tjl/Projects/log4jconfig
 path=/log4jconfig/

to my server.xml and http://localhost:8080/manager/list shows

OK - Listed applications for virtual host localhost
/admin:running:0:C:/Tomcat/server/webapps/admin

Re: More virtual hosting problems!!

2006-05-12 Thread Rizwan Merchant


I am running 5.5 as well.
Would the path to the ROOT.xml be $CATALINA_HOME/conf/Catalina/riz or 
$CATALINA_HOME/conf/Catalina/www.riz.com

(based on the OP)

The filename under conf/[Engine]/[host] should be ROOT.xml, right?

Tim Lucia wrote:

The link/text you posted says except when statically defining a Context in
server.xml, which was the case in the example from the OP...  The above
statement is exactly opposite of what you posted, is it not?  To my
recollection, and despite the fact that it is (now) frowned upon,
path=/something has always worked in server.xml... since my days with
Tomcat 3.x.

Tim


-Original Message-
From: Parsons Technical Services [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 12, 2006 7:57 AM

To: Tomcat Users List
Subject: Re: More virtual hosting problems!!

From  http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

And look at the path element.

 The value of this field must not be set except when statically defining a 
Context in server.xml, as it will be inferred from the filenames used for 
either the .xml context file or the docBase. 


Now there is the issue of Tomcat version. What version is running?

I was basing my info on an assumption of a 5.5.x path.

The 5.0.x path is different.

Doug


- Original Message - 
From: Tim Lucia [EMAIL PROTECTED]

To: 'Tomcat Users List' users@tomcat.apache.org
Sent: Friday, May 12, 2006 6:48 AM
Subject: RE: More virtual hosting problems!!


  

Where is this documented?  I have had no problem doing this.  Since I now
put context files in conf/[Engine]/[Host], I went back and added

Context
 docBase=d:/tjl/Projects/log4jconfig
 path=/log4jconfig/

to my server.xml and http://localhost:8080/manager/list shows

OK - Listed applications for virtual host localhost
/admin:running:0:C:/Tomcat/server/webapps/admin
/host-manager:running:0:C:/Tomcat/server/webapps/host-manager
/log4jconfig:running:0:D:/tjl/Projects/Log4JConfig
/:running:0:ROOT
/manager:running:0:C:/Tomcat/server/webapps/manager

So I was able to put a path in the context and it was respected.

Tim


-Original Message-
From: Parsons Technical Services [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 11, 2006 11:12 PM
To: Tomcat Users List
Subject: Re: More virtual hosting problems!!

One issue is that the path element can only be set to  when you use it 
in

the server.xml.

Doug

- Original Message - 
From: Rizwan Merchant [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, May 11, 2006 1:37 PM
Subject: Re: More virtual hosting problems!!




I got this working now by moving the Context definition from the ROOT.xml
to the server.xml under the Host tag as follows

 Host name=www.riz.com appBase=webapps/riz unpackWARs=true
autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase= path=
  workDir=work/Catalina/riz/_
/Context
 /Host

I got rid of the www.riz.com directory under $CATALINA_HOME/conf/Catalina

But I did read somewhere that it is not recommended to put the Context
definition in the server.xml file.

Can someone please explain why the first scenario did not work and the
above does, although it is not recommded.

Thanks,
-Riz.

Rizwan Merchant wrote:
  

Hi all!

I have been following the mailing list and it seems this is a common
problem amongst many users. But I could not find a solution to my
problem, hence this post. Hope someone can help me.

I am trying to set up a simple virtual host for the domain www.riz.com 
on

tomcat (listening on port 80) using the instructions provided at

http://ex-parrot.com/~pete/tomcat-vhost.html

Based on the instructions here is what I have done..

1.Added the following to server.xml which is under under
$CATALINA_HOME/conf
   Host name=www.riz.com appBase=webapps/riz unpackWARs=true
autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
 /Host

   There is a riz.war file under $CATALINA_HOME/webapps that gets
expanded on deployment.

2. Created a directory $CATALINA_HOME/conf/Catalina/www.riz.com
   Added ROOT.xml to this directory which contains
 ?xml version='1.0' encoding='utf-8'?
   Context displayName=riz docBase= path=
   workDir=work/Catalina/riz/_
   /Context


Note that I have mapped www.riz.com to 127.0.0.1 in the hosts file
under c:\windows\system32\drivers\etc so that when i type www.riz.com in
the browser it will resolve to localhost.

Please can someone tell me what I am doing wrong, or if I am missing
anything?

Thanks,
-Riz.




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




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

Re: More virtual hosting problems!!

2006-05-12 Thread Rizwan Merchant


Ok to add to the mix, here is some more weird stuff.
I have the virtual host stuff working using the following entry in the 
server.xml


 Host name=www.riz.com appBase=webapps/riz unpackWARs=true 
autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase= path=
  workDir=work/Catalina/riz/_
   /Context
 /Host

when i start the server and type www.riz.com in the browser, it doesnt 
resolve. I then have to shut down the server and restart before 
www.riz.com gets resolved.
So basically for my virtual hosting to work, I have to start the server 
twice to make it work!!!


Weird

Tim Lucia wrote:

The link/text you posted says except when statically defining a Context in
server.xml, which was the case in the example from the OP...  The above
statement is exactly opposite of what you posted, is it not?  To my
recollection, and despite the fact that it is (now) frowned upon,
path=/something has always worked in server.xml... since my days with
Tomcat 3.x.

Tim


-Original Message-
From: Parsons Technical Services [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 12, 2006 7:57 AM

To: Tomcat Users List
Subject: Re: More virtual hosting problems!!

From  http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

And look at the path element.

 The value of this field must not be set except when statically defining a 
Context in server.xml, as it will be inferred from the filenames used for 
either the .xml context file or the docBase. 


Now there is the issue of Tomcat version. What version is running?

I was basing my info on an assumption of a 5.5.x path.

The 5.0.x path is different.

Doug


- Original Message - 
From: Tim Lucia [EMAIL PROTECTED]

To: 'Tomcat Users List' users@tomcat.apache.org
Sent: Friday, May 12, 2006 6:48 AM
Subject: RE: More virtual hosting problems!!


  

Where is this documented?  I have had no problem doing this.  Since I now
put context files in conf/[Engine]/[Host], I went back and added

Context
 docBase=d:/tjl/Projects/log4jconfig
 path=/log4jconfig/

to my server.xml and http://localhost:8080/manager/list shows

OK - Listed applications for virtual host localhost
/admin:running:0:C:/Tomcat/server/webapps/admin
/host-manager:running:0:C:/Tomcat/server/webapps/host-manager
/log4jconfig:running:0:D:/tjl/Projects/Log4JConfig
/:running:0:ROOT
/manager:running:0:C:/Tomcat/server/webapps/manager

So I was able to put a path in the context and it was respected.

Tim


-Original Message-
From: Parsons Technical Services [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 11, 2006 11:12 PM
To: Tomcat Users List
Subject: Re: More virtual hosting problems!!

One issue is that the path element can only be set to  when you use it 
in

the server.xml.

Doug

- Original Message - 
From: Rizwan Merchant [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, May 11, 2006 1:37 PM
Subject: Re: More virtual hosting problems!!




I got this working now by moving the Context definition from the ROOT.xml
to the server.xml under the Host tag as follows

 Host name=www.riz.com appBase=webapps/riz unpackWARs=true
autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase= path=
  workDir=work/Catalina/riz/_
/Context
 /Host

I got rid of the www.riz.com directory under $CATALINA_HOME/conf/Catalina

But I did read somewhere that it is not recommended to put the Context
definition in the server.xml file.

Can someone please explain why the first scenario did not work and the
above does, although it is not recommded.

Thanks,
-Riz.

Rizwan Merchant wrote:
  

Hi all!

I have been following the mailing list and it seems this is a common
problem amongst many users. But I could not find a solution to my
problem, hence this post. Hope someone can help me.

I am trying to set up a simple virtual host for the domain www.riz.com 
on

tomcat (listening on port 80) using the instructions provided at

http://ex-parrot.com/~pete/tomcat-vhost.html

Based on the instructions here is what I have done..

1.Added the following to server.xml which is under under
$CATALINA_HOME/conf
   Host name=www.riz.com appBase=webapps/riz unpackWARs=true
autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
 /Host

   There is a riz.war file under $CATALINA_HOME/webapps that gets
expanded on deployment.

2. Created a directory $CATALINA_HOME/conf/Catalina/www.riz.com
   Added ROOT.xml to this directory which contains
 ?xml version='1.0' encoding='utf-8'?
   Context displayName=riz docBase= path=
   workDir=work/Catalina/riz/_
   /Context


Note that I have mapped www.riz.com to 127.0.0.1 in the hosts file
under c:\windows\system32\drivers\etc so that when i type www.riz.com in
the browser it will resolve to localhost.

Please can someone tell me what I am doing wrong, or if I am missing
anything?

Thanks

Re: More virtual hosting problems!!

2006-05-12 Thread Rizwan Merchant


dug deeper and figured that everytime I undeploy (delete the expanded 
application directory and replace the war file), the virtual host does 
not get resolved the first time the app is deployed. have to shut down 
the server and restart for it to work!


any ideas? Please help...

Rizwan Merchant wrote:


Ok to add to the mix, here is some more weird stuff.
I have the virtual host stuff working using the following entry in the 
server.xml


 Host name=www.riz.com appBase=webapps/riz unpackWARs=true 
autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase= path=
  workDir=work/Catalina/riz/_
   /Context
 /Host

when i start the server and type www.riz.com in the browser, it doesnt 
resolve. I then have to shut down the server and restart before 
www.riz.com gets resolved.
So basically for my virtual hosting to work, I have to start the 
server twice to make it work!!!


Weird

Tim Lucia wrote:
The link/text you posted says except when statically defining a 
Context in

server.xml, which was the case in the example from the OP...  The above
statement is exactly opposite of what you posted, is it not?  To my
recollection, and despite the fact that it is (now) frowned upon,
path=/something has always worked in server.xml... since my days with
Tomcat 3.x.

Tim


-Original Message-
From: Parsons Technical Services 
[mailto:[EMAIL PROTECTED] Sent: Friday, May 12, 2006 
7:57 AM

To: Tomcat Users List
Subject: Re: More virtual hosting problems!!

From  http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

And look at the path element.

 The value of this field must not be set except when statically 
defining a Context in server.xml, as it will be inferred from the 
filenames used for either the .xml context file or the docBase. 


Now there is the issue of Tomcat version. What version is running?

I was basing my info on an assumption of a 5.5.x path.

The 5.0.x path is different.

Doug


- Original Message - From: Tim Lucia [EMAIL PROTECTED]
To: 'Tomcat Users List' users@tomcat.apache.org
Sent: Friday, May 12, 2006 6:48 AM
Subject: RE: More virtual hosting problems!!


 
Where is this documented?  I have had no problem doing this.  Since 
I now

put context files in conf/[Engine]/[Host], I went back and added

Context
 docBase=d:/tjl/Projects/log4jconfig
 path=/log4jconfig/

to my server.xml and http://localhost:8080/manager/list shows

OK - Listed applications for virtual host localhost
/admin:running:0:C:/Tomcat/server/webapps/admin
/host-manager:running:0:C:/Tomcat/server/webapps/host-manager
/log4jconfig:running:0:D:/tjl/Projects/Log4JConfig
/:running:0:ROOT
/manager:running:0:C:/Tomcat/server/webapps/manager

So I was able to put a path in the context and it was respected.

Tim


-Original Message-
From: Parsons Technical Services 
[mailto:[EMAIL PROTECTED]

Sent: Thursday, May 11, 2006 11:12 PM
To: Tomcat Users List
Subject: Re: More virtual hosting problems!!

One issue is that the path element can only be set to  when you 
use it in

the server.xml.

Doug

- Original Message - From: Rizwan Merchant 
[EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Thursday, May 11, 2006 1:37 PM
Subject: Re: More virtual hosting problems!!


   
I got this working now by moving the Context definition from the 
ROOT.xml

to the server.xml under the Host tag as follows

 Host name=www.riz.com appBase=webapps/riz unpackWARs=true
autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase= path=
  workDir=work/Catalina/riz/_
/Context
 /Host

I got rid of the www.riz.com directory under 
$CATALINA_HOME/conf/Catalina


But I did read somewhere that it is not recommended to put the Context
definition in the server.xml file.

Can someone please explain why the first scenario did not work and the
above does, although it is not recommded.

Thanks,
-Riz.

Rizwan Merchant wrote:
 

Hi all!

I have been following the mailing list and it seems this is a common
problem amongst many users. But I could not find a solution to my
problem, hence this post. Hope someone can help me.

I am trying to set up a simple virtual host for the domain 
www.riz.com on
tomcat (listening on port 80) using the instructions 
provided at

http://ex-parrot.com/~pete/tomcat-vhost.html

Based on the instructions here is what I have done..

1.Added the following to server.xml which is under under
$CATALINA_HOME/conf
   Host name=www.riz.com appBase=webapps/riz 
unpackWARs=true

autoDeploy=true
  xmlValidation=false xmlNamespaceAware=false
 /Host

   There is a riz.war file under $CATALINA_HOME/webapps that gets
expanded on deployment.

2. Created a directory $CATALINA_HOME/conf/Catalina/www.riz.com
   Added ROOT.xml to this directory which contains
 ?xml version='1.0' encoding='utf-8'?
   Context displayName=riz docBase= path

More virtual hosting problems!!

2006-05-11 Thread Rizwan Merchant


Hi all!

I have been following the mailing list and it seems this is a common 
problem amongst many users. But I could not find a solution to my 
problem, hence this post. Hope someone can help me.


I am trying to set up a simple virtual host for the domain www.riz.com 
on tomcat (listening on port 80) using the instructions provided at 
http://ex-parrot.com/~pete/tomcat-vhost.html


Based on the instructions here is what I have done..

1.Added the following to server.xml which is under under 
$CATALINA_HOME/conf
   Host name=www.riz.com appBase=webapps/riz unpackWARs=true 
autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
 /Host

   There is a riz.war file under $CATALINA_HOME/webapps that gets 
expanded on deployment.


2. Created a directory $CATALINA_HOME/conf/Catalina/www.riz.com
   Added ROOT.xml to this directory which contains
  
   ?xml version='1.0' encoding='utf-8'?

   Context displayName=riz docBase= path=
   workDir=work/Catalina/riz/_
   /Context


Note that I have mapped www.riz.com to 127.0.0.1 in the hosts file 
under c:\windows\system32\drivers\etc so that when i type www.riz.com in 
the browser it will resolve to localhost.


Please can someone tell me what I am doing wrong, or if I am missing 
anything?


Thanks,
-Riz.




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



Re: More virtual hosting problems!!

2006-05-11 Thread Rizwan Merchant


I got this working now by moving the Context definition from the 
ROOT.xml to the server.xml under the Host tag as follows


 Host name=www.riz.com appBase=webapps/riz unpackWARs=true 
autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
  Context displayName=riz docBase= path=
  workDir=work/Catalina/riz/_
/Context
 /Host

I got rid of the www.riz.com directory under $CATALINA_HOME/conf/Catalina

But I did read somewhere that it is not recommended to put the Context 
definition in the server.xml file.


Can someone please explain why the first scenario did not work and the 
above does, although it is not recommded.


Thanks,
-Riz.

Rizwan Merchant wrote:


Hi all!

I have been following the mailing list and it seems this is a common 
problem amongst many users. But I could not find a solution to my 
problem, hence this post. Hope someone can help me.


I am trying to set up a simple virtual host for the domain www.riz.com 
on tomcat (listening on port 80) using the instructions provided at 
http://ex-parrot.com/~pete/tomcat-vhost.html


Based on the instructions here is what I have done..

1.Added the following to server.xml which is under under 
$CATALINA_HOME/conf
   Host name=www.riz.com appBase=webapps/riz 
unpackWARs=true autoDeploy=true

  xmlValidation=false xmlNamespaceAware=false
 /Host

   There is a riz.war file under $CATALINA_HOME/webapps that gets 
expanded on deployment.


2. Created a directory $CATALINA_HOME/conf/Catalina/www.riz.com
   Added ROOT.xml to this directory which contains
 ?xml version='1.0' encoding='utf-8'?
   Context displayName=riz docBase= path=
   workDir=work/Catalina/riz/_
   /Context


Note that I have mapped www.riz.com to 127.0.0.1 in the hosts file 
under c:\windows\system32\drivers\etc so that when i type www.riz.com 
in the browser it will resolve to localhost.


Please can someone tell me what I am doing wrong, or if I am missing 
anything?


Thanks,
-Riz.




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




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