Re: ajp over ssl

2004-08-05 Thread Antonio Fiol Bonnín
Ralph Einfeldt wrote:
some other approaches:
- cryptcat
 http://farm9.org/Cryptcat/GetCryptcat.php
- openvpn
 http://openvpn.sourceforge.net/
- tinc
 http://www.tinc-vpn.org/
- CIPE
 http://sites.inka.de/sites/bigred/devel/cipe.html
 


What about stunnel?
Forwarding an insecure port securely from one machine to another.
http://www.stunnel.org/examples/generic_tunnel.html
Not sure if it will get through the list, so I CC'ed the original poster.
Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Tomcat 4.1.30 Hung!!! With High Traffic

2004-05-26 Thread Antonio Fiol Bonnín
Innovest Ken wrote:
I only use tomcat, without using Apache... Because my
site are mainly jsp.
Yes, I have a script to kill the tomcat server before
starting again. And yes, I saw the 'All threads(150)
are busy' error message.
Innovest
 


As Denise said, you seem to be maxing out your threads.
Possible reasons include, but are most likely not limited to:
- Too high load.
--- Check with netstat -n --tcp if there are about so many (150) 
ESTABLISHED connections. If so, your load is too high. If not, suspect 
on servlets taking too long to respond and clients going away.

- Servlet instances not finishing execution of doGet or doPost or whatever.
--- Trace their starts and ends (possibly using a filter), and detect 
whether the number of still executing servlets is steadily increasing 
or not. If so, it will raise 150 and then you'll start getting errors 
and Tomcat will start not responding. The thread dump should tell you 
where the processors are stuck. Most of them in the same place? Then you 
know where to look at.

- Database connections not working properly because of the firewall.
--- Not only you have to check that your app is using connections 
properly, but also that your firewall does not drop them. There are some 
properties for DBCP (testWhileIdle, validationQuery, and all the 
eviction series, which I do not remember off-hand) that will help you 
attack this problem. Set testWhileIdle, and make it test connections 
every so often (say 3-5 minutes). Use a very simple query like SELECT 1 
FROM DUAL (Oracle) or SELECT 1 (others that support it). This will 
refresh your firewall's activity maps. Also check that your firewall 
supports as many concurrent conenctions traversing it as you have (more 
than likely it does, but would be fatal if it does not).

HTH,
Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: All threads (150) are currently busy....

2004-05-26 Thread Antonio Fiol Bonnín
Hi Pavle,
Do you use a database?
Is there a firewall between Tomcat and the database?
If both answers are yes, try using testWhileIdle, validationQuery, 
time between eviction runs (can't remember property name) and other DBCP 
properties.

Other than that, my typical advice, which I learnt from Yoav Shapira 
IIRC, is (as Lipi told you), kill -QUIT and see what happens.

Antonio Fiol
Pavle wrote:
The main problem is that there is no load on the serever when this occurs. Everything 
works perfectly during the normal working week. The message and the hunging occurs 
during weekends, when there is low traffic.
Pavle
 

-Original Message-
From: rlipi [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 25, 2004 8:46 AM
To: 'Tomcat Users List'; [EMAIL PROTECTED]
Subject: RE: All threads (150) are currently busy 

Hi,
it means that all threads are currently performing some request.
It can have two reasons:
1) High load of the server - requests come quicker than they are
finished. You can increase maxThreads or you can look into your app
why it takes so long time.
2) Some requests are not finished due to some bug in your app. On Linux
you can send kill -QUIT to your Tomcat process. You will receive stack
traces of all VM threads and you can see where the threads currently
are.
Lipi
   

-Original Message-
From: Pavle [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 25, 2004 8:21 AM
To: [EMAIL PROTECTED]
Subject: All threads (150) are currently busy
After several days of good woking my Tomcat 5.0.16 on RedHat 9.0 box
 

stops
   

accepting connection on SSL connector. In catalina.out I am recieving
 

this
   

message:
SEVERE: All threads (150) are currently busy
My server.xml file for SSL connector is the following:
Connector port=8443
  maxThreads=150 minSpareThreads=25
 

maxSpareThreads=75
   

  enableLookups=false disableUploadTimeout=true
connectionTimeout=2
  acceptCount=100 debug=0 scheme=https
 

secure=true
   

 Factory clientAuth=false protocol=TLS
 

keystoreFile=***
   

keystorePass=***/
   /Connector
I tried to put smaller connectionTimeout but it does not work too.
I am not able to find anything on Google.
Thanks
Pavle



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Thread stuck at get database connection!

2004-05-26 Thread Antonio Fiol Bonnín
Try setting testWhileIdle=true. Maybe also reduce maxWait.
HTH, but I'm not sure at all.
Antonio
Innovest Ken wrote:
hello,
I found from my thread dump that 80% of my thread are
at the following stage, waiting to lock
PoolableConnectionFactory. This is the cause of my
Tomcat hanging! Do I need to reconfigure my
server.xml?
	 parameter
	   namemaxIdle/name
	   value10/value
	 /parameter
	 parameter
	   namemaxActive/name
	   value150/value
	 /parameter
	 parameter
	   namedriverClassName/name
	  
valueoracle.jdbc.driver.OracleDriver/value
	 /parameter
	 parameter
	   namemaxWait/name
	   value1/value
	 /parameter
	 parameter
	   nameremoveAbandoned/name
	   valuefalse/value
	 /parameter
	 parameter
	   nameremoveAbandonedTimeout/name
	   value60/value
	 /parameter
		 parameter
			namelogAbandoned/name
			valuetrue/value
		 /parameter
		 parameter
	   namefactory/name
	  
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
	 /parameter
 parameter
	   nameusername/name
	   valuenokia/value
	 /parameter
	 parameter
	   namepassword/name
	   valuepswpnokia/value
	 /parameter
 parameter
  namevalidationQuery/name
  valueselect count(*) from
dual/value
/parameter
	 parameter
	  
nametimeBetweenEvictionRunsMillis/name
	   value6/value
	 /parameter
	 parameter
	   namenumTestsPerEvictionRun/name
	   value3/value
	 /parameter
	 parameter
	  
nameminEvictableIdleTimeMillis/name
	   value12/value
	 /parameter

Following is the extract from thread dump:
http80-Processor228 daemon prio=1 tid=0x085a94d0
nid=0x275b waiting for monitor entry
[acdff000..acdff8d8]
at
org.apache.commons.dbcp.PoolableConnectionFactory.validateObject(PoolableConnectionFactory.java:316)
- waiting to lock 0x4d107d78 (a
org.apache.commons.dbcp.PoolableConnectionFactory)
at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:833)
at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)

	
		
__
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: PrintWriter performance

2004-05-26 Thread Antonio Fiol Bonnín

4/ depends on the JDK; newer compilers /may/ see a repeat string concat
  (+ op) and replace w/ StringBuffer under the covers...
   

This is a common psuedo-misconception.  Compilers can't do anything with strings
that have a paramter of which the value can only be realized at runtime.
public static String OPTIMIZED = optimized;
This can be  + OPTIMIZED +  at compile time to a single string with no
concatenation at runtime
 

You seem to have missed the final keyword. Without it, no optimization 
is possible.

Antonio


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Different Problem with error-page

2004-05-20 Thread Antonio Fiol Bonnín
Your error page is too small.
For IE to show an error page (by default) it has to be more than 1Kb 
long, IIRC.

Suggestion: Append to your page a comment like the following:
!-- This is stupid space to make stupid IE behave properly: 
##
##
# ... ### --

The text is optional.
Antonio Fiol
Frank T. Murphy wrote:
I have a different problem with the error-page.
Our goal is to have any 404's redirected to a particular web page called
act_check.html
the web.xml piece looks as follows
error-page
   error-code404/error-code
   location/act_check.html/location
 /error-page
It works on netscape 7.0 but I still get the standard IE 404 page when
running IE
Any thoughts?

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: show tomcat instance name in mod_jk.log

2004-05-19 Thread Antonio Fiol Bonnín
IIRC, recent versions (latest only?) of mod_jk do.

Simon Zeng wrote:
Another issue, I am running tomcat load balancing with mod_jk. I would like
to know from mod_jk.log (or anywhere else?) which tomcat instance the logged
message is for 
so that if there is a problem, i can quickly go to that tomcat. But I could
not find how to put the information there. Those flags in mod_jk
documentation does not work for me.

I would highly appreciate it if anyone here could help me out.
Thanks,
-Simon
-
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]
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to detect tomcat down

2004-05-19 Thread Antonio Fiol Bonnín
Hi,
You are looking for lb type workers (even if you did not know). Look 
for that in Tomcat docs.

In short:
JkMount /* balancer
worker.balancer.type=lb
worker.balancer.workerlist=tomcat1worker,tomcat2worker
(I am not sure about the workerlist word. It might be workers or 
list... Search for an example in your sample workers.properties)

Antonio Fiol
Simon Zeng wrote:
It seems working !!! However, I have a problem with the configuration.
All my tomcat workers share the same code base and is ready to handle all
the requests in load balance mode. I want something like this:
   JkMount /* tomcat1worker
   JkMount /* tomcat2worker
However, it only pick up tomcat2worker. For example, if I have tomcat2 down
and tomcat1 up. The mod_jk.log always give me error for tomcat2 without
going to tomcat1.
Is there any way to solve this? Many thanks.
-Simon
-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 19, 2004 10:43 AM
To: Tomcat Users List
Subject: Re: How to detect tomcat down
(Syntax below is not exactly correct, but has the right idea)
Assuming you loadlancer worker is named loadbalanceworker which has workers 
tomcat1worker and tomcat2worker

Instead of
JkMount *.jsp loadbalanceworker
Try this
JkMount /testworker1page tomcat1worker
JkMount /testworker2page tomcat2worker
-Tim
Simon Zeng wrote:
 

Could you please explain what do you mean special (hidden) and how to do
   

it?
 

Currently I only define on JkMount for loadbalancer. Thanks, -Simon
-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 18, 2004 7:54 PM
To: Tomcat Users List
Subject: Re: How to detect tomcat down
For the load balanced tests, have a special (hidden) JkMount for each
   

tomcat
 

in the cluster.
-Tim
Simon Zeng wrote:
   

I can come up with a WatchDog to do the monitoring/restart. But We have a
few tomcat instance runing in load balance mode with one Apache
 

dispatching
   

request to them. How could we figure out if one/more(not all) tomcat
instances down and how to decide which ones they are? Basically the
 

question
   

is can we bypass Apache to go directly to Tomcat since we know where they
are?
Thanks,
-Simon
-Original Message-
From: QM [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 18, 2004 4:40 PM
To: Tomcat Users List
Subject: Re: How to detect tomcat down
On Tue, May 18, 2004 at 03:04:28PM -0400, Simon Zeng wrote:
: I am running Apache 2.0.47 and Tomcat 4.1.24 on Win2K/NT. I would like
 

to
   

: monitor the tomcat 
: server and restart it automatically if it is detected down. I did a lot
: research but could not find any convincing way to do it.

Some commercial monitoring products perform a request to an
(unprotected) URI and, in the event of a failure, perform some specified
action. -that is, call the start script.
Otherwise, you could have Tomcat started by a (custom) watchdog, the
idea being that it kicks the start script if the expected process isn't
running.  I recall iPlanet 4 did something similar.
As for free + out-of-the-box solutions, I haven't seen any...
-QM
 

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

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: How to limit time for Connector threads?

2004-05-06 Thread Antonio Fiol Bonnín
Hi Yoav,

What the original poster meant is not that there is a race condition in 
Tomcat, but in his own web application.

Maybe we should try to point him into the direction of fixing the problem.

So there I go:

- When it hangs, if on Unix/Linux, kill -QUIT your Tomcat process, and 
you will get some stack traces.
- Maybe they will tell you something. If they do, you're lucky. 
Otherwise, post them: maybe they will tell us something.

At least, you will see how many threads there are, and their state (e.g. 
waiting for a lock).

Good luck!

Antonio Fiol



Shapira, Yoav wrote:

Hi,
I highly doubt you've stumbled on a race condition in the tomcat connector 
implementation.  Nonetheless, if you can supply a small WAR that leads to the problem 
you've described, we'll be glad to test it, and if your problem is reproducible rest 
assured it will be fixed immediately, as that would be more important than the other 
stuff currently open in bugzilla.
Yoav Shapira
Millennium Research Informatics
 

-Original Message-
From: rlipi [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 06, 2004 3:26 AM
To: 'Tomcat Users List'
Subject: RE: How to limit time for Connector threads?
Yes, I did it.

But it is not solution. Server doesn't answer slowly or for only some
requests. It doesn't answer at all. It means that treads are not
terminated and resources are not released. Sometimes, server doesn't
answer without All threads are currently busy exception. That is why I
think that the problem is some death lock.
Lipi

   

-Original Message-
From: STOCKHOLM, Raymond [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 06, 2004 8:56 AM
To: Tomcat Users List
Subject: RE: How to limit time for Connector threads?
Maybe you should increase the number of threads in your connector.

check attribut maxProcessors in your server.xml
In this example, I set it to 500 instead of 75 (default value)
   Connector className=org.apache.coyote.tomcat4.CoyoteConnector
  port=80 minProcessors=30 maxProcessors=500
  enableLookups=true redirectPort=8443
  acceptCount=100 debug=0 connectionTimeout=2
  useURIValidationHack=false
 

disableUploadTimeout=true /
   

-Message d'origine-
De : rlipi [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 6 mai 2004 08:40
À : 'Tomcat Users List'
Objet : How to limit time for Connector threads?
Hallo,
is it possible in any way to limit time for threads that realize user
requests?
Sometimes (once a day in average), the Tomcat 5.0.19 server doesn't
answers. The reason is in error message All threads are currently
busy. Probably there is a bug in the web application. Some kind of
synchronization death lock, I think.
But localization of this bug is very hard. So, termination (and
 

release
   

of all resources) of long time threads can be a work around.

Thank you for any suggestions,
Lipi.


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



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





This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender.  Thank you.

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: pageEncoing and contentType

2004-04-19 Thread Antonio Fiol Bonnín
What are you using to make the PDF content slip into the wire?

If you are using a Writer you get from response.getWriter(), you may 
have interest in trying to use the OutputStream, as in 
response.getOutputStream().

This is what the description of the getWriter method says: Returns a 
print writer for writing formatted text responses. The MIME type of the 
response will be modified, if necessary, to reflect the character 
encoding used, through the /charset=.../ property. This means that the 
content type must be set before calling this method.

So don't use it for binary things...

Antonio Fiol

seiji takegata wrote:

Hi Veniamin,
Thank you for your reply.
 

   What it means character is not encoded correctly? If PDF content 
is unreadable, then that's PDF file problem, not Tomcat. Is this PDF 
opens correctly by itself, i.e. when you open it through Adobe Reader?
   Anyway, just do response.setContentType(application/pdf) and let 
browser open it accordingly.

   

I tried. Then Japanese characters are all dimed (converted to 
randome characters like noise). 

Because itext asumes Japanese character as Shift_JIS encoded, 
but Tomcat default is UTF-8, so I have to specify pageEncoding 
attribute in page directive.

I can see PDF content is correct when I save it as a file and
open with Adobe Reader.
My point is why tomcat put charset option to contentType when I 
specify pageEncoding attribute. I might write code to generate
image from String, then the content should not be attributed
like charset=Shift_JIS. but still I need to specify 
pageEncoding attribute for correct character encoding.

I just want tomcat to stop adding charset option when 
pageEncoding attribute is specified.

Am I wrong?

 

seiji takegata wrote:

   

I'm trying to generate PDF document directory from JSP using 
itext library. I have an encoding problem.

I put pageEncoding and contentType attributes in page directive 
as:

%@ page contentType=application/pdf%
%@ page pageEncoding=Shift_JIS%
Then tomcat (or jasper) translates them like:

response.setContentType(application/pdf;charset=Shift_JIS);

IE will not open AdobeReader, show download dialog instead.

If I do not specify pageEncoding, then the line above will be:

response.setContentType(application/pdf);

AdobeReader opens as I expect. But character is not encoded 
correctory.

I wonder why charset=Shift_JIS is added to contentType string.
I want remove it from the contentType string, or remove whole 
the line. I think I can specify contentType by 

response.setCotentType(application/pdf);
 

   

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: JDNI, DBCP and global naming resources - problem solved!

2004-04-17 Thread Antonio Fiol Bonnín
Were your Driver classes in a jar in common/lib ?



Thomas Nybro Bolding wrote:

Dunno if this might be of interest to others but I guess some might have 
or get the same problems as I have been through for the past couple of 
hours and therefore post my findings...

Setting up a database connection pool in Tomcat is pretty straightforward: 
either edit the server.xml or use the admin module. In either event you 
might want to follow the guide at 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html.

But beware as this might result in a 
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null', cause: No suitable driver error even 
though you have followed the instructions. In this case simply move the 
ResourceParams name=jdbc/foo.../ResourceParams from the server.xml 
to your application located at ...\conf\Catalina\localhost\bar.xml as 
there seems to be an issue with global naming resources.

Does anyone know whether a bugzilla report has been filed on this subject 
(I couldnt find one) or if one should be reported at all...

Best regards Thomas



FONT SIZE=1 FACE=Arial___
Vi goer opmaerksom paa, at denne e-mail kan indeholde fortrolig information. Hvis du 
ved en fejltagelse modtager e-mailen, beder vi dig venligst informere afsender om 
fejlen ved at bruge svar-funktionen. Samtidig beder vi dig slette e-mailen i dit 
system uden at videresende eller kopiere den.
Selv om e-mailen og ethvert vedhaeftet bilag efter vores overbevisning er fri for 
virus og andre fejl, som kan paavirke computeren eller it-systemet, hvori den modtages 
og laeses, aabnes den paa modtagerens eget ansvar. Vi paatager os ikke noget ansvar 
for tab og skade, som er opstaaet i forbindelse med at modtage og bruge e-mailen.
___
Please note that this message may contain confidential information. If you have 
received this message by mistake, please inform the sender of the mistake by sending a 
reply, then delete the message from your system without making, distributing or 
retaining any copies of it.
Although we believe that the message and any attachments are free from viruses and 
other errors that might affect the computer or IT system where it is received and 
read, the recipient opens the message at his or her own risk. We assume no 
responsibility for any loss or damage arising from the receipt or use of this message.
/FONT
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Migrating from Tomcat404 to Tomcat5019. Problem with Filter

2004-04-16 Thread Antonio Fiol Bonnín
Two things I would double-check:

a) The approach of creating a PrintWriter at constructor time. Is that 
the right way of doing that?
b) Think of implementing flush and/or close for your ServletOutputStream.

HTH (but these are mostly wild guesses)

Antonio Fiol

Alex Moots wrote:

I've been using a custom made servlet filter developed for Tomcat404.  
It has worked perfectly for a long time.

The basic idea of the filter is that it acts as a wrapper around the 
response filter capturing the response output so that the output can 
be sent to a second destination (ie an email message body or something 
similar).  We call this a Double Output Stream filter.  The code for 
this filter is quite simple and I've attached a simplified version of 
it below.  The whole thing is less than 70 lines of code.

The problem is that this filter doesn't work properly in Tomcat5019.  
I don't get an exception during processing.  The problem is that the 
respByte [] (which should contain the array of bytes sent to the 
browser) is not populated, or is only partially populated.  And when 
this filter is invoked only a partial page is sent to the browser.  
For example, if my page is 10KB long only 3KB will be sent to the 
browser, and similarly only 3KB will be present in the respByte 
array.  It seems like what is happening is that Tomcat5019 is 
short-circuiting the execution of the page for some reason.  I don't 
know why.  The code worked fine in tomcat404 and I didn't change 
anything during the upgrade to tomcat5019.

Can anyone give an idea of what is going wrong here?  I did some 
searching to see if the servlet filter API changed between tomcat404 
and 5019, but I didn't find anything to suggest that things have 
changed significantly.

Thanks for your help.
Alex.
**CODE***

public class SaveAsHTMLFilter implements Filter {
   public void doFilter(ServletRequest request, ServletResponse 
response, FilterChain chain) throws IOException, ServletException {
   //Re the real response in a DoubleResponseWrapper which 
encloses the
   //real OutputStream, plus a ByteArrayOutputStream, into a 
DoubleOutputStream
   DoubleResponseWrapper respWrap = new 
DoubleResponseWrapper((HttpServletResponse) response);

   //Process the request to generate the output into the 
respWrap's DoubleOutputStream
   chain.doFilter(request, respWrap);

   //retrieve the ByteArray
   byte respByte[] = respWrap.getRespByte();
   // [SNIP]
   // Send the respByte array (which is the response that was sent 
to the browser) to an email message or something similar
   // [SNIP]
   }
}

***
public class DoubleResponseWrapper extends HttpServletResponseWrapper {
DoubleOutputStream dblOS;
PrintWriter pw;
 public DoubleResponseWrapper(HttpServletResponse resp) throws 
IOException {
   super(resp);
   ServletOutputStream servOutp  = resp.getOutputStream();
   ByteArrayOutputStream   byteArray = new ByteArrayOutputStream(32000);
   dblOS = new DoubleOutputStream(servOutp, byteArray);
   pw = new PrintWriter(dblOS);
 }
 public ServletOutputStream getOutputStream () throws IOException {
   return dblOS;
 }
 public PrintWriter getWriter() throws IOException {
   return pw;
 }
 public byte getRespByte()[] {
   return dblOS.getRespByte();
 }
}

***
public class DoubleOutputStream extends ServletOutputStream {
 private ServletOutputStream ServOutp;
 private ByteArrayOutputStream ByteOutp;
 public DoubleOutputStream(ServletOutputStream sos, 
ByteArrayOutputStream bos) {
   ServOutp = sos;
   ByteOutp = bos;
 }

 public void write(int b) throws IOException {
   try {
   ServOutp.write(b);
   ByteOutp.write(b);
 } catch (Exception e) {
 System.out.println(e);
 }
 }
 public byte [] getRespByte() {
   return ByteOutp.toByteArray();
 }
}



smime.p7s
Description: S/MIME Cryptographic Signature


Re: connection pooling

2004-04-15 Thread Antonio Fiol Bonnín
I can't remember the specifics off hand, but...

There is a mechanism in DBCP that allows you to check a connection with 
a validationQuery (use this term when googling for it!) that can be run

a) every now and then on an idle connection (very useful if a firewall 
sits in the middle)
b) before returning the connection to the application.
c) ??? (Maybe in other cases, I can't remember.

I am not sure what happens in (b) if the validation query fails. What I 
think it should do is open a new connection (or pick another one from 
the pool if possible) and return it to the application after validation.

If it fails in (a), it simply drops the connection, AFAIK. So when 
asking for a new one, a new one is established.

Please google for details.

Yours,

Antonio Fiol

Peter Choe wrote:

i am using connection pooling with tomcat 4.10.

i am using postgresql and oracle database for various web application. 
when either of the databases restart, tomcat can't reconnect to the 
database and it needs to be restarted.

i know that mysql has a autoreconnect to re-establish connection.  how 
can i do this for postgresql and if anyone knows off hand, for oracle.

peter choe

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Multiple certificates for multiple virtual hosts (1:1)

2004-03-31 Thread Antonio Fiol Bonnín
No idea, but for now, ...

1 name -- 1 certificate -- 1 (TCP port, IP address) pair.

You can't do any better with any implementation I know of.

Yours,

Antonio Fiol

Martin Alley wrote:

Aha...

This from http://ietf.org/rfc/rfc3546.txt

3.1. Server Name Indication

[TLS] does not provide a mechanism for a client to tell a server the
  name of the server it is contacting.  It may be desirable for clients
  to provide this information to facilitate secure connections to
  servers that host multiple 'virtual' servers at a single underlying
  network address.
In order to provide the server name, clients MAY include an extension
  of type server_name in the (extended) client hello.
...

This rfc is dated June 2003, so I wonder when it will become
mainstream??
Martin



-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED] 
Sent: 31 March 2004 15:25
To: 'Tomcat Users List'
Subject: RE: Multiple certificates for multiple virtual hosts (1:1)

Hi Doug,

I guess my point is that given there may be multiple certificates
installed on a web server, and given that certificates authenticate
Distinguished Name there should be an effective way to make sure the
correct certificate is sent to the user.  The certificate isn't just for
viewing on the client when there is a name mismatch, or out of date of
whatever - it can be used by SSL 3 supported RSA key exchange.
Why should the user get the wrong certificate when the correct one is
available???
I understand about SSL fitting between TCP/IP and HTTP in the protocol
stack.  I would expect the host name to transition as part of the SSL
session initiation - given that the certificate authenticates the *name*
and not the IP address!!
It looks like this has already been considered by the gurus (not
surprisingly :-)
http://ietf.org/internet-drafts/draft-ietf-tls-emailaddr-00.txt
I shall do a bit more research...

Cheers
Martin
-Original Message-
From: Parsons Technical Services [mailto:[EMAIL PROTECTED]
Sent: 31 March 2004 14:55
To: Tomcat Users List
Subject: Re: Multiple certificates for multiple virtual hosts (1:1)
Martin,

You missed something fundamental. See the following document for a brief
description of the problem.
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/ssl-howto.html
For a more detailed description see:
http://httpd.apache.org/docs-2.0/ssl/ssl_intro.html
Short answer you can't.

I have an idea about a work around using non-standard ports:
Short version- No connectors on 443.
Redirect or link from http page to https nonstandard port.
Has anyone tried this or have it working

Doug
www.parsonstechnical.com
- Original Message - 
From: Martin Alley [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 8:39 AM
Subject: RE: Multiple certificates for multiple virtual hosts (1:1)

 

Okay, I see that the address attribute of the connector element can be
used to retrict IP/port combinations.
As I've only got 1 IP this doesn't really affect me.

Either I've misunderstood something fundamental, or the configuration
capabilities are not optimal.
Any one?

Thanks
Martin
-Original Message-
From: Martin Alley [mailto:[EMAIL PROTECTED]
Sent: 31 March 2004 12:10
To: Tomcat Users List
Subject: Multiple certificates for multiple virtual hosts (1:1)
Hi,

I want to have different certificates for different virtual hosts on
   

my
 

tomcat setup (embedded in JBoss).
I only have 1 IP address.  I want to use the default ports (80  443)
for each virtual server.
A certificate doesn't say anything about the IP address - only the
common name (ie the FQDN).  It is perfectly possible to change the IP
address of the machine on which the cert is installed, and not have to
update the certificate.  Just let DNS update round the world.  The key
thing is to keep the private key that is paired with the public key
embedded in the cert (that's been signed by the CA) secured on the
   

same
 

machine.

Tomcat: The Definitive Guide, has this to say about multiple server
certificates:
Suppose you are an ISP with clients, several of whom want to have
   

their
 

own certificate. Typically this would involve using Virtual Hosts (as
covered in Chapter 7). Simply add an SSL Factory element to the
appropriate client's Connector, giving the keystore file for that
specific client.
I don't see how virtual hosts are associated directly with
   

certificates.
 

From my reading, certificates are associated with keystore, which are
associated with connectors, which are globally shared by one engine.
In other words it seems you can have different certs for different
*ports*, and you can use any of the virtual host names with any of the
ports declared, but you can't have the appropriate cert selected based
on the host name.  This is a shame, because *that* is what has been
certified!
So, suppose I have 2 pairs of HTTP connectors each with an SSL
   

factory:
 

Http 80 with SSL 443 (cert common name www.company1.com)

Re: Garbage Collection

2004-03-30 Thread Antonio Fiol Bonnín
Wait a minute!!

not enough swap space means IIRC that your JVM is getting *really* big.

How big is your memory? What is your -Xmx setting?

I would recommend keeping -Xmx to 80% of your physical RAM at a maximum 
(or less if your machine is not dedicated).

Could you please tell us a bit more on your environment (amount of RAM, 
amount of available RAM at tomcat startup time, idem for swap space, 
memory-relevant parameters you are passing to the JVM, any third-party 
native libraries you might be using, and any other detail you consider 
important).

Antonio Fiol

Rob Wichterman wrote:

The weird thing is everything will be running fine for a few hours (or days,
very inconsistent) then it seems like the garbage collector cannot keep up
with the used space and the heap gets bigger and bigger while nearly nothing
gets cleared, when this happens I have noticed the CPU stuck around 60%
used, eventually it will crash with (Out of Memory not enough Swap Space).
I have used JProfiler to try and find memory issues but the odd thing is we
have never been able to duplicate this problem in our testing environment
only in production.
-Original Message-
From: Peter Lin [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 30, 2004 1:08 PM
To: Tomcat Users List
Subject: Re: Garbage Collection

your heap size remains stable according to the verbose GC. That in itself
doesn't tell you if there is a problem or not. Is there some slowness in
your jsp?
you might want to d/l borland optimizeIt trial version and get a better
picture of what is happening.
peter

Rob Wichterman [EMAIL PROTECTED] wrote:
Can anybody tell me if these look like healthy garbage collections. 



[GC [ParNew: 3968K-0K(4032K), 0.0132890 secs] 25349K-22156K(56072K),
0.0134572 secs]
[GC [ParNew: 3952K-0K(4032K), 0.0086222 secs] 26109K-22649K(56072K),
0.0087891 secs]
[GC [ParNew: 3953K-0K(4032K), 0.0092634 secs] 26602K-23133K(56072K),
0.0094345 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0094125 secs] 27101K-23289K(56072K),
0.0095833 secs]
[GC [ParNew: 3961K-0K(4032K), 0.0474236 secs] 27250K-23491K(56072K),
0.0476528 secs]
[GC [ParNew: 3966K-0K(4032K), 0.0101857 secs] 27458K-23644K(56072K),
0.0103671 secs]
[GC [ParNew: 3968K-0K(4032K), 0.0088548 secs] 27612K-23776K(56072K),
0.0090263 secs]
[GC [ParNew: 3968K-0K(4032K), 0.0075491 secs] 27744K-23842K(56072K),
0.0077127 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0107583 secs] 27810K-24144K(56072K),
0.0109381 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0588864 secs] 28112K-24470K(56072K),
0.0591110 secs]
[GC [ParNew: 3964K-0K(4032K), 0.0076312 secs] 28435K-24576K(56072K),
0.0077934 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0076016 secs] 28544K-24659K(56072K),
0.0077809 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0094214 secs] 28627K-24907K(56072K),
0.0095959 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0081766 secs] 28875K-25413K(56072K),
0.0083235 secs]
[GC [ParNew: 3964K-0K(4032K), 0.0476766 secs] 29378K-25736K(56072K),
0.0478634 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0131406 secs] 29704K-26056K(56072K),
0.0133119 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0127321 secs] 30024K-26486K(56072K),
0.0128994 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0170908 secs] 30453K-27044K(56072K),
0.0172648 secs]
[GC [ParNew: 3946K-0K(4032K), 0.0258431 secs] 30991K-28401K(56072K),
0.0260299 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0097711 secs] 32368K-29151K(56072K),
0.0099655 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0277493 secs] 33119K-30963K(56072K),
0.0279320 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0148470 secs] 34931K-31791K(56072K),
0.0150112 secs]
[GC [ParNew: 3961K-0K(4032K), 0.0252186 secs] 35753K-33458K(56072K),
0.0253967 secs]
[GC [ParNew: 3956K-0K(4032K), 0.0094682 secs] 37414K-34072K(56072K),
0.0096453 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0086307 secs] 38040K-34737K(56072K),
0.0088139 secs]
[GC [ParNew: 3961K-0K(4032K), 0.0085751 secs] 38699K-35289K(56072K),
0.0087476 secs]
[GC [ParNew: 3967K-0K(4032K), 0.0092369 secs] 39257K-35818K(56072K),
0.0095723 secs]
[GC [1 CMS-initial-mark: 35818K(52040K)] 35818K(56072K), 0.0051687 secs]

[CMS-concurrent-mark: 0.414/0.414 secs]

[CMS-concurrent-preclean: 0.004/0.004 secs]

[GC[Rescan (parallel) , 0.0071662 secs][weak refs processing, 0.0076101
secs] [1 CMS-remark: 35818K(52040K)] 3
5879K(56072K), 0.0157375 secs]

[CMS-concurrent-sweep: 0.131/0.131 secs]

[CMS-concurrent-reset: 0.124/0.124 secs]

[GC [ParNew: 3967K-0K(4032K), 0.0108625 secs] 20393K-16549K(56072K),
0.0110341 secs]


-
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




smime.p7s
Description: S/MIME Cryptographic Signature


AJP connector monitoring

2004-03-29 Thread Antonio Fiol Bonnín
Hi,

I'd like to have our Tomcat servers monitored, in order to get an alarm 
if one of them stops responding.

But they are not using HTTP at all. We are using the Coyote AJP 
connector because we have Apache in front of them, in a balanced 
configuration.

So I'd like to load a page directly using a simple AJP client integrated 
into our monitoring tool. Do you know of any AJP client which is easy to 
drive?

The only I know of is mod_jk(2), but I'm afraid that's overkill. Any ideas?

I've googled for an AJP client, but I came across nothing that seemed 
useful.

OTOH, I've been searching for something related to JMX monitoring. 
Again, the best I found involves access to the manager app. And I'd like 
to access it via AJP. So, we're back to the first problem. And it did 
not seem to me that the new JMeter tomcat monitor is any different.

Anything better than setting up an Apache server with one VirtualHost 
per Tomcat server, only for monitoring?

Thank you all very much.

Antonio Fiol

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


Re: AJP connector monitoring

2004-03-29 Thread Antonio Fiol Bonnín
John Sidney-Woollett wrote:

Antonio Fiol Bonnín said:
 

Hi,

I'd like to have our Tomcat servers monitored, in order to get an alarm
if one of them stops responding.
But they are not using HTTP at all. We are using the Coyote AJP
connector because we have Apache in front of them, in a balanced
configuration.
   

If you cannot find an AJP client...

Why not have tomcat listen for http requests as well (on 8080 or some
other port) (only accessible on your internal network), and have your
monitor script call some URL (a monitor servlet you create) on the tomcat
server to determine whether the tomcat server (and your web app) is up and
running.
Either use the response code (including no response) and/or the response
data/output to determine the state of the app server (and your
application).
You can use wget or some http client to poll your server. This is how we
do it even though we front-end Tomcat using Apache as well. This works
great with Nagios...
 

I had thought of that, but if you hit maxProcessors on the AJP side, you 
won't detect that if you monitor the HTTP connector.

Antonio Fiol

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


Re: AJP connector monitoring

2004-03-29 Thread Antonio Fiol Bonnín
It's a very nice software, but it still has not an AJP probing client.

Antonio Fiol

Scott Ahten wrote:

I use Mars to monitor Tomcat instances that are front-ended with 
Apache. To insure that my back-end logic is working correctly, I 
connect to Apache and look for a particular string of characters in a 
page. Mars also contains a HTTPS and JDBC probes so you can monitor 
SSL sites and database servers.

In addition, the plugin API isn't very complex, so you could write a 
probe to poll AJP directly.

http://www.altara.org/mars.html

- Scott

On Mar 29, 2004, at 8:15 AM, John Sidney-Woollett wrote:

You can use wget or some http client to poll your server. This is how we
do it even though we front-end Tomcat using Apache as well.


- - - - -
:: [EMAIL PROTECTED]
:: http://www.pixelfreak.net
- - - - -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




smime.p7s
Description: S/MIME Cryptographic Signature


Re: I know this is a stupid question

2004-03-28 Thread Antonio Fiol Bonnín
Hi Don,

As Bryan already told you, you should clear the work directory of 
already compiled versions.

Antonio

Donald Lee wrote:

I have since downloaded version 4.1.30 and am not experiencing this 
problem.  I have noticed that there are fewer sub-directories under 
the WEB-INF.  This leads me to believe that the jsp's were 
pre-compiled in version 5 and running more like servlets than a 
standard jsp.  With no way for me to really understand how I go about 
pre-compiling and deploying jsps in this manner, I guess for now until 
I learn enough about all the changes in version 5, I will continue 
using version4.
Thanks
Don



From: Donald Lee [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: I know this is a stupid question
Date: Sat, 27 Mar 2004 21:59:22 -0500
Yes I turned off caching I even deleted the index.jsp and stopped and 
started tomcat.  I still get the Congratulations!
I can do this without specifying the index.jsp and if I specify it.  
I know I am looking in the right folder because like I said, I can 
run a test.jsp just fine and even update it without cycling tomcat.  
This is version 5.0.19 windows installation.  It runs as a service.  
I installed the jk2 connector but right now IIS is turned off and I 
am not using it.
Thanks
Don




From: Bryan K. Cantwell Reply-To: Tomcat Users List To: Tomcat 
Users List Subject: Re: I know this is a stupid question Date: Sat, 
27 Mar 2004 19:34:55 -0600

Is your browser chacheing? turn it off. clear the work directory of 
already compiled versions too...

- Original Message - From: Donald Lee To: Sent: Saturday, 
March 27, 2004 7:31 PM Subject: I know this is a stupid question

 Ok, I know this has got to be a stupid newbie question but I have 
searched  the archives without success.  What is special about the 
default tomcat  webapps/ROOT/index.jsp?  I cannot make changes to 
it.  I tried making minor  changes to it and expecting the changes 
to happen on a refresh; no joy.  I  also shutdown and restarted 
tomcat to get the changes to take effect; no  joy.  I eventually 
created a small test.jsp and copied the contents to it  and sure 
enough my changes were there.  made some minor changes to my  
test.jsp and sure enough the changes were in effect without cycling 
tomcat.  I really would like to use index.jsp as my default page.  



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


Re: Tomcat and JApplet / Applet

2004-03-28 Thread Antonio Fiol Bonnín
Hi,

Class files for applets (or jars) are to be served by the web server 
exactly as any other STATIC file.

Place them outside WEB-INF/classes, as anything in that directory is NOT 
served.

Antonio Fiol

Lars Nielsen Lind wrote:

Hi.

How do I run JApplets / Applets with the Tomcat server?

I place the applets in /WEB-INF/classes/package_name/package_name/JAppeltExample.class, but the browser can't see them.

/Lars Nielsen Lind
 



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


Re: Tomcat and JApplet / Applet

2004-03-28 Thread Antonio Fiol Bonnín
Hi,

For JSP files, it's easy: instead of the source, they will get the 
processed page. If you do not want your JSP to be called directly, place 
it in WEB-INF or establish a restriction in web.xml (can't remember at 
the moment how this is done, but it is not complicated).

For HTML, if they can't be retrieved, how will your web be visible?!

Jars and Class files for your webapp: WEB-INF

Jars and Class files for your applets: publicly available.

Now, if you want to prevent directory listing (security by obscurity), 
you can: see the DefaultServlet in conf/web.xml.

But that will only hide those files not linked / used in your HTML 
(linked / used) files, with a root starting at /, whatever that means, 
or at any URL published by anyone.

But if you speak a bit of HTML and web technologies, you know that in 
order to use an applet, the client is required to download the class/jar 
files that compose the applet. So, it will be able to do whatever he 
likes with it. If you do not like that, CHANGE your technology... Or 
hire a private detective and sue any client that decompiles your classes 
;-)   Still one more option: make your classes (sources and binaries) 
available under the GPL. That way, you'll have no more worries.

OTOH, if using a modified applet could fool your server, or be somehow 
bad for you, you have a bad server-side design. Double-check that.

Hope that helps,

Antonio Fiol

Lars Nielsen Lind wrote:

If I place the applet as a *.jar file in the 'public' area of a web folder -
is it possible to prevent any programs from scanning the Apache/Tomcat
server for extraction of the files (html, jsp, class, jar)?
I want to prevent access by programs to the source files - like /WEB-INF is
protected - but in a way so that the applets can be used from the web
server?
/Lars Nielsen Lind

- Original Message - 
From: SH Solutions [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Sunday, March 28, 2004 7:02 PM
Subject: RE: Tomcat and JApplet / Applet

 

Howdy,

   

But then it is possible for third part to download and read the code in
 

the applet? or?
   

How do I protect my applets?
 

No. You need to make your class files accessible only. You do not need
tomcat for this. You can use tomcat as well as apache, iis or any other
   

web
 

server.

You do not need to place your source files anywhere on the server.

In fact, it is possible to decompile the class files, so you get very much
of the original source code. Howevery, you cannot prevent this. This is
always the case for any applet.
Regards,
 Steffen
-
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]
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: jsp compile - default constructor

2004-03-28 Thread Antonio Fiol Bonnín
I don't agree or disagree.

But this will break many apps. Mine for example.

Couldn't that be detected at jsp-java time? I believe that would not 
hurt that much. In fact... (not having read the spec) ...what's the 
whole point of creating the object at that time? IMHO, if it doesn't 
exist, just null, and everyone should be mostly happy. Or maybe I'm 
completely wrong? Well, in any case, detecting that at jsp-java time 
would give a compatible implementation.

If you'd like me to submit a patch explaining more clearly what I mean, 
please tell me which class is the affected one (the one that changed 
recently), and I will send that patch to you ASAP.

Yours,

Antonio Fiol

Tim Funk wrote:

The spec says using new() is OK. So tomcat does since it is *much* 
faster than reflection.

-Tim

Rupert Jones wrote:

Hi there

[Running Tomcat 5.0.19]

I have a servlet which forwards a Boolean object resource 
(request.setAttribute(someBoolean, someBoolean);) on to a jsp page. 
As you know there is no default constructor for this object (new 
Boolean()). In previous versions of Tomcat, well 5.0.16 and less, 
this didnt become a problem, as long as the Boolean was not null. In 
5.0.19 the jsp compile throws an error because it includes code to 
make a new object were it null.


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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Connection Pool setup.

2004-03-27 Thread Antonio Fiol Bonnín
Hi Gordon,

IMHO, all of them should be off for production. Your app is supposed to 
not leak any connections when it goes into production. And if you are 
not 100% sure of that, you'd better also have the log so that you can 
find and correct it.

So, again IMHO, these parameters mostly make sense when used together.

Antonio Fiol



Gordon Luk wrote:

Hi Antonio Fiol,

   Right, it should be helpful for development, we all want know what 
IT's doing? But for production, i think it should be off.

Gordon

Antonio Fiol Bonnín wrote:

Suggestion:

Also add the logAbandoned parameter and set it to true. I found 
it very useful at hard times.

Antonio Fiol

Gordon Luk wrote:

Hi Doug,

Thank for your advise, indeed my project state at begining. So every
thing is simple right now. BTW, i already experience on connection pool
on my previus ejb project. I will take care on it. As a simple mind,
take and go. :-)
Gordon

Parsons Technical Services wrote:

 

Gordon,

What about resultset and statement? Since this fixes it then you DO 
have a
leak. Break it down and check each step to make sure that they are 
returned,
even if an exception is thrown. I have it in finally clauses as a last
resort if it fails normally. There is something leaving the connection
hanging.

Doug
- Original Message - From: Gordon Luk 
[EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, March 26, 2004 2:31 AM
Subject: Re: Connection Pool setup.



 

Hi Doug,

  O, thanks, it's work... BTW, thanks for remind, and i am the good
citizen, allway return connection back to pool. ;-)
Gordon

Parsons Technical Services wrote:

 
   

Gordon,

Just for grins and giggles try adding this as a test:

  parameter
   nameremoveAbandoned/name
   valuetrue/value
   /parameter
   parameter
   nameremoveAbandonedTimeout/name
   value60/value
   /parameter
To reclaim abandoned connections.

If it drops you back to the min then you have a leak in you app.

Check that connections, resultsets and statements are all closed.

Doug

- Original Message - From: Gordon Luk 
[EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 11:18 PM
Subject: RE: Connection Pool setup.





Here my setting...

My problem is ... Connection pool look like don't open 10 
connection at
start-up, and when my servlet run for a while... Let it open up 
more
connections(over 30) and then wait... (after a night .. :-D)... 
When I
check database server, it still open more connections, I expect 
min. for
10 only.

My setup anything got wrong?  Thx.
---8
?xml version='1.0' encoding='utf-8'?
...
 ResourceParams name=jdbc/myjdniname
 parameter
 namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 !-- Maximum number of dB connections in pool. Make sure you
  configure your mysqld max_connections large enough to handle
  all of your db connections. Set to 0 for no limit.
  --
 parameter
 namemaxActive/name
 value100/value
 /parameter
 !-- Maximum number of idle dB connections to retain in pool.
  Set to 0 for no limit.
  --
 parameter
 namemaxIdle/name
 value10/value
 /parameter
 parameter
 nameminIdle/name
 value10/value
 /parameter
 !-- Maximum time to wait for a dB connection to become
available
  in ms, in this example 10 seconds. An Exception is thrown if
  this timeout is exceeded.  Set to -1 to wait indefinitely.
  --
 parameter
 namemaxWait/name
 value1/value
 /parameter
 parameter
 nameusername/name
 valuemyuserid/value
 /parameter
 parameter
 namepassword/name
 valuemypassword/value
 /parameter
 !-- Class name for mm.mysql JDBC driver --
 parameter
 namedriverClassName/name
 valuenet.sourceforge.jtds.jdbc.Driver/value
 /parameter
 parameter
 nameurl/name
 value
jdbc:jtds:sqlserver://myserver/mydatabase;TDS=4.2;charset=big5/value 

 /parameter
 parameter
 namevalidationQuery/name
 valueselect count(*) from tablename/value
 /parameter
 parameter
 nametestOnBorrow/name
 valuetrue/value
 /parameter
 parameter
 nametestWhileIdle/name
 valuetrue/value
 /parameter
 parameter
 nametimeBetweenEvictionRunsMillis/name
 value5000/value
 /parameter
 parameter
 nameminEvictableIdleTimeMillis/name
 value1/value
 /parameter
 /ResourceParams

/Context
---8
Regards,

Gordon Luk



-Original Message-
From: D'Alessandro, Arthur [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 7:03 PM
To: Tomcat Users List; Tomcat Users List
Subject: RE: Connection Pool setup.
May help if you post your resource snipplet (replacing any

Re: Connection Pool setup.

2004-03-26 Thread Antonio Fiol Bonnín
Suggestion:

Also add the logAbandoned parameter and set it to true. I found it 
very useful at hard times.

Antonio Fiol

Gordon Luk wrote:

Hi Doug,

Thank for your advise, indeed my project state at begining. So every
thing is simple right now. BTW, i already experience on connection pool
on my previus ejb project. I will take care on it. As a simple mind,
take and go. :-)
Gordon

Parsons Technical Services wrote:

 

Gordon,

What about resultset and statement? Since this fixes it then you DO have a
leak. Break it down and check each step to make sure that they are returned,
even if an exception is thrown. I have it in finally clauses as a last
resort if it fails normally. There is something leaving the connection
hanging.
Doug
- Original Message - 
From: Gordon Luk [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, March 26, 2004 2:31 AM
Subject: Re: Connection Pool setup.



   

Hi Doug,

  O, thanks, it's work... BTW, thanks for remind, and i am the good
citizen, allway return connection back to pool. ;-)
Gordon

Parsons Technical Services wrote:

  

 

Gordon,

Just for grins and giggles try adding this as a test:

  parameter
   nameremoveAbandoned/name
   valuetrue/value
   /parameter
   parameter
   nameremoveAbandonedTimeout/name
   value60/value
   /parameter
To reclaim abandoned connections.

If it drops you back to the min then you have a leak in you app.

Check that connections, resultsets and statements are all closed.

Doug

- Original Message - 
From: Gordon Luk [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 11:18 PM
Subject: RE: Connection Pool setup.





   

Here my setting...

My problem is ... Connection pool look like don't open 10 connection at
start-up, and when my servlet run for a while... Let it open up more
connections(over 30) and then wait... (after a night .. :-D)... When I
check database server, it still open more connections, I expect min. for
10 only.
My setup anything got wrong?  Thx.
---8
?xml version='1.0' encoding='utf-8'?
...
 ResourceParams name=jdbc/myjdniname
 parameter
 namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter
 !-- Maximum number of dB connections in pool. Make sure you
  configure your mysqld max_connections large enough to handle
  all of your db connections. Set to 0 for no limit.
  --
 parameter
 namemaxActive/name
 value100/value
 /parameter
 !-- Maximum number of idle dB connections to retain in pool.
  Set to 0 for no limit.
  --
 parameter
 namemaxIdle/name
 value10/value
 /parameter
 parameter
 nameminIdle/name
 value10/value
 /parameter
 !-- Maximum time to wait for a dB connection to become
available
  in ms, in this example 10 seconds. An Exception is thrown if
  this timeout is exceeded.  Set to -1 to wait indefinitely.
  --
 parameter
 namemaxWait/name
 value1/value
 /parameter
 parameter
 nameusername/name
 valuemyuserid/value
 /parameter
 parameter
 namepassword/name
 valuemypassword/value
 /parameter
 !-- Class name for mm.mysql JDBC driver --
 parameter
 namedriverClassName/name
 valuenet.sourceforge.jtds.jdbc.Driver/value
 /parameter
 parameter
 nameurl/name
 value
jdbc:jtds:sqlserver://myserver/mydatabase;TDS=4.2;charset=big5/value
 /parameter
 parameter
 namevalidationQuery/name
 valueselect count(*) from tablename/value
 /parameter
 parameter
 nametestOnBorrow/name
 valuetrue/value
 /parameter
 parameter
 nametestWhileIdle/name
 valuetrue/value
 /parameter
 parameter
 nametimeBetweenEvictionRunsMillis/name
 value5000/value
 /parameter
 parameter
 nameminEvictableIdleTimeMillis/name
 value1/value
 /parameter
 /ResourceParams

/Context
---8
Regards,

Gordon Luk



-Original Message-
From: D'Alessandro, Arthur [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 25, 2004 7:03 PM
To: Tomcat Users List; Tomcat Users List
Subject: RE: Connection Pool setup.
May help if you post your resource snipplet (replacing any host
/user/passwd info)
-Original Message-
From: Gordon Luk [mailto:[EMAIL PROTECTED]
Sent: Thu Mar 25 05:30:56 2004
To: Tomcat Users List
Subject: Connection Pool setup.
Hi All,

 May be I missing understand the DBCP configuration. Anyone could
help ? I want my connection pool are Max 100 connection, 10 conn. At
start-up, max idle 10, when idle for 10 min then kill it. Something like
that.
Thanks.

Regards,

Gordon Luk

 



-
To unsubscribe, 

Re: Session sharing/load balancing multiple tomcat instances W/O Apache Web Server

2004-03-26 Thread Antonio Fiol Bonnín
Jeremy Nix wrote:

I've misphrased.  What documentation I've come across indicates that
Apache (or IIS) is necessary to configure tomcat as a cluster.  It very
well may be possible, which is why I'm asking the list.  The main
feature that I'm looking for in this configuration is the session
failover ability.  I have a hardware load-balancer, so load-balancing is
not exactly what I was looking for...just the session sharing.
 

Does your hardware load balancer support sticky sessions?

If it does, you can use Tomcat's HTTP connector, and configure your 
balancer as if Tomcat were a web server (which it is, when you use that 
connector).

If it doesn't I personally recommend getting one that does ;-) or using 
Apache + mod_jk / mod_jk2. Use the hardware balancer and 2 Apache for 
high availability.

Other than that, there is in-memory or JDBC session clustering 
(uncomment two elements from your server.xml, and you are mostly done). 
That implies that objects stored in sessions need to be Serializable. 
Performance impact will depend on your webapp design, so YMMV. I only 
tried in-memory a few months ago, and performance dropped seriously, but 
it worked without problem. Most likely our webapp's fault. You may 
encounter issues with frames and similar constructs. See the docs.

HTH,

Antonio Fiol

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


Re: multiple tomcat instances cause user logout

2004-03-26 Thread Antonio Fiol Bonnín
Carlton Lo wrote:

I have installed 2 instances of tomcat on my machine. I've user 1 login to tomcat 1, when user 2 login to tomcat 2, it automatically logout user 1 in tomcat 1???

tomcat 4.0.6 on win 2000
 

Using the same working directory for both? --Avoid it.

Other than that, no idea.

Antonio Fiol

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


Re: Tomcat Hangs

2004-03-25 Thread Antonio Fiol Bonnín
kill -QUIT
to see what the threads are doing...
Surya Suravarapu wrote:

We have Tomcat 4.1.27 running in conjunction with Apache 1.3.x. We're 
using AJP13 connector. The machine that we're using has got over 2GB of 
Memory and good processor speed. Tomcat has been allocated 1 GB of max 
memory.

The issue is: For every two hours or so Tomcat hangs. That means, 
Tomcat don't crash but simply don't accept any more connections. While 
using Tomcat with Apache we're getting 500 Internal Server Error. We 
are constantly restarting server to make it work. There is no good 
information in the logs that could lead us to debug this issue.

I have tried several things. Taken out Apache and Connectors from the 
equation by running Tomcat as standalone. This time Tomcat we 
get server not found error - Page cannot be displayed message. I have 
also increased the maxProcessors of the connector to 300 instead of the 
default 75.

Interesting thing is -- when Tomcat hangs the memory usage never 
reaches even half of the max memory (1 GB) allocated to Tomcat, and the 
number of threads that we see is also always less than half of 
maxProcessors value (300) set. 

If anybody encountered this kind of issue or if you have any thoughts 
please respond.

Thanks in advance!

- SPS



-
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: iframe - dynamicaly generated pages

2004-03-24 Thread Antonio Fiol Bonnín
Hi Bost,

If you *really* need to generate the files statically,

- You can simply use the session ID as identifier, you do not need the 
user name.
- You should take care of cleanup on session expiry/invalidation. Think 
Listener for that.
- You can store the file creation time in your HttpSession so you need 
not use a database for such a temporary purpose.

But...

- Is the file so difficult to create that you can't build it every 
time? IMHO, that would save you trouble.
- If it is, that's many times because of a too hard query to a database, 
or too many small queries. Can't you optimize that big query, or reduce 
the amount of them? Query optimization can lead you to really improved 
times. If you go this path, please let me know.

Or...

- You could use a generic caching system. Some time ago, I came across 
http://www.opensymphony.com/oscache/ but I have not tried it yet. I do 
not know if it would match your needs.

Yours,

Antonio Fiol



Rostislav Svoboda wrote:

Hi pple

I make an information system: dbase(data) + tomcat(processing in 
servlets) + browser(html GUI) = The COOL

I use iframe src=path/udp.html where udp.html is dynamicaly 
generated in a servlet and depends on an user logged in. (it displays 
navigation tree)

It seems like I need to have a matrix of:
   udp.user_1.session_id_1.html  ...   udp.user_1.session_id_N.html
   ...
   udp.user_M.session_id_1.html  ...   udp.user_M.session_id_N.html
and I must check the time-of-change of certain tables in dbase against 
session-create-time under tomcat and regenerate the content of 
udp.user_I.session_id_I.html if outdated.

- principialy I doubt this is the right approach to display such kind 
of a page but I dunno any other :( Any ideas?
- the technical problem: I dunno how to setup/configure my tomcat to 
display
requested udp.user_I.session_id_I.html. If I create a file in a 
servlet on a HDD (even properly located) I get an error message in the 
iframe:

   HTTP Status 404 - /webapp/tree/index.ADMIN.html
   The requested resource (/webapp/tree/index.ADMIN.html) is not 
available.

EOF  thx in advance

Bost

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Esoteric class loading question/loading constraints/loader constraints

2004-03-24 Thread Antonio Fiol Bonnín
Hi Yoav,

Of course you are right (you always are ;-) about the way classloaders work.

However, I think Eric meant (and if he didn't, I do) that his class X is 
in fact a single one, and he *needed* to copy the .class file into 
common/... so that he could instantiate a new object of class X from his 
object of class Y.

My suggestion to Eric: If you hold a reference to your X object in 
Y, you can for example myX.getClass().newInstance(). Or maybe 
myX.getClass().getClassLoader().something... Or, you can simply move X 
into common instead of copying. I don't know what you are ultimately 
trying to do, so I can't advise on a specific way of doing it. Tell us, 
and someone will probably help you.

Please correct me if I am wrong about the following:

The common directory/classloader is meant for things that can be 
accessed (as the name implies) from all and any webapp. The webapp 
classloader is meant for things that can be accessed from that specific 
webapp. They are independent.

That means a webapp cannot load something which is in another webapp, 
but it can load something in common.

It is very reasonable that something in common cannot access something 
in any webapp. That would completely break independence in a bad way.

For example, if I had in the same server (bad practice, I know) the 
dev version and the production version of an app, in two different 
webapps (hence exactly the same class names, but with different 
content), how could common know which my.package.Foo I want to load?

Antonio Fiol



Shapira, Yoav wrote:

Hi,
Your understanding is wrong: there can be one class X for each
classloader.  Your practice of using multiple classes with the same
fully-qualified name in the same application is questionable, as it can
easily lead to human errors.
Yoav Shapira
Millennium Research Informatics
 

-Original Message-
From: Eric M. Kascic [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 24, 2004 10:49 AM
To: [EMAIL PROTECTED]
Subject: Esoteric class loading question/loading constraints/loader
constraints
I am somewhat stupified by some class loading results I am seeing from
Tomcat.  If I put some class X that refers to class Y in my servlet
   

jar,
 

the WebappClassLoader loads X.  I DO NOT put class Y in my servlet.jar.
Instead, I put class Y in a jar that is put in common/lib.  When Y is
finally loaded as a result of X being loaded, the StandardClassLoader
loads it (as the WebappClassLoader delegates to the
StandardClassLoader).
Now the stupifying part: class Y has a reference to a class X, *BUT* I
have put that class X in Y's jar.  Bottom line, there is to be two
different class X's, one loaded by WebappClassLoader (for the specific
webapp) and one by the StandardClassLoader (for common).  Based upon my
understanding of how the JVM tries to ensure type safety across
ClassLoaders,  StandardClassLoader loading the second version of class
   

X
 

should fail with a LinkageError - because the defining loader for X is
already WebappClassLoader, and here we are trying to say the defining
loader is now StandardClassLoader.
The rub: Tomcat does not throw a LinkageError.  Instead it goes ahead
and loads the second class X just fine.  Doing an output of
getClass().getClassLoader() in the constructors of both class X's shows
that is being loaded in two different defining loaders.  Am I missing
something?  Given that the so-called loader/loading constraints are
enforced by the JVM, not any particular ClassLoader/app, I am
dumbfounded by this behavior.
Thanks in advance for any insights.
   




smime.p7s
Description: S/MIME Cryptographic Signature


Re: ClassNotFoundException implementing new WebappLoader

2004-03-23 Thread Antonio Fiol Bonnín
Did you have your class in .../server/classes/com/spss/catalina/loader 
or directly in .../server/classes ?

If it was the former, it would probably be interesting to file a bug on 
that.

Antonio Fiol

Setera, Craig wrote:

Yoav,

I didn't even think to try using a jar file because it should have been the same.  But, it turns out that a jar file works in this case for some reason.  Thanks for the tip.

Craig

-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 23, 2004 11:20 AM
To: Tomcat Users List
Subject: RE: ClassNotFoundException implementing new WebappLoader



Hi,
Hmm... I'd guess it should go in the same repository as the normal WebappLoader, which 
is $CATALINA_HOME/server/lib. $CATALINA_HOME/server/classes should be functionally 
equivalent for unpacked classes, so it's strange you get the CNFE when you put your 
loader there.  Try packaging your loader in a jar file and putting that jar in 
server/lib.
Yoav Shapira
Millennium Research Informatics
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: thread deadlock problem

2004-03-21 Thread Antonio Fiol Bonnín
Christian Cryder wrote:

This works perfectly about 99% of the time. What we are observing is that
there are certain situations where we encounter a deadlock scenario (and
that's what prompted my original question). Basically, req2a writes the
redirect back to the client, the client receives the redirect and actually
sends a request back to the server (verified this by using a proxy to
examine what is getting sent)... BUT - if req2a is already in the blocking
code, tomcat simply does not accept req3 until the blocking code times out!
Bad.
 

Are you absolutely sure of that?

Could you please triple-check it? A System.out.println(something) at 
the *very* beginning of the doGet/doPost method would be enough.

Without seeing the code, I'd say there is a missing notifyAll() or 
notify() somewhere, to wake up the thread that is wait()'ing.


Now what's interesting is that tomcat itself is not blocked at this point -
I can send requests from other browsers, and those get handled just fine. So
something seems to be happening where Tomcat cannot accept this particular
request (req3), perhaps because its still trying to keep the physical
connection associated with req2a open(?) (I'm thinking keep-alives here...in
other words, if the browser is using keep-alives, req3 will be coming across
the same physical connection as req2a, so its almost like tomcat thinks it
still can't receive a new request across this connection, although the
browser thinks its fine to go ahead and send it). But after req2a writes the
redirect response to the browser, I close the writer and flush the buffer -
there's nothing else I can do to say hey, I really am done with that
response (even though I'm going to continue running in the background on
the server and writing additional data - the real response, the report - to
a memory structure).
 

Strange... Unlikely... but possible...


One easy solution is just to modify our piped reader/writer so that when the
pipe size gets maxed it simply expands the size of the pipe. This would mean
that we'd never actually have to block, so we'd never hit our deadlock. The
downside is that it now means that in some cases we might be significantly
increasing the size of our memory footprint for the server. Another option,
I suppose, would be to simply pipe the document to disk, rather than storing
it to memory.
 

And you would not make your writer wait, so your process would be 
faster, wouldn't it?

HTH,

Antonio Fiol

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


Re: CPU Binding - How to enable sun 1.3.1 for multi cpu

2004-03-18 Thread Antonio Fiol Bonnín
On Linux, you can choose green threads or native threads. The former 
means single process, so one CPU, and the latter means multiple 
processes, so it benefits from multiple CPUs.

No idea under Windows.

Good luck.



John Hilton - CPX COA wrote:

I am using the following JAVA version

java version 1.3.1_03
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3. Java 
HotSpot(TM) Client VM (build 1.3.1_03-b03, mixed mode)

I have noticed that only 1 CPU on a 4 CPU machine is handling load for
JAVA, can anyone help in how to configure JAVA to span the total number
of processors ?
Regards,
John
-Original Message-
From: John Hilton - CPX COA 
Sent: 18 March 2004 09:54 AM
To: [EMAIL PROTECTED]
Subject: CPU Binding ?

Good day,

Does anyone know how one sets Tomcat 4.0.6 to utilise more than one CPU
in a multiple CPU machine.
Tomcat is running on Windows Server 2003 on a 4CPU IBM machine, and all
the utilisation graphs indicate that the tomcat service is only using
one CPU, I have trawled the documentation and cant seem to spot the
config details to do this ?
Regards,
John
-
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: Connection warning

2004-03-18 Thread Antonio Fiol Bonnín
Hi Peter!



I'm stilld debating whether I want to write a new mailer module specifically for the monitor. the existing mailer component only measures failed requests and not necessarily the connections reaching a set threshhold.



Just a dumb suggestion: Can't you make requests fail?

I mean, there are assertion components in JMeter which make a request 
fail if (whatever). Wouldn't that be useful for you?



Antonio Fiol

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


Re: What's wrong with this picture.

2004-03-18 Thread Antonio Fiol Bonnín
I have never worked with taglibs, but...

Your NullPointerException can only be caused because pageContext is null.

Can you access the pageContext (I understand it must be a field from 
TagSupport) *before* doStartTag() is called?

You can try moving that line to be the first line *inside* the method.

Just a very wild guess.



Antonio Fiol

Werner van Mook wrote:

Hi all,

I created a jsp with this tag :

ina:displayResponse /

I included a taglib directive and did all things I should do to get 
it  working.

The class for this tag is :

import java.io.IOException;
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.TagSupport;
import util.Message;

public class DisplayResponse extends TagSupport {

// The next line is line 54
Enumeration e =  
pageContext.getAttributeNamesInScope(PageContext.REQUEST_SCOPE);

public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();
try {   
if(e.hasMoreElements()) {
out.println((String)e.nextElement());
} else {
out.println(It has no more elements.);
}
out.println(Just transformed o into message.);
} catch (IOException ioe) {
ioe.printStackTrace();
}
return SKIP_BODY;
}
}

If I run this I get a nullPointerException on the line defining the  
enumeration.
see :

javax.servlet.ServletException
 
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCont 
extImpl.java:864)
 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex 
tImpl.java:800)
org.apache.jsp.view_jsp._jspService(view_jsp.java:67)
 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja 
va:311)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 301)
 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

root cause
java.lang.NullPointerException
tags.DisplayResponse.(DisplayResponse.java:54)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native  
Method)
 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA 
ccessorImpl.java:39)
 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons 
tructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
java.lang.Class.newInstance0(Class.java:308)
java.lang.Class.newInstance(Class.java:261)
 
org.apache.jasper.runtime.TagHandlerPool.get(TagHandlerPool.java:161)
 
org.apache.jsp.view_jsp._jspx_meth_ina_displayResponse_0(view_jsp.java: 
78)
org.apache.jsp.view_jsp._jspService(view_jsp.java:59)
 
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja 
va:311)
 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java: 301)
 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

If I would change it to someting like :

Enumeration e =  
((HttpServletRequest)pageContext.getRequest()).getAttributeNames();

I get the expected result.
see :

 message Just transformed o into message.

According to the docs getAttributeNamesInScope can only throw :
java.lang.IllegalArgumentException or
java.lang.IllegalStateException
So is this a bug?
Or did I miss something?


Werner van Mook
Java Lead Developer / Trainer
Connecties Voor Internet




smime.p7s
Description: S/MIME Cryptographic Signature


Re: tomcat certificate

2004-03-17 Thread Antonio Fiol Bonnín
Or trust the CA (import the CA certificate).



Andi Reinbrech wrote:

View the certificate when you get that prompt and then Trust the site.  This
is a once off
-Original Message-
From: secam secam [mailto:[EMAIL PROTECTED] 
Sent: 17 March 2004 11:09 AM
To: [EMAIL PROTECTED]
Subject: tomcat certificate

Hi all,

I've got ssl with tomcat, and a self signed
certificate
When i try to access my webapp via port 8443 (ssl)
i've got a security alert due to this reason:
the security certificate was send by a compagny i've
not trusted.
How can i solve this problem in order not to have the
security alert?
Regards,
Secam
	

	
		
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout ! 
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez
Yahoo! Messenger sur http://fr.messenger.yahoo.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
**
Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to 
the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically 
be ascribed to the company.  If you are not the intended recipient, you may not peruse, use, disseminate, distribute or 
copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile 
or telephone and destroy the original message.
**

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: [OT] Digitally Signing Posts

2004-03-16 Thread Antonio Fiol Bonnín
Hi Mike, Neal, Angus,

I am sorry to have caused you so much inconvenience.

I will be happy to accept your advice off-list, as this is far off-topic.

As I just told George Sexton off-list, I sign all e-mail by default, 
and this is unlikely to change. However, I promise to make an effort to 
reduce inconvenience.

Thank you for your help solving this issue.

Yours,

Antonio Fiol



Mike Curwen wrote:

I'll vote for this too.  My client freezes for about 50 seconds when I
get to Antonio Fiol Bonnín's emails.  So I've leared to not click on
them.  And yes, it's Outlook, but hey that's what we use here at work.
My client at home (Firefox/thunderbird) does not have this problem.
 

-Original Message-
From: Neal [mailto:[EMAIL PROTECTED] 

Ha! I said the same thing a month ago and was completely ignored.  :-\

-Original Message-
From: Angus Mezick [mailto:[EMAIL PROTECTED] 

+1
--Angus
   



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


Re: Load balancing for uptime

2004-03-15 Thread Antonio Fiol Bonnín
Hi,

To keep it up, you will need to setup session replication (See your 
Cluster element in server.xml), either in-memory or JDBC. Both are 
supposed to work.

However, that implies several things:
- Your session must contain Seralizable objects only.
- Your performance will be worse (how much worse highly depends on the 
size of the objects in your session)

And... nobody guarantees that your memory leak (if there is one) is not 
related to the information stored in sessions.

Depending on your load balancer, there is another option (IMHO, better 
for your case).

There are some load balancers that allow you to turn a server down while 
keeping it up for currently established sessions, for a certain time. 
That allows you NOT to use session replication, thus not replicating any 
instability related to sessions.

Oh, and last, if you need a good consultant for fixing, optimizing or 
redesigning your application, you just found one ;-)

Yours,

Antonio Fiol

Derek Clarkson wrote:

Hi all,
	We have an app written in a mix of JSP, servlets and struts across 3
instances of apache, tomcat and an RMI server. To say that it's a pile of
smelly stuff is an understatement, however it works (mostly) and our
customers depend on it. At least once a week though it crashes with out of
memory errors. 

Until we can redesign and fix it we are looking for a way to keep it up. One
suggest has been to have two servers running with a common DB server, and to
use a load balancer to allow us to keep one server up whilst we boot the
other, then vice versa. Thus on a daily basis we can reboot both machines
whilst mainting a working system for the users. 

Can anyone see any problems with this ? I'm concerned about issue realed to
session management, etc.
Ciao
Derek
__
This email, including attachments, is intended only for the addressee
and may be confidential, privileged and subject to copyright.  If you
have received this email in error, please advise the sender and delete
it.  If you are not the intended recipient of this email, you must not
use, copy or disclose its content to anyone.  You must not copy or 
communicate to others content that is confidential or subject to 
copyright, unless you have the consent of the content owner.
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: JK Connector SYN packet for established connection

2004-03-11 Thread Antonio Fiol Bonnín
That won't help.

socket_timeout tells Apache to CLOSE connections that have been unused 
for that time, but only WHEN it needs it.

So that will cause problems on the Tomcat side.

What we did (but our problem was slightly different) was:

Set the tcp keepalive sysctl of the web server (it is a Linux box, look 
for the equivalent on Windows) to a value LOWER than the firewall's drop 
time (1800 was OK for us).

Set socket_timeout for the worker to some value. It does not matter 
much. In fact, it can be as high as you wish.

Set socket_keepalive for the worker to 1, to enable it.

And... Good luck!!

Antonio Fiol



David Rees wrote:

CONANT,PATRICK (HP-FtCollins,ex1) wrote:
 

Thanks for the proposal.  We made the change, but to no avail.  When the
IIS server came back up, we saw the same problem start almost immediately.
The only other report of this problem I could find was for a different
product (http://www.firewall-1.org/2002-04/msg00180.html).  I don't think
that the cause could be the same: with the amount of traffic we're seeing,
the JK connections should just remain open.  Regardless, our firewall
admin refuses to change the tcptimeout (as suggested in the above link)
due to potential impacts on other applications.
Any other ideas?
   

Could you try setting the socket_timeout to an even lower value?  Say 30s
instead of 300?
worker.frontend.socket_timeout=30

-Dave

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: JK Connector SYN packet for established connection

2004-03-11 Thread Antonio Fiol Bonnín

socket_timeout tells Apache to CLOSE connections that have been unused
for that time, but only WHEN it needs it.
So that will cause problems on the Tomcat side.
   

Why will it cause problems on the Tomcat side?
 

See below.

IMO, it has a good chance of fixing the problem as Apache/mod_jk will open
a new connection if it hasn't been used for a while which should prevent
the SYN problem the original poster was having problems with.
It's worth trying. Agreed.

Tomcat will
detect the closed connection and return that JK thread back to the pool
for later use.
 

It won't. If the firewall has already dropped the connection, Tomcat 
will not notice it being closed.

And as I said (and sources seem to agree with me ;-), socket_timeout is 
only checked synchronously, i.e. at usage time. So, maybe 
socket_timeout=10, but you may have connections staying up for ... as 
long as a whole night of deep inactivity.

In the morning, if you netstat on both machines, you will see a 
different number of ESTABLISHED connections. You will have more of them 
in the Tomcat side. And that is not good. Add up some nights, and you 
will have to restart your tomcat server in a couple of days / a week / a 
couple of weeks, depending on your MaxSpareClients (or equivalent) in 
your web server and your maxProcessors / maxThreads in Tomcat.

That is because Tomcat does not use keepalive on its side, and never 
sends any data to the client if the data has not been requested (AFAIK).

Some time ago, I proposed to fix this. I am not sure what the conclusion 
was.

Even if it doesn't help, it's an easy change to try.
 

Agreed.

-Dave



Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Which Tomcat with which JDK version

2004-03-05 Thread Antonio Fiol Bonnín
Hi,

I am sure this is a FAQ, but I've googled for it and I could not find 
any detailed info.

Is there a table specifying Tomcat version - JDK version compatibility?

In particular, I'm interested in running some Tomcat version with JDK 
1.2.2. Is it possible? Which version of Tomcat?

I had never worried about this because I had always used fairly recent 
JDK with latest (sometimes stable) tomcat. ;-)

Thank you all.

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Which Tomcat with which JDK version

2004-03-05 Thread Antonio Fiol Bonnín
Hi Yoav,

Thank you for answering *before* I posted.  :-)

It is indeed easy to know if you download all versions and read 
RUNNING.txt, but it is quite a tedious job if you don't *know* that all 
versions of every series are compatible with the same JDK versions.

Thankfully, *you* do. ;-)

Thank you again so much.

Antonio Fiol

Shapira, Yoav wrote at 2:47 PM:

Hi,
This is the sort of thing that's much faster to try yourself than ask the list, no? ;)
Tomcat 5 requires JDK 1.3 or later, as noted in $CATALINA_HOME/RUNNING.txt.

Tomcat 4 requires JDK 1.2 or later, as noted in $CATALINA_HOME/RUNNING.txt.

Tomcat 3 I don't know, but I'd guess JDK 1.2 or later as well.

Yoav Shapira
Millennium ChemInformatics
 

-Original Message-
From: Antonio Fiol Bonnín [mailto:[EMAIL PROTECTED]
Sent: Friday, March 05, 2004 2:48 PM
To: Tomcat Users List
Subject: Which Tomcat with which JDK version
Hi,

I am sure this is a FAQ, but I've googled for it and I could not find
any detailed info.
Is there a table specifying Tomcat version - JDK version compatibility?

In particular, I'm interested in running some Tomcat version with JDK
1.2.2. Is it possible? Which version of Tomcat?
I had never worried about this because I had always used fairly recent
JDK with latest (sometimes stable) tomcat. ;-)
   




smime.p7s
Description: S/MIME Cryptographic Signature


Re: ssl tomcat

2004-03-04 Thread Antonio Fiol Bonnín
The place to store the CA certificate(s?) with which you will validate 
your client certificates.

Does not make sense without client certificate validation.

Antonio Fiol

secam secam wrote:

Hi al,l

I'm new in tomcat
I attemp to use ssl with tomcat.
Can any one explain me what are the truststore and truststorepassword properties ?
Thanks,
Regards,
Secam

-
Yahoo! Mail : votre e-mail personnel et gratuit qui vous suit partout !
Créez votre Yahoo! Mail
Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: serving binary files

2004-03-01 Thread Antonio Fiol Bonnín
Vladimer Shioshvili wrote:



Does anyone have a suggestion on how to server binary files through 
tomcat? I am creating a binary file as a result of a request and would 
like to let the user download it. Just setting mime type and passing 
through as an attachment doesn't work as write methods of the writer 
seem to truncate upper bits of the data.

Use the OutputStream instead of the Writer:

response.getOutputStream()

Antonio Fiol



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Securing SSL from IIS to Tomcat

2004-03-01 Thread Antonio Fiol Bonnín
John MccLain wrote:

Since IIS decrypts the request and passes it unencrypted to Tomcat, How do I
encrypt the request so that all communication from IIS with Tomcat is
secure???
 

Do you really need it? It would probably affect your performance 
seriously. (No, I cannot prove that statement...)

Other than that, I cannot be of much help. I'm sure I have read 
something about a certain AJP 1.4 which could accomplish your needs.

Latest reference I've been able to google for is from Tomcat 4.1 JK 
connector (deprecated). But I have not searched a lot.

Hope you can go on searching further with this little bit of info.

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Virtual Hosts with Apache and Tomcat

2004-03-01 Thread Antonio Fiol Bonnín

That (with a high probability) is because some objects they store in 
sessions are not Serializable. IOW, they violate the Servlet 
Specification.


I'm just curious: is this actually a violation of the servlet spec? 
The API seems to indicate that you can put anything in the session 
that you want. I don't think it has to be Serializable... thought I 
was wrong before, once ;)


I'm not 100% sure. What I am sure is that you cannot user session 
replication or session persistence without this.


Tried that.  Capped it at 35 and the webserver stopped servicing any 
DB request as soon as the pool reached 35.  This is why I believe the 
pool management is faulty and/or something is hogging all the 
connections.

In fact, cap it at 10 and watch the app dring to a halt before it even 
gets going. This is a pretty compelling example. If the pool is drying 
up, they're definately screwing up.


It is. But developers may reply: You are using less connections than 
those specified in (the contract) / (the manual) / (fill in yourself).


It depends on the size of your rollback segments and the number of 
transactions you are doing. If you do big transactions, each DB 
connection (thread *or* process) wioll need a big chunk of memory. I 
wouldn't kill yourself trying to figure out how to reduce this process 
size. Fix the real problem, which is poor connection management.


No doubt...


I've seen code like this before. Many people think you can't get a 
stack trace unless you throw an exception. Not so. All you have to do 
is instantiate it, and you get the stack trace. So, the following will 
produce identical results, without the nasty try/throw/catch:

new Exception(Pool debugged says: ...).printStackTrace();


I thought I had tried that (JDK1.3) and I thought it had not worked. 
Glad to know it does...


I would recommend explicitly printing out the hashCode of the 
Connection object itself, just in case the connection doesn't include 
any identifying information in it's .toString method.


Oh. Of course... I never happened to come across such a braindead 
Connection class.



Then you can...
#!/bin/sh
# Filter pool debugger statements.


This is a pretty good idea for some basic debugging. You should only 
have to demonstrate to your devs that you can deadlock their server by 
capping the connection pool. After that, it's their problem, right? :)


With the proposal, you demonstrate they have a connection leak, which is 
the real problem.

Once you showed them they had ONE connection leak, you can urge them to 
dig for other connection leaks themselves.

But, of course, the idea about the deadlock seems really good also. If I 
understood, what you mean is: If you set the connection pool size too 
low for the app, it should crash at will (or better, show an 
'unavailable' screen), but it should continue working as soon as load 
permits it. Am I wrong?

Yours,

Antonio Fiol





smime.p7s
Description: S/MIME Cryptographic Signature


Re: Securing SSL from IIS to Tomcat

2004-03-01 Thread Antonio Fiol Bonnín
Hi,

Nice demonstration. I only miss the seriously part, which is covered 
partially by the term expensive ;-)

I wanted only to add IPSEC as another possible scenario. It has less 
(no) TCP overhead than a SSL tunnel. And it works without even changing 
your config files.

Antonio Fiol



Christopher Schultz wrote:

Antonio,

Since IIS decrypts the request and passes it unencrypted to Tomcat,
 How do I encrypt the request so that all communication from IIS
with Tomcat is secure???


Do you really need it? It would probably affect your performance 
seriously. (No, I cannot prove that statement...)


I can prove this statement. :)

Connection latency = network transfer time + 2 * (TCP overhead +
encryption/decryption)
(Twice since both clients have these overheads).

When the encryption/decryption term becomes zero (removal of SSL),
performance increases. The assertion that encryption/decryption takes
more than zero time is left as an exercise to the reader. (Oh, and SSL
acceleration hardware is expensive, which would seem silly if the ops
were trivial).
Latest reference I've been able to google for is from Tomcat 4.1 JK 
connector (deprecated). But I have not searched a lot.


I don't think that the JK mod is deprecated. In fact, it's suggested for
production installations with Apache 1.3 and 2.0 (and IIS, I guess).
(From the other followup post):

I doubt any has that kind of need. If that is the case, then everyone 
will
pull their brains out. 


Often, there's a need. What if you don't trust your own network?

If we are worried about the IIS having SSL with Tomcat, then how 
about SSL
between database and Tomcat. How about query tools used in database (
secured query tool? , I dont know who has like this).


Some people need this type of stuff. Let's say that your database 
server is on another network, and you need confidential transfers?

I would not worry, if the Tomcat behind firwall, and behind the IIS 
(SSL).


I would still worry. For example, all of our hardware is hosted by a 
data center. We get all kinds of M$ virus crap spewing into our 
syslogs every single day. We get SMB traffic logs. We get all kinds of 
crap. There's nothing stopping me from running a packet sniffer on my 
machines, which would compromise the entire network if SSL were not 
being used. (Fortunately, each app is small enough that we can runn 
both  the app and db on the same machine and avoid those security 
concerns).

The JK documentation says nothing about SSL (other than forwarding SSL 
information from thr web server to Tomcat). I assert that you have two 
options:

1. Use Tomcat standalone (why not? do you have a huge amount of 
non-dynamic content? If not, consider Tomcat standalone)

2. Set up an SSL tunnel using your favorite ssh software. OpenSSH is 
available for win32 (at least through cygwin). You can punch through 
pretty much any network and firewall (as long as they allow SSH). All 
the data is encrypted. Most ssh clients/servers also support 
compression as well, which /might/ help offset the performance penalty 
of encryption (due to lower network transfer times).

Good luck.

-chris




smime.p7s
Description: S/MIME Cryptographic Signature


Re: bug in redirect to https

2004-02-26 Thread Antonio Fiol Bonnín
Could you please post your connector config?



Bernhard Wraase wrote:

Hi,

I found a bug in tomcat 5. I can reproduce it with tomcat 5.016, 5.018 
and 5.019. Other versions of tomcat 5 I didn't test.

Here is my testcase:

create a folder under tomcat5/webapps (ie. sec-test)
put a zip-file and/or a pdf-file in it (ie. a.pdf, b.zip)
configure https with certificate and port in server.xml
configure the redirect from http to https in server.xml
configure the webapp
start tomcat 5
start IE 5.5 or 6.0
try https://servername/sec-test/a.pdf
try https://servername/sec-test/b.zip
both works correctly

Now the buggy behavior:

add a web.xml with following part:
 security-constraint
  web-resource-collection
web-resource-nameThe Entire Web App/web-resource-name
url-pattern/*/url-pattern
  /web-resource-collection
  user-data-constraint
transport-guaranteeCONFIDENTIAL/transport-guarantee
  /user-data-constraint
/security-constraint
Now it is not anymore possible to open or store neither the pdf-file 
nor the zip-file with same url from above.

Internet Explorer cannot download a.pdf from localhost.
 Internet Explorer was not able to open this Internet site. The 
requested site is either unavailable or cannnot be found. Please try 
again later.

Internet Explorer cannot download b.zip from localhost.
 Internet Explorer was not able to open this Internet site. The 
requested site is either unavailable or cannnot be found. Please try 
again later.

This happens only with IE 5.5 and 6.0, not with mozilla 1.6 or Opera 
7.23(tested).
The same webapp works works correctly in tomcat 4.02, 4.04, 4.1.30(all 
tested).
I tested on solaris(8), linux(SuSe 8.1) and W2000, the behavior is the 
same, means the operating system does not matter.

Could this please anybody confirm?

If somebody has a smart workarround or bugfix for tomcat 5 I 
appreciate it very much.
I try to understand the BaseAuthenticator(catalina.jar) since I 
thought there would be the bug but I must confess that I failed:-(




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Content type for jsp/html files

2004-02-24 Thread Antonio Fiol Bonnín
Johan Wallinder wrote:

Hi.

I've want to make a servlet that can display the source of any jsp/html
file (not the rendered one). 

Basically my code is like this:

*set content type to text/plain
*get PrintWriter object out
*get the fileobject as an inputstream 
*write to the out object
*flush/close

The code is working fine, but viewing the servlet execution in a
browser, the content type is set to text/html which means that all tags
are not displayed (hidden).
How can I override this behavior. If I read a text file everything works
fine. But if the file begins with an html tag, the contenttype is set
to text/html. Is this a browser problem? 
 

I'm afraid Internet Explorer is willing to play with you. ;-)

Try adding nonsense.txt to your URL, as in:

http://path/to/your/resource?nonsense.txt

IE has a horrible MIME behaviour. Live with it, or trash IE ;-)

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Rollover Web Certificate

2004-02-24 Thread Antonio Fiol Bonnín
[EMAIL PROTECTED] wrote:

Wondering if anybody has experienced a web cert expiring in their keystore. If
so, I was wondering how you go about replacing it without bringing down the
server. Can you simply create a new certificate (in a different keystore, I'd
imagine) then get it signed via the CSR, then import the new one into the
original keystore, overwriting the current about-to-expire certificate? I don't
think this would work though because the private keys would be different in the
two keystores. So you'd have to do this whole process in a new keystore and then
bounce Tomcat and have it point to the new keystore.
 

When you renew a certificate, you are supposed to use the same private 
key you used the first time.
 -- Google: SSL Certificates HOWTO.

Other than that, is it so bad to restart a server? I'd bet the keystore 
is only read at the connector init, and not re-read later. But I have 
not seen the code, so maybe someone will correct this.

Antonio Fiol




smime.p7s
Description: S/MIME Cryptographic Signature


Re: encodeURL / jsessionid

2004-02-24 Thread Antonio Fiol Bonnín
%= request.getSession().getAttribute(id); %

Jerald Powel wrote:

Hi, 

I wish to maintain state across contexts and have in app1:

% request.getSession().setAttribute(id,2004073258); %

a href=%= response.encodeURL(../app2/index.jsp) %app2/a

when app2 is loaded the jsessionid is visible in the address bar:

http://localhost:8086/app2/index.jsp;jsessionid=7DD63005E4142E8C75A2E75CBAC0534

Now what do I do with it? How do I access data set on the session on the previous context?

Thanks a lot

G.
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Proposal: New parameter for JK2 connector

2004-02-23 Thread Antonio Fiol Bonnín
Hi Bill,

Seen that mod_jk has a socket_keepalive option for the Apache side, my
proposal consists in adding a similar setting in the Tomcat side.
Advantages:
If you pull the power cord of your Apache server (or something else bad
happens to it), Tomcat will notice shortly after, and will close the
associated connections, thus freeing threads, which are limited by
maxThreads.
I know it is an unlikely situation, but I still think it is a good idea.

Suggestions welcome!
   

It shouldn't be necessary, since the Tomcat side spends most of it's time
attempting a 'read' on the Socket.  It should throw an IOException as soon
as Apache drops its end of the Socket (via tripping over the power cord or
otherwise :).
 

How would that be possible?

Precisely because Tomcat is idle on a read() call on the socket, several 
things may happen:

1- A packet with data is received.
2- An ACK packet is received (or a keepalive by any means).
3- A FIN or RST or (what was it) packet is received.
4- Nothing is received.
And the OS will:
1- End the read() call by returning the received data to Tomcat.
2- The OS responds to the keepalive or ACK or anything, and Tomcat keeps 
idle on read().
3- The read() call will be aborted, and an exception will be risen.
4- Nothing happens (Tomcat keeps idle on read())

If you pull the porwer cord (or network cable, for this matters), (4) 
will happen. I mean: a dead machine does not (can not) send packets. So 
NOTHING will happen. Tomcat will not notice.

As I tried to show from the beginning...

Please consider that I am not looking into the case where Apache 
*process* dies, in which case (3) will happen, as you said. I really 
mean a *hardware* problem.

Yours,

Antonio Fiol

P.S.: If it is voted for, I may develop the necessary patch, as it is a 
fairly trivial one.




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Coyote/JK2 AJP 1.3 Connector

2004-02-23 Thread Antonio Fiol Bonnín
Simply comment out the connector. You are not using it, so you don't 
need it there.

Antonio Fiol

Rommel Sharma wrote:

Dear Tomcat Gurus,

What is the use of Coyote/JK2 AJP 1.3 Connector on port 8009 in server.xml.

If I have two different tomcats running, and I have already changed the http
and https ports for them, do I have to change the 8009 port in one of them
to avoid conflict?
Thanks,
Rommel Sharma.
FYR: [in server.xml]
..
..
!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 --
   Connector className=org.apache.coyote.tomcat4.CoyoteConnector
  port=8009 minProcessors=5 maxProcessors=75
  enableLookups=true redirectPort=8443
  acceptCount=10 debug=0 connectionTimeout=2
  useURIValidationHack=false
protocolHandlerClassName=org.apache.jk.server.JkCoyoteHandler/
..
..
*
Disclaimer
This message (including any attachments) contains 
confidential information intended for a specific 
individual and purpose, and is protected by law. 
If you are not the intended recipient, you should 
delete this message and are hereby notified that 
any disclosure, copying, or distribution of this
message, or the taking of any action based on it, 
is strictly prohibited.

*
Visit us at http://www.mahindrabt.com


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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: One user seeing another user's data

2004-02-23 Thread Antonio Fiol Bonnín
Hi,

- Try to turn all your servlet's non-final STATIC or INSTANCE variables 
into LOCAL scope variables. This is definitely the first step, and will 
likely remove 90% of problems.

For singletons or static variables outside your servlet:

- Concentrate all your accesses to each of them in a short portion of 
code (put all accesses together). Surround them with a 
synchronized(object) { }. You will remove 80% of the remaining problems.

- If a collection is not in local scope, use a synchronized version of 
it. (??%)

For the rest, you will have to figure out   The most important point 
once the above are OK, in my opinion, is that you know the business 
logic concerning object access and its required independence. It's more 
difficult, but you probably know that better than anyone.

Yours,

Antonio Fiol



Anbu wrote:

Hello All,

I think that this problem (one user seeing another user's data) might be due to threadedness/concurrency of Tomcat. Ofcourse there could be problem with the JSP application too.

Can anyone throw some light on the possible session mixups happening with Tomcat server? I have seen the dev mailing list that such a thing happens when there are two or more tomcat server instances.

Thanks and Regards,
Anbu 

 



Keywords (for easier searches): threading issues, session mixup, 
concurrency problems.




smime.p7s
Description: S/MIME Cryptographic Signature


Re: What's the problem with Tomcat 4.1.29 and Switch?

2004-02-23 Thread Antonio Fiol Bonnín
George Hester wrote:

Thanks.  I wish Damon Hougland and Aaron Tavistock knew that before they published their Sun sanctioned book.  It would have saved me a lot of frustration.  I really expected Sun's CORE books to be better then Wrox.

Their example was this which failed:

% switch (day) { %
% case 1: %
  font color=blue size=+1Sunday/font
  % break; %
% case 2: %
  font color=blue size=+1Monday/font
  % break; %
% default: %
  font color=blue size=+1No day/font
  % break; %
% } %
 

I believe the following would work like a charm:

% switch (day) { 
  case 1: %
  font color=blue size=+1Sunday/font
% break; 
  case 2: %
  font color=blue size=+1Monday/font
% break; 
  default: %
  font color=blue size=+1No day/font
% break; 
  } %

Keep the elements that need to be together really together.

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: a question on viewing servlets

2004-02-21 Thread Antonio Fiol Bonnín
ches_nutsy wrote:

hi, i would like to ask something about the servlets, i have followed all the tomcat's intructions diligently, and i am able to compile them correctly, my problem is that I'm not alble to view the servlets, why is this happenning? I have saved the class files under C:\tomcat\jakarta-tomcat-5.0.12\webapps\ROOT\WEB-INF\classes and it compiled ok, but when i tried to access them, through http://localhost/servlet/HelloServlet nothing happens! help me, please 
 

Add your servlet and a servlet-mapping to your WEB-INF/web.xml

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Réf. : Re: maxProcessors = max ammout of concurrent connections?

2004-02-20 Thread Antonio Fiol Bonnín
As far as connections does not mean active connections, what 
meissa.Sakho wrote is strictly true.

Each Apache process connects to Tomcat when (if) it needs to. Call that 
a connection.

Apache processes do not disconnect from Tomcat. Call those idle 
connections.

idle connections = connections = number of Apache processes = MaxClients

Of course some of the connections are used at a certain moment.

active connections = connections

But at any moment in time, an Apache process that is not connected to 
Tomcat MAY receive a request, and start a connection to Tomcat. So, it 
is possible (and it actually happens most of the time) that even if your 
Apache is serving static content, all of the Apache processes are 
actually connected to Tomcat.

This means that connections = MaxClients, with the strict equality 
being possible.

If you have more than one instance of Tomcat, the same thing happens.

An Apache process that is connected to one of your Tomcat servers MAY 
receive a request that has to be processed by your second Tomcat. So it 
will connect to it, without dropping the connection to the first Tomcat.

So maxProcessors = MaxClients is true for any scenario with Apache and 
Tomcat.

Even worse...

If you have two Apache and two Tomcat,

maxProcessors = sum(MaxClients) for all your Apache servers.

Otherwise, busy sites experience hangs.



Of course, if you do not use Apache as a frontend, and you simply have a 
load balancer, you can keep maxProcessors much lower.



Yours,

Antonio Fiol







Pepijn Palmans - Kangaroot wrote:

That is not true.  This can be only true if you have only one instance of
tomcat, and ALL (even static!!!) content is serverd by tomcat.
Under normal setup you let your static content be served by apache, and
only use tomcat when needed.  So you might wanna have more apache
processes.
Pepijn

On Fri, 20 Feb 2004 [EMAIL PROTECTED] wrote:

 

As I know, the maxProcessor value must match
the MaxClients value in apache, because each apache
process must connect to a processor in Tomcat.
___
NATEXIS ASSET MANAGEMENT
Meissa SAKHO
01 58 19 45 71. . . . . . . . . . . . (84571)
[EMAIL PROTECTED]
   




smime.p7s
Description: S/MIME Cryptographic Signature


Re: (was: similar problem) Connection Pool Dies

2004-02-20 Thread Antonio Fiol Bonnín
Hi Harry,


I'm going to try and hijack this thread if I may (!) because, as you say...
 

Welcome! ;-)

[...] The other Tomcat server runs on a Red Hat 9 machine at my home. It connects
to the above Oracle DB box - far away - using the same static IP address.
[...] The problem is with the the DB connections on my own RH9 server - they just
*die* after a period of inactivity :-(
That period of inactivity can be as little as half and hour.
[...]
 

Very typical behaviour... at least in our scenario.

BTW - the 'first' login attempt (which reactivates the connection pooling)
never gets a response - it just times out.
 

Very true.

Do you think you can shed any light on this?

I'll try.

I have read just about every
single forum discussion - from Tomcat-User to Commons DBCP to you-name-it,
and I just cannot find the answer.
 

I have a very strict firewall policy on my Linux box - using iptables. Only
port 80 packets get through. Nothing else.
Does that have something to do with my problem? Is there an ICMP port that I
need to open up?
 

Nope. No ICMP is needed for keepalives.
The reason of your headaches may be in /proc/sys/net/ipv4/netfilter
There, you have several timeout values. Check 
ip_conntrack_tcp_timeout_established.

Anyway, however high you set the values in there, there will be an upper 
limit. So, I think you need to avoid your connection being idle, so that 
your firewall does not drop it, even with low timeout values. To do 
that, I suggest to use the mechanism provided by DBCP to test idle 
connections every now and then.

testWhileIdle -- true
validationQuery -- select 'x' from dual
timeBetweenEvictionRunsMillis -- 30 (five minutes. Or longer, as 
far as it works...)

On Monday, I may send you out production values. Now I don't have them, 
so I worked out some ;-)

I am not sure whether you will need to set some more parameters. The 
authoritative source of information is:
http://jakarta.apache.org/commons/dbcp/configuration.html

Other sources (link below) say that you also have to set 
numTestsPerEvictionRun. I'd suggest a value equal to maxIdle.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg05339.html

And he also proposes another solution (which I have not tested):

---
You can prevent that your firewall from dropping the connection using 
a oracle technique.
SQL*Net has a parameter which defines time interval to send a probe 
message to identify if the client process is still alive
- SQLNET.EXPIRE_TIME, sqlnet.ora file on the server side. 
SQLNET.EXPIRE_TIME = your_value
Set it to something like 30 when your firewall drops connection after 
60 minutes.
---
 



I hope that helped.

Antonio Fiol






smime.p7s
Description: S/MIME Cryptographic Signature


Proposal: New parameter for JK2 connector

2004-02-20 Thread Antonio Fiol Bonnín
Hello,

Seen that mod_jk has a socket_keepalive option for the Apache side, my 
proposal consists in adding a similar setting in the Tomcat side.

Advantages:
If you pull the power cord of your Apache server (or something else bad 
happens to it), Tomcat will notice shortly after, and will close the 
associated connections, thus freeing threads, which are limited by 
maxThreads.

I know it is an unlikely situation, but I still think it is a good idea.

Suggestions welcome!

Yours,

Antonio Fiol




smime.p7s
Description: S/MIME Cryptographic Signature


Re: 5.0.16 and 5.0.18 international character support

2004-02-20 Thread Antonio Fiol Bonnín
What Adam said was:
Look in the response headers to see it.
I think he *really* meant the response headers, not the html code.

To do that on IE, you need a plugin called ieHTTPheaders or something like that.

On Netscape/Mozilla, use LiveHTTPHeaders.

Otherwise, if you are not on HTTPS, you can use a network sniffer.

Antonio Fiol

Trygve Hardersen wrote:

Thanks for the reply. Project never ran on 4.x, developed on 5.x starting
from 5.0.14. Using JSTL 1.1. 

5.0.14:
?xml version=1.0 encoding=UTF-8?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; lang=en xml:lang=en
meta http-equiv=Content-Type content=application/xhtml+xml;
charset=utf-8 /
5.0.18:
?xml version=1.0 encoding=UTF-8?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml; lang=en xml:lang=en
meta http-equiv=Content-Type content=application/xhtml+xml;
charset=utf-8 /
That is equal. However, the characters æøå are in plain text in the page,
but IE displays them incorrectly. I can't find any difference in the source
of the pages between 5.0.14 and later, which makes me wonder if the problem
is IE oriented. Thing is though, that IE displays everything correct on
5.0.14. Installing Netscape now, Opera does not support xhtml with
script elements. Idea?
milx

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 20, 2004 2:43 PM
To: Tomcat Users List
Subject: Re: 5.0.16 and 5.0.18 international character support

On 02/20/2004 01:17 PM Trygve Hardersen wrote:
 

I'm having a silly problem with 5.0.16 and 5.0.18, regarding the
Scandinavian characters æ, ø and å (probably others to). I've developed a
project using tomcat and struts, where both message resources and actual
data in the database contain these characters. Using 5.0.14 and prior,
   

I've
 

not paid attention to the characters; just used plain text for both
resources and data. This has worked out just fine, regardless of user
   

locale
 

(and thereby the lang option of the page), the characters have been
   

rendered
 

properly. Attempting to stay up-to-date, I upgraded to 5.0.16 and later
5.0.18, but now the characters are Chinese-like (unreadable for a
Scandinavian). Anyone knows the cause of this?
The pages are all UTF-8, xhtml and there is no difference in handling of
message resources and model data.
   

Are you sure about that? Could it be that you actually did have this 
problem with tomcat 5.0.x but just didn't notice? When did you upgrade 
from tomcat 4.x?

There are issues going from tomcat 4 to 5 that could affect this, but 
none that I know of, just from 5.0.14 - 16.

Check the character encoding of your pages in the browser. Look in the 
response headers to see it. What is it  what do you want it to be?

Adam

 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: DataSource problem

2004-02-20 Thread Antonio Fiol Bonnín
This sounds as anything but a DataSource problem.

What are you using NetBeans web monitor module for?

Antonio Fiol

Nathan Maves wrote:

Hey guys just joined the alias today!

I am getting the following error from my web app.

NotifyUtil::java.net.ConnectException: Connection refused


Means server not responding (refusing the connection).

at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at  
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:452)
at java.net.Socket.connect(Socket.java:402)
at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)


Clearly protocol is HTTP.

at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
at sun.net.www.http.HttpClient.init(HttpClient.java:306)
at sun.net.www.http.HttpClient.init(HttpClient.java:267)
at sun.net.www.http.HttpClient.New(HttpClient.java:339)
at sun.net.www.http.HttpClient.New(HttpClient.java:320)
at sun.net.www.http.HttpClient.New(HttpClient.java:315)
at  
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:512) 

at  
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:489) 

at  
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:560) 



And finally something that may tell you something...

at  
org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:237) 

What does this mean.  


Well... no idea :-(

What are you trying?

Antonio Fiol



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Réf. : Re: Réf. : Re: Very Very Slow performance of Tomcat

2004-02-19 Thread Antonio Fiol Bonnín
[EMAIL PROTECTED] wrote:

Thank you for you answers Antonio,

Yes we have a firewall between tomcat and apache.
Does it means that there is something else to do?
 

If your firewall is well-behaved, no. There is nothing else to do. 
However, this is not usually the case.  :-(

If your firewall drops idle connections after some time, you will need 
to tune a couple of settings.

In Apache (workers.properties), set:

worker.something.socket_keepalive=1

In your sysctl settings for the Apache machine, set your tcp keepalive 
time to a value lower than the drop time of your firewall.

Otherwise, you will bang your head against a wall. And that causes 
headache ;-)

Antonio Fiol



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Réf. : Re: Very Very Slow performance of Tomcat

2004-02-18 Thread Antonio Fiol Bonnín
[EMAIL PROTECTED] wrote:

Antonio,

I'm facing to the same performance problems with Tomcat.

My the maxProcessor value is equal to 75 while
the Apache's MaxClients is equals to 150.
the MaxKeepAliveRequests of apache is equal to 100
Do you understand the relationship between theses attributes ?
 

MaxClients is the maximum number of Apache processes you can have.

Each Apache process connects to a processor in Tomcat. Make your own 
calculations ;-)

MaxKeepAliveRequests is something completely unrelated, as far as it is 
not below the average number of components (images, ...) of your pages. 
It's the max number of requests an Apache process will serve to you 
before closing the HTTP connection. My advice: Don't play too much with 
it, unless you have very high loads and really need to.  ;-)

netstat -n --tcp | grep SYN_RECV
on tomcat side while you are having the performance problems / apparent 
hangs.

If there are more than 3 connections in that state, you may be suffering 
from lack of processors.
Try raising maxProcessors to 150 if it is the case. (Or lowering 
MaxClients to 75 if your load is very light)

Tip: Have you got a stateful inspection firewall in the middle? If so, 
raising maxProcessors may not be enough. Tell me and I'll explain more.



Antonio Fiol




smime.p7s
Description: S/MIME Cryptographic Signature


Re: JkMount and /*/servlet/

2004-02-18 Thread Antonio Fiol Bonnín
Hi,

would ...

JkMount /* local

... do the job?

Antonio Fiol

seph wrote:

I'd like to have apache proxy all jsp and servlets to an underlying
tomcat, but I'm having some trouble getting the JkMount directives
right. I have:
 JkMount /*.jsp local
 JkMount /*/servlet/ local
which are pretty much from the docs. using those I get the following:

localhost/foo/test.jsp   tomcat
localhost/foo/bar/test.jsp   tomcat
localhost/servlet/   apache
localhost/foo/servlet/   tomcat
localhost/foo/bar/servlet/   apache
This is a bit weird, because the * is behaving differently in the 2
cases. Is there a simple way to use JkMount so all that goes to
tomcat, or am I going to need to make explicate entries for each URL?
I've tried a couple permutations of the *, but always the same result.
System is debian testing, mod-jk is 1.2.5, tomcat is 4.0.4, apache is 1.3.29
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: [OFF-TOPIC] Workflow Engines

2004-02-18 Thread Antonio Fiol Bonnín
Hi,

I'll save this e-mail preciously. What an amazing list!! Not even Google 
would find more info together...

Antonio Fiol

Hernani Mourão wrote:

Personaly I work with OpenSymphony and I find it good.

If i may add some more:

http://www.jcorporate.com/

http://www.jcorporate.com/html/news/Press/ExpressoRelease5.0.html

http://www.openbusinessengine.org/index.html

http://www.dstc.edu.au/Research/Projects/Pegamento/Breeze/breeze.html

http://www.powerfolder.org/

http://www.ofbiz.org/

http://werkflow.werken.com/

http://www.vivtek.com/wftk/

Cheers,
Hernâni


-Original Message-
From: Ryan Lissack [mailto:[EMAIL PROTECTED]
Sent: quinta-feira, 12 de Fevereiro de 2004 16:34
To: 'Tomcat Users List'
Subject: RE: [OFF-TOPIC] Workflow Engines
Hi Evgeny,

 

I worked with IBM MQ Series Workflow and it is great
commercial software. Could you please list Open Source
workflow systems.
   

Thanks for the response.  Below is a list of the open source engines I have
found so far:
OpenFlow
http://www.openflow.it/EN/index_html
Shark
http://shark.objectweb.org/
OpenSymphony OSWorkflow
http://www.opensymphony.com/osworkflow/
jBpm
http://www.jbpm.org/
WfMOpen
http://wfmopen.sourceforge.net/
Bonita
http://bonita.objectweb.org/
Bossa
http://www.bigbross.com/bossa/
XFlow
http://xflow.sourceforge.net/
As you can see, there are quite a number of them.

Regards,
Ryan.
-
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]
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Startup scripts not executable?

2004-02-18 Thread Antonio Fiol Bonnín
Roy Smith wrote:

I downloaded Tomcat-5.0.18 onto my Mac OSX-10.3.2 system.  The scripts 
in $CATALINA_HOME/bin (startup.sh, catalina.sh, etc) all got unpacked 
without the execute bit set.  I had to do chmod +x *.sh to get 
things to work.

Is this a bug?


You probably downloaded the zipped version. AFAIK, ZIP format does not 
support permissions.

The tarred and gzipped version is OK.

Antonio Fiol



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Error during tomcat 4.1.29 startup

2004-02-17 Thread Antonio Fiol Bonnín
And why are you playing with tomcat startup classpath? It should be fine 
out of the box.

suviswan wrote:

Yes infact i got this exception from the logs directory.  This exception
occurs only when i add a particular directory in the
tomcat startup classpath.
-Surendra

- Original Message -
From: Stefano Rebollini [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 8:46 PM
Subject: Re: Error during tomcat 4.1.29 startup
 

Have the user all the rights to write in the logs directory ?

- Original Message -
From: suviswan [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 3:31 PM
Subject: Error during tomcat 4.1.29 startup
   

Hi Team
I am getting this exception when i trying to evaluate Tomcat
 

4.1.29
   

for our product.


Exception during startup processing
java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
 

Source)
 

   at java.lang.reflect.Method.invoke(Unknown Source)
   at
 

org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
 

Caused by: java.lang.ExceptionInInitializerError
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at
org.apache.commons.modeler.Registry.getModelerSource(Registry.java:10
05)
   at org.apache.commons.modeler.Registry.load(Registry.java:818)
   at
org.apache.commons.modeler.Registry.loadDescriptors(Registry.java:931
)
   at
org.apache.commons.modeler.Registry.findManagedBean(Registry.java:719
)
   at
org.apache.commons.modeler.Registry.findManagedBean(Registry.java:104
7)
   at
org.apache.commons.modeler.Registry.registerComponent(Registry.java:8
59)
   at
org.apache.commons.modeler.Registry.registerComponent(Registry.java:3
46)
   at
org.apache.coyote.tomcat4.CoyoteConnector.start(CoyoteConnector.java:
1201)
   at
org.apache.catalina.core.StandardService.start(StandardService.java:5
06)
   at
org.apache.catalina.core.StandardServer.start(StandardServer.java:219
0)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
   at
 

org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
 

   at
 

org.apache.catalina.startup.Catalina.process(Catalina.java:180)
 

   ... 5 more
Caused by: org.apache.commons.logging.LogConfigurationException:
org.apache.comm
ons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurati
onException: Class org.apache.commons.logging.impl.Jdk14Logger does not
implemen
t Log
#
I understand this is something related to commons-logging and some class
loader issue. But not able to overcome this.
Please let me know what to solve this.

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



-
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: improving performance with connector params

2004-02-17 Thread Antonio Fiol Bonnín
It is not really a performance issue, but you will need to increase 
maxProcessors to the MaxClients value you have in your Apache web server 
in front.

If you have something other than Apache, it will not be called 
MaxClients, but you get the idea...

I would not raise acceptCount unless you know why.

Hope that helps,

Antonio Fiol

[EMAIL PROTECTED] wrote:

We're running Tomcat 4.1.18 with jdk1.3 under linux 
The communication with apache is set via the Webapp Connector.

In order to improve performance I need some suggestions
about the connectors attributes.
The extract below is from our server.xml file in the
prod environnement
Connector className=org.apache.catalina.connector.warp.WarpConnector
port=8008 minProcessors=5 maxProcessors=75
enableLookups=false appBase=webapps
acceptCount=10 debug=0/
the only thing we've changed is the enableLookup attribute.
For thoses who are used to manage these attributes, I'd
like you to help me making the right choice about setting 
right values to the other attributes(max and minProcessors
and acceptCount).

In the prod environnement, the machine is dedicated to Tomcat
only and I assume that we could increase the maxProcessors value.
I'm tempted to say that we could increase the acceptCount too but
without any real experience about.
Any suggestion would be greetly appreciated.
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Very Very Slow performance of Tomcat

2004-02-17 Thread Antonio Fiol Bonnín
Is maxProcessors lower than Apache's MaxClients?

Are you hitting the max. number of connections to your database?

When it goes slow, does it hang later?

Are you closing all your connections to the DB?



Q: --- Is there a checklist somewhere for this kind of things? It 
would be useful for nearly everyone.

Antonio Fiol

Deepak Hegde wrote:

Hi All,

I am running Tomcat 4 and Apache 1.3 and Struts Framework on Sun Sparc
machine having O.S 5.8 version.
Web application is developed to use Postgres Database also.

I am facing lots of performance issues with Tomcat i.e sometimes tomcat process hangs and website stops opening and some times it goes very slow. The Problem gets sloved when i restart the tomcat service again.

I am really struggling find out the reason for this

Somebody please help me ..

Regards,
Deepak
   

 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: One user seeing another user's data

2004-02-16 Thread Antonio Fiol Bonnín
Hi Kuloth,

Seatch Tomcat-user for concurrency problems or threading issues. 
There has been recent discussion on the topic.

Concurrency problems are the main source of session mix-up. Also look 
for instance variables (hint: avoid them in Servlets)

Antonio Fiol



Anbu wrote:

Hello Bill and All,

Could any one of you throw some light on a problem that I am facing on Apache 1.3.28/Mod-jk 1.2.0/Tomcat 4.0.6 setup?

The problem is that an user could see someother user's data (some kind of session mix up). When I searched the tomcat-dev list I found that Bill had replied that the problem could be related to error handling and it is not a synchorinazation problem.

Bill, as you have already seen and analyized this issue, could you please help me on this issue ?

Thank you all in advance.

Regards,
Kuloth
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Add context from apache in Tomcat !!!

2004-02-16 Thread Antonio Fiol Bonnín
s/charge/load/  ;-)

You could try to do it by hand. That is, if you are using taglibs, 
create a tag that does that (and includes the error management you 
need). Otherwise, use a static method that loads a URL and returns its 
content as a String (including the result of error management in that 
String). This way you get simple code like:

% =IncludeURL.load(some-url) %

It may be possible in other ways, but I am not aware of them. Someone?

Yours,

Antonio Fiol



Ferran Orsola wrote:

Hi everybody?

Someone can help me?

I've got two instances of tomcat running in two diferents machines. Also Ihave got apache server mapped with the two Tomcats using JK1.2 as:

VirtualHost 192.168.10.120
   JKMount /oasis-tl/* cms   # first instance of Tomcat
   JKMount /tl-intranet/* intranet# second instance of Tomcat
/VirtualHost
Now in one application located in /tl-intranet/ (2 instance of tomcat) I would like to charge content from the other instance of tomcat and I don't know how to do it.

I already tried using JSP Includes and Tomcat SSI.

JSP Includes can only charge content from the same context.
Tomcat SSI can charge content from same application of from same Tomcat, but not from 
another place.
Is it possible to charge content with any method using absolut path as http://www./ ??

Thanks 

Ferran Orsola
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Performance question JDBC vs Properties

2004-02-16 Thread Antonio Fiol Bonnín
I would write a reload config servlet. It will save you one JDBC 
access per request.

Antonio Fiol

Larraquy wrote:

Hi all, I've got this doubt. My applicacion uses some properties files to
config some events or constants, or whatever, but it's job basically is to
map the users click on a JSP, to a servlet and define what class should
take this event. So, every request comming to a JSP, will be a search in
this file. This is for writing only 1 Servlet.
For instance, if an user clicks ShowClients something like this should be
written at the file. Where this class is called to do the job.
ShowClients=com.jkt.proyect.clients.ShowClients

Or ShowProducts:

ShowProducts=com.jkt.proyect.products.ShowProducts

This file, should be as big as use cases in the system.

Actually we've written 2000 lines.

My problem, is that for reconfiguring this file, or adding lines to it, I've
got to reload the application. As we are at deploying time, this happens
quite often, so I've got to take users out of the system, and then, calling
them to continue working (they are quiete few until next month).
I'm thinking of sending to logic to a database, I mean configure this in a
table.
So if I've got 2000 records in this table, would it be much less performant
that writing it in a file, as it is now working?
Thanks in advance.



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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Tomcat very very slow when doing heavy XML processing

2004-02-15 Thread Antonio Fiol Bonnín
Try disabling name resolution (see previous posts, I can't remember how 
this is done), just in case.

How does your CPU perform? Is it idle all time, or completely busy?

Antonio Fiol

tom ly wrote:

I've got Tomcat set up as the middle component passing heavy XML data between and client and a backend and it is very very slow.  I've set a filter up to log the time it takes to process a request and loadtest with JMeter using 10 threads.  Takes around 25,000ms to get a response from looking at JMeter.  But when I look at the catalina logs, the times are not too bad, 700-800ms/request to receive and process a request.  Seems like most of the problem is with connection speed, not processing speed.  I've played around with my JAVA_OPTS and have got it to improve a bit, but I'm always getting the really high response times.  Here are my JAVA_OPTS = -server -Xincgc -Xmx1024M -Xmx1024 -Xmn100M -Xss100M  I'm using Sun SDK 1.4.1.  What else can I do to improve the performance?  What about using keepalive?

-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: how to increase tomcat performance

2004-02-15 Thread Antonio Fiol Bonnín
Hi,

I am not Filip, but in my case most hangings were caused by too low 
settings of Tomcat's maxThreads / maxProcessors or too low setting for 
the database connections accepted.

And as Deepak says he is using Apache in front, I'd also check the 
Apache, just in case.

To check, wait for it to hang, and before stopping tomcat, execute on 
every machine involved:

netstat -n | grep SYN_RECV

If you see a large (more than 2-3) quantity of lines there, the involved 
service (local IP:port) is the blocking one.

SYN_SENT would be the counterpart of this. However, as you will not 
notice the hang immediately, it is unlikely that you see the SYN_SENT. 
If you do, blocking service is (remote IP:port).

Hope that helps.

Antonio Fiol



Parsons Technical Services wrote:

Filip,

Does this symptom sound similar to problems with memory leaks?

Doug

- Original Message - 
From: Filip Hanik (lists) [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]; Deepak Hegde
[EMAIL PROTECTED]
Sent: Saturday, February 14, 2004 11:12 PM
Subject: RE: how to increase tomcat performance

 

first go over your configurations, make sure you have enabled enough
   

threads
 

for the connectors (read docs)

then get a performance profiler and go to work :)

tomcat is pretty optimized, so it could be something in your code

Filip



-Original Message-
From: Deepak Hegde [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 14, 2004 8:03 PM
To: [EMAIL PROTECTED]
Subject: how to increase tomcat performance
Hi All,

I am running Tomcat 4 and Apache 1.3 and Struts Framework on Sun Sparc
machine having O.S 5.8 version.
Web application is developed to use Postgres Database also.

I am facing lots of performance issues with Tomcat i.e sometimes when user
connection increases tomcat process hangs and website stops opening
and some times it goes very slow. The Problem gets sloved when i restart
   

the
 

tomcat service again.

Somebody please help me ..

Regards,
Deepak
   




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Servlet thread safety in Tomcat

2004-02-11 Thread Antonio Fiol Bonnín
Mike Curwen wrote:

1) if by 'localized' you mean I've moved the variables from outside the
doGet()/doPost() methods, to inside those methods... then this is why
there is no 'data corruption' (due to multithreading issues), and it's
why you don't require synchronized access to those variables.
 

You definitely do not need synchronized on local variables.

However, you DO need it if you use something shared among the 
requests. That is, outside the local scope.

I will probably explain this perhaps not 100% correctly, but someone
will catch me when I fall.. ;)
A user request = one java thread.
If more than one user requests something from your servlet, that means
(potentially) more than one thread in your servlet methods.
If one thread alters a variable outside of the doGet()/doPost() methods,
then this modifies that variable for ALL threads, and thus, you get data
confusion/corruption. It's a simple matter of scope.
If the thread alters a variable within the method, then this variable is
located in the method 'stack', and altering its value will only alter
the data for that particular thread.  So it is literally impossible to
'confuse' the data, if all of your variables are declared within the
method. Again, a matter of scope.
 

No objection ;-)


2) jmeter is an open-source web-testing tool.  Fairly simple, and works
quite nicely. You can use it to load test an application, and can
configure it to launch X threads simulatenously.  This would give you a
fair chance of testing concurrency issues.  'X' will be solely
determined by how much CPU and memory your testing box has.  Jmeter lets
you slave multiple workstations to use as load generators, so X can
become quite high (which is good).  

You can also configure jmeter to check the results of a particular web
request.  So for example, if a user submits a search to search.jsp with
a certain set of search values... and you expect a result in your page
of :
pyour search returned b500/b results/p 
Then you can actually test for this string in the returned webpage.  If
the '500' is something else (say '450'), then you can begin to suspect
concurrency issues.  (Because perhaps another of your simultaneous users
used a different set of parameters, say ones that would produce '450').
 

It will not be easy to pinpoint concurrency problems using JMeter.

The procedure is roughly what Mike described. However, you will need to 
know your data very well, and possibly output some debugging info in 
your pages (maybe inside a HTML comment).

It will not be easy.

From my experience, JMeter is really great for cases where border 
conditions make the server fail with a 500. You stress it, and it is 
more likely to fail. But detecting slight errors in the information 
contained in a page is a different business.

I wish I could give you an alternative, but I am afraid I know none.

Yours,

Antonio Fiol




smime.p7s
Description: S/MIME Cryptographic Signature


Re: 404 Error in examples

2004-02-11 Thread Antonio Fiol Bonnín
Didier McGillis wrote:

Sorry I never check 8080 when I got home, couldnt get to it from where 
I was at today to test.  That doesnt seem to be up either, I dont know 
how this got so fubar'd and no one seems to be owning up to it.

I dont see anything in the logs other then just normal startup 
information.  mod_jk is empty.  I get this in the apache error logs.

###
[Wed Feb 11 13:51:39 2004] [notice] Apache/2.0.48 (Unix) DAV/2 
PHP/4.3.4 mod_jk/1.2.5 configured -- resuming normal operations
[Wed Feb 11 15:11:24 2004] [error] [client 12.16.100.100] client 
denied by server configuration: 
/usr/local/tomcat/webapps/examples/WEB-INF/index.html
[Wed Feb 11 15:11:24 2004] [error] [client 12.16.100.100] client 
denied by server configuration: 
/usr/local/tomcat/webapps/examples/WEB-INF/index.htm
[Wed Feb 11 15:11:24 2004] [error] [client 12.16.100.100] client 
denied by server configuration: 
/usr/local/tomcat/webapps/examples/WEB-INF/index.jsp
###

Should I wipe tomcat and mod_jk and start over?  Is there something 
I'm missing


I imagine this comes from Apache's error_log.

In that case, that possibly means that you have a Deny from ... 
statement in your httpd.conf. Well, think twice about that...

Otherwise, no idea.

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: 404 Error in examples

2004-02-11 Thread Antonio Fiol Bonnín

[Wed Feb 11 15:11:24 2004] [error] [client 12.16.100.100] client 
denied by server configuration: 
/usr/local/tomcat/webapps/examples/WEB-INF/index.html
[Wed Feb 11 15:11:24 2004] [error] [client 12.16.100.100] client 
denied by server configuration: 
/usr/local/tomcat/webapps/examples/WEB-INF/index.htm
[Wed Feb 11 15:11:24 2004] [error] [client 12.16.100.100] client 
denied by server configuration: 
/usr/local/tomcat/webapps/examples/WEB-INF/index.jsp


Just noticed the WEB-INF part of the URL. What is it doing there? That 
should never be accessible, anyway.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: 404 Error in examples - found part

2004-02-11 Thread Antonio Fiol Bonnín
Didier McGillis wrote:

Yes Tomcat wouldnt start properly due to port 8005 was already in use 
and the new Tomcat couldnt bind to it.  Now I have gotten to a point 
where I'm unsure of how I fixed this yesterday.

Stand alone version of Tomcat is fine, JSP code works fine.  Go 
through Apache and it renders the HTML properly but doesnt seem to 
understanding whats happening on the page.

http://ns.serverwerkz.com/examples/jsp/num/numguess.jsp

Congratulations! You got it. And after just tries.
Care to try again? Welcome to the Number Guess game.
I'm thinking of a number between 1 and 100.

What's your guess?
Good guess, but nope. Try . You have made guesses.
I'm thinking of a number between 1 and 100.

What's your guess?

again this only happens if I access through apache.


As I see you have everything in the same box...

Make sure your DocumentRoot is NOT pointing to the webapps folder of 
Tomcat. Set it to any other place you like, but not there ;-)

It seems that Apache is not asking Tomcat but is serving the content itself.

Yours,

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Help! Config of multiple hosts and JVM garbage.

2004-02-10 Thread Antonio Fiol Bonnín
Hi Sergio,

1) public_html would be enough, AFAICT.

3) What I meant is: if you have 512Mb RAM, set your JAVA_OPTS=-Xmx256m 
(as I understand that you may have half your RAM free when Tomcat is not 
running). The idea about buying more RAM was a kind of a joke, 
especially because I did not know how much RAM you had. 512Mb should be 
enough in most cases, if you do not have memory leaks in your apps. If 
you do, no amount of RAM will be enough.

Watch your top / free / whatever to see if you are eating up all RAM 
and start swapping. If you do, and it is not a transient peak situation, 
you are eating too much, and should lower the -Xmx to some lower value.

If your apps need more memory, you will get OutOfMemoryError in your 
catalina.out. In that case, raise your -Xmx.

And yes, you understood well, if you have to lower it, and also to raise 
it, that means RAM is not enough ;-)

Yours,

Antonio Fiol

Sergio wrote:

Hello, Antonio.
1) You are absolutely right about mounting, but also I figure it out
with jk2 connector (I find it in docs - it seems I was a little tired to find it
before:)). I've tryed to done it with mod_jk, but the problem was that
I want to give access to their sites with FTP and limit this space up
to public_html for each user and do not give them permissions to
access to webapps for example.
2) Thanks it helps!
3) Yeap;) you right its garbage collection. Thanks for suggestions.
I have just 512 RAM (its HP ML330) - I know its not enough but we are
poor people:)
Thank you for help!!!

AFB Sergio wrote:

 

Hi All! Guys, I need help!
My system is Windows 2003 Enterprise Server with Apache 2.0.48
I need Windows for 3rd part application, but because I hate IIS so I am
using Apache2(the best!!!).
1)Does somebody can help me with configuration of Tomcat 5.0.18
for multiple hosts? I need to deploy
servlets separately for each user. Access will be configured in
httpd.conf of Apache2.0.48 Some people uses multiples instances of Tomcat for each 
user.
Somebody uses one instance of Jboss with various deployed folders (its actually my 
configuration
now). But I need to do that trick with Tomcat. The biggest problem for
me now - its to configure server.xml for two or more hosts. I cant
find it in documentation. If you can help with with any tips and/or your examples of
httpd.conf, workers.prop..s etc. (all related parts of configuration
of the servers) - please help.
 

AFB I have never set up VirtualHosts in Tomcat. But if you do not need to
AFB have a root app, you do not need to (or at list I did not need to).
AFB Just mount the apps you need in the Apache VirtualHosts you need, and
AFB you are done.
 

2) How I can configure memory management for Tomcat (limits for memory using for each
process/application)? Is it possible somehow?
 

AFB Not possible when using a single JVM.
AFB If you use multiple instances of Tomcat, you can set -Xmx256m (or
AFB whatever amount you need) in JAVA_OPTS environment variable. That will
AFB effectively limit the amount of memory used by your heap.
 

3) I have a problem with garbage of JVM caching. Any suggestions how I
can organize autocleaning? How can I minimize the usage of the disk
in this case?
 

AFB What do you mean by disk usage? How is that related do autocleaning,
AFB which I understand as garbage collection?
AFB Do you mean swapping? If so, ensure that your JVM is at most as big as
AFB your free _real_ memory. Otherwise, your OS qill start swapping unused
AFB bits. Then, the GC will reclaim them for collection. So, you are 
AFB accessing the disk at least twice for something you could have avoided.
AFB (Side note: Get more RAM ;-)

AFB In any case, profiling your applications is a good way to go: you willl
AFB determine whether your app grows in memory usage with time, or if it
AFB remains constant. (Consider the former a bug.) If memory usage remains
AFB constant, you can stress your app, and determine how much memory it
AFB needs for full load, and then you may allow it (JAVA_OPTS) no more
AFB than that, knowing it will work.
AFB Yours,

AFB Antonio Fiol



 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Help! Config of multiple hosts and JVM garbage.

2004-02-09 Thread Antonio Fiol Bonnín
Sergio wrote:

Hi All! Guys, I need help!
My system is Windows 2003 Enterprise Server with Apache 2.0.48
I need Windows for 3rd part application, but because I hate IIS so I am
using Apache2(the best!!!).
1)Does somebody can help me with configuration of Tomcat 5.0.18 for multiple hosts? I need to deploy
servlets separately for each user. Access will be configured in
httpd.conf of Apache2.0.48 Some people uses multiples instances of Tomcat for each user.
Somebody uses one instance of Jboss with various deployed folders (its actually my configuration
now). But I need to do that trick with Tomcat. The biggest problem for
me now - its to configure server.xml for two or more hosts. I cant
find it in documentation. If you can help with with any tips and/or your examples of
httpd.conf, workers.prop..s etc. (all related parts of configuration
of the servers) - please help.
 

I have never set up VirtualHosts in Tomcat. But if you do not need to 
have a root app, you do not need to (or at list I did not need to). 
Just mount the apps you need in the Apache VirtualHosts you need, and 
you are done.

2) How I can configure memory management for Tomcat (limits for memory using for each
process/application)? Is it possible somehow?
 

Not possible when using a single JVM.
If you use multiple instances of Tomcat, you can set -Xmx256m (or 
whatever amount you need) in JAVA_OPTS environment variable. That will 
effectively limit the amount of memory used by your heap.

3) I have a problem with garbage of JVM caching. Any suggestions how I
can organize autocleaning? How can I minimize the usage of the disk
in this case?
 

What do you mean by disk usage? How is that related do autocleaning, 
which I understand as garbage collection?

Do you mean swapping? If so, ensure that your JVM is at most as big as 
your free _real_ memory. Otherwise, your OS qill start swapping unused 
bits. Then, the GC will reclaim them for collection. So, you are 
accessing the disk at least twice for something you could have avoided. 
(Side note: Get more RAM ;-)

In any case, profiling your applications is a good way to go: you willl 
determine whether your app grows in memory usage with time, or if it 
remains constant. (Consider the former a bug.) If memory usage remains 
constant, you can stress your app, and determine how much memory it 
needs for full load, and then you may allow it (JAVA_OPTS) no more 
than that, knowing it will work.

Yours,

Antonio Fiol



smime.p7s
Description: S/MIME Cryptographic Signature


Re: tomcat 5. some basic questions

2004-02-08 Thread Antonio Fiol Bonnín
Hi,

That depends mostly on your application. When we developed our app, some 
developers used 4.1.27 and other 5.0.16 (IIRC), and the app is 
compatible with both. I do not recall needing to make a special effort 
to keep compatibility. So you still may have hope ;-)

Main difference, in our case, was the place where we configured our 
connection pool: server.xml in one case, and context.xml in the other. 
Other than that, nothing impressive.

Yours,

Antonio Fiol



Hernani Mourão wrote:

You will experience a lot of problems making the applications running in
this new version. I had everything ok and running under Tomcat 4.1.x and I
made the terrible mistake of changing the version. It seems it is due to the
way the context.xml is supposed to work in this new version. I am not an
expert, and I have seen a lot of debate but on this list but I was not good
enough to get any conclusion yet and my application is not running yet. It's
driving me nuts . . . . .
Be very careful with your decision, and good luck to u. I did not have any.
. . .
Hernâni
-Original Message-
From: Dionisio Ruiz de Zarate [mailto:[EMAIL PROTECTED]
Sent: sábado, 7 de Fevereiro de 2004 13:17
To: [EMAIL PROTECTED]
Subject: tomcat 5. some basic questions
hello.
i have one machine in production mode with apache 2 and tomcat 4.1.29.
i am thinkin for using tomcat 5.
i have several questions:
1.- the tomcat 5 configuration i diferent, comparing with the tomcat 4.1.29
configurarion? (vitual domains, db connecion pools using Commons DBCP..)
2.- when i try to download the tomcat i see that there is:
Tomcat 5.0.18 zip PGP MD5
5.0.18 Deployer zip PGP MD5
5.0.18 Embed zip PGP MD5
what are the two last ?(5.0.18 Deployer zip PGP MD5, 5.0.18 Embed zip PGP
MD5 ) i need it for using tomcat in production mode?
for connection apache2 with tomcat 4.1.29 i download the connectors sourcrs,
i compile them. for using tomcat 5 this step is diferent?
thanks for reading my question and thanks for your help

Sorry for my bad english

 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Errors not going to error-page

2004-02-06 Thread Antonio Fiol Bonnín
Not sure if you can use /WEB-INF/... there.

However, I recall some Tomcat versions ignoring error-page in some 
cases. IIRC, it was 4.1.18.

HTH,

Antonio Fiol

Wendy Smoak wrote:

I'm getting an Status 500 page with this:
ExceptionConverter: java.io.IOException: The document has no pages.
Even though I have this in web.xml:
  error-page
 exception-typejava.io.IOException/exception-type
 location/WEB-INF/jsp/exceptions/Exception.jsp/location
  /error-page
What did I miss?

 




smime.p7s
Description: S/MIME Cryptographic Signature


mod_jk as a load balancer - Am I missing something obvious?

2004-02-04 Thread Antonio Fiol Bonnín
Hello,

I have tried to configure mod_jk as a load balancer WITH sticky sessions.

I get the load balancing to work perfectly, but NOT the sticky sessions.

This is what I tried:

I set up 4 ajp13 workers and 2 lb workers.

Worker names are t1_a, t1_b, t2_a and t2_b.
Load balancer names are a and b, and they point to:
a -- t1_a, t2_a
b -- t1_b, t2_b
t1_a -- tomcat 1 port X
t1_b -- tomcat 1 port Y
t2_a -- tomcat 2 port X
t2_b -- tomcat 2 port Y
On Tomcat 1, jvmRoute is t1.
On Tomcat 2, jvmRoute is t2. (So, jvmRoutes are set-up).
Am I missing something very obvious?

Do jvmRoutes need to have the same name as the workers? I find that 
strange, but I can't come up with something more logical...

Thank you for any tip.

Yours,

Antonio Fiol

P.S.: I am using two connectors on each Tomcat because one is configured 
with scheme=http secure=false, and the other is scheme=https 
secure=true. Our app relies upon that.


smime.p7s
Description: S/MIME Cryptographic Signature


Re: mod_jk as a load balancer - Am I missing something obvious?

2004-02-04 Thread Antonio Fiol Bonnín
Thank you, Dave.

Do jvmRoutes need to have the same name as the workers? 
   

Yes, they do.
 

Then that means I cannot have two AJP connectors on each Tomcat.

Proposed setup is, then:
Worker names are t1 and t2
Load balancer name is t:
t -- t1, t2
t1 -- tomcat 1 port X (jvmRoute=t1)
t2 -- tomcat 2 port X (jvmRoute=t2)
On Apache I have:
VirtualHost hostname:80
...
JkMount /myapp/* t
#was a
/VirtualHost
VirtualHost hostname:443
...
JkMount /myapp/* t
#was b
/VirtualHost
Or, if we remove the hassle of load balancing, I can just JkMount 
/myapp/* t1, which is what I initially had (several months ago). But 
then...

How do I get request.isSecure() and request.getScheme() working 
properly? I.e. How can I detect whether the user is coming in through 
HTTP or HTTPS? They ALWAYS return false and http respectively, 
regardless of what protocol the user used.

Previously, I did it by adding secure=true scheme=https to one 
connector on each Tomcat. Now I cannot, as I only have one connector!!

Thank you for any further guidance.

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Session disconnect

2004-02-02 Thread Antonio Fiol Bonnín
Sessions do not, but the underlying cookies may. It was just a suggestion.

Antonio Fiol

Mark Tebong wrote:

I don't think it has anythin to so with cookies because sessions don't
use paths. 

-Original Message-
From: Antonio Fiol Bonnin [mailto:[EMAIL PROTECTED]
Sent: Sunday, February 01, 2004 3:30 AM
To: Tomcat Users List
Subject: Re: Session disconnect


Mark Tebong wrote:

 

I have it configured so that when a request for a URL (say
   

www.mydom1.com) comes in, the proxy sends it to 192.168.11.211/mydom1. 
 



   

 

When I access the pages of the site that use the session thru
   

www.mydom1.com, I get an exception. When I access it through
192.168.11.211/mydom1, it works fine.
 



   

 

I looked at the tomcat logs and I saw that the session was
   

disconnecting when you used the proxy. 
 



   

Hi,

No idea about the images stuff, but...

Could you be having trouble because of the path attribute of the
cookies?
If Tomcat (or your webapp) is setting it to /mydom1 then browsers will

not send it when accessing /.

HTH,

Antonio Fiol

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




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Yet another OT question.

2004-02-02 Thread Antonio Fiol Bonnín
When we insert duplicates, we do get SQLException as a response. We are 
using Oracle 9.2, however.

No idea why they behave differently. What does the DB do if you insert 
duplicates from sqlplus or a similar tool?

Antonio Fiol

George Sexton wrote:

The error is signaled by getting 0 back as the number of affected
records.
-Original Message-
From: David Short [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 02, 2004 10:16 PM
To: 'Tomcat Users List'
Subject: RE: Yet another OT question.

My statement is performing an insert, which would not return a result
set.
An executeQuery() would return a result set.  I too, read the
description
about returning an int.  I intentionally tried inserting a duplicate
value
in the index, trying to force an error, and no error was generated.  The
return value was 0.  So, it is returning zero (nothing was inserted) but
that's it.  No SQLException.  There's got to be a way to catch an error
like
this.
-Original Message-
From: George Sexton [mailto:[EMAIL PROTECTED]
Sent: Monday, February 02, 2004 8:10 PM
To: 'Tomcat Users List'; [EMAIL PROTECTED]
Subject: RE: Yet another OT question.
I broke out my JDBC handbook (JDBC API Tutorial and Reference, Second
Edition) and it says:
Returns an int indicating the number of rows affeted by an
INSERT,UPDATE, or DELETE statement; 0 if no rows were affected or the
statement executed was a DDL statement.
Throws SQLException if the sepcified argument is a statement that
generates a result set.
From reading this, it appears the driver is compliant and working per
the specification.

-Original Message-
From: David Short [mailto:[EMAIL PROTECTED]
Sent: Monday, February 02, 2004 7:59 PM
To: 'Tomcat Users List'
Subject: RE: Yet another OT question.
I pulled the latest (1.2 for Oracle 8.1.7) off of Oracle's web site
today.
-Original Message-
From: George Sexton [mailto:[EMAIL PROTECTED]
Sent: Monday, February 02, 2004 6:33 PM
To: 'Tomcat Users List'; [EMAIL PROTECTED]
Subject: RE: Yet another OT question.
Probably a flake in the Oracle driver. Check you are using the latest
one.
-Original Message-
From: David Short [mailto:[EMAIL PROTECTED]
Sent: Monday, February 02, 2004 4:18 PM
To: 'Tomcat Users List'
Subject: Yet another OT question.
It seems like a slow day on the list so, thought I'd throw my issue out
there.
I'm working with Tomcat 4.1.0, Oracle 8.1.7 and JDBC 1.2.  It seems that
the
JDBC executeUpdate() method doesn't raise an exception when I pass an
incorrect SQL statement.  It returns 0 rows, but no exception.  Anyone
seen
this before?
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Session disconnect

2004-02-01 Thread Antonio Fiol Bonnín


Mark Tebong wrote:

I have it configured so that when a request for a URL (say www.mydom1.com) comes in, the proxy sends it to 192.168.11.211/mydom1. 
 


When I access the pages of the site that use the session thru www.mydom1.com, I get an exception. When I access it through 192.168.11.211/mydom1, it works fine.
 


I looked at the tomcat logs and I saw that the session was disconnecting when you used the proxy. 
 

Hi,

No idea about the images stuff, but...

Could you be having trouble because of the path attribute of the cookies?

If Tomcat (or your webapp) is setting it to /mydom1 then browsers will 
not send it when accessing /.

HTH,

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Measuring latency between tomcat instances [Off list-topic answer]

2004-01-22 Thread Antonio Fiol Bonnín
Jeremy Nix wrote:

Okay, let me pose another (slightly differenc) question.  Say that
instance (A) and (B) are separate institutions, independent from each
other.  Same scenario as before.  How could instance (B) (the responding
instance) be able to measure latency in instance (A)?  The reason I ask
is related to an issue that has been reported to me, but I am unable to
understand how the latency was measured.
 

Is it HTTP or HTTPS? If HTTPS, things get more kludgy, but if it is 
HTTP, there is a fairly simple way:

1. start a network analyzer (such as Ethereal) on Tomcat B network.
2. Capture packets until you see a client request that needs a 
redirection (I'm pretty sure you have one in your app)
3. You will see some time later a client request for the redirected 
resource.
4. Measure the time since the last bit of the redirection until the 
first bit of the redirected request.
5. Divide by 2.

With HTTPS, you won't see anything useful on the network analyzer, 
unless you know very well the usage pattern. Ig the usage pattern is 
known and constant, you can do the same, by imagining what you see.

Or, you may even go down a bit more, and this works for both HTTP and 
HTTPS, and it may be even simpler (no need to have a redirection):

1. Start a network analyzer on TC B network
2. Capture packets until you see (it should not be a long time ;-) TCP 
packets like these:
Packet 1: A - B Flags: SYN
Packet 2: B - A Flags: SYN ACK
Packet 3: A - B Flags: ACK
3. Measure difference between packet 2 and packet 3.
4. Divide by 2.

Of course both procedures assume that network latency is symmetrical.

Hope that helps.

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: how to turn off Chunking for Tomcat 4.1.29?

2004-01-22 Thread Antonio Fiol Bonnín
There has been a recent thread on this. I think there was a nice amount 
of info on that thread. Search the archives for it.

Yours,

Antonio Fiol

Rasmus Munk wrote:

Hi

Is it possible to turn off chunking for tomcat?

Is chunking only used when using HTTP 1.1 or is it also used when using the
j2k-connector?
thanks?

-Rasmus

 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Tomcat - Automatically writes a session?

2004-01-20 Thread Antonio Fiol Bonnín
You have to specify it on the JSP pages. I can't remember it properly, 
but it must be something like:

@page session=false @

Google for it on the Tomcat site. I think you will find it.

Antonio Fiol

Neal wrote:

Someone just pointed out that my JSPs are have this in the header:

Set-Cookie: JSESSIONID=97C8777F16379B8EC2CD17273CE35C3C; Path=/

The problem is that I'm not setting any sessions or cookies from the
page so I have no idea what's going on.  Is there some reason this is
there?  Is there some setting in the Web.xml and/or server.xml file that
I must tweak?
PS - I use Tomcat has my http server, not apache (in case that's
meaningful).
Thanks.
Neal
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Tomcat - Automatically writes a session?

2004-01-20 Thread Antonio Fiol Bonnín
Neal wrote:

I used the tag [EMAIL PROTECTED] session=false% which does appear correct,
but I'm still seeing that header:
Set-Cookie: JSESSIONID=97C8777F16379B8EC2CD17273CE35C3C; Path=/

There are two reasons why I want to get rid of this:

1. I assume I'm waiting server resources holding open a session for
every user, unnecessarily.
2. I've been told this may prevent Google from properly spidering the
site.
Can you please shed any more light on how to fix this potential issue?
 

Probably not, but I will try...

Did you clear the cookies on your browser? If the browser is saying Hi! 
XXX is my session ID, then, (iif that session exists), tomcat is free 
of saying Hi! keep your session ID, which is XXX

Other than that, no idea. I have never struggled to avoid cookies. 
Sorry. I was only echoing something I have read in the past.

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Sharing among session of ONE application

2004-01-13 Thread Antonio Fiol Bonnín

So, that should mean that all I really have to do is defined the information in instance variables.  Right?
 

There is however an important risk related to this approach.

AFAICT, you are not guaranteed that there is a SINGLE instance of each 
servlet. It will be implementation-dependent.

So, either going for static and not instance variables, or following 
Filip's or Yoav's advice are your best bets.

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Datasource - OK in app context - Fails in Global context

2004-01-11 Thread Antonio Fiol Bonnín
So, could someone summarize for me the different ways of creating a JDBC 
DataSource in Tomcat?

I will start the summary, so that it's easier to correct/complete. 
Please fill in the gaps ;-)

1. Have the DataSource defined in your application's context.
   That way, if you have two apps, you have to copy the datasource 
definition from one to the other.
   Two connection pools will be created.

2. Have the DataSource defined in DefaultContext.
   If you have two apps, you need to ...
   ... connection pool(s) will be created.
3. Have the DataSource defined in GlobalNamingResources.
   If you have two apps, you need to ResourceLink in both contexts.
   ... connection pool(s) will be created.
Thank you very much.

Antonio Fiol

Jacob Kjome wrote:

At 03:44 PM 1/9/2004 -0600, you wrote:

Bingo!!!  That was it.

It might be a good idea to add a paragraph to the JDBC DataSources 
section of the documentation that mentions:

(a) That global datasources are defined in GlobalNamingResources of 
server.xml
(b) The need for the ResourceLink in the application context .xml file

I had the mistaken impression that anything placed in the server.xml 
file was automatically applied to all application contexts.  I am 
sure that others make the same mistake.

Thanks, I have been pulling my hair on this issue for almost a month.


This is true for DefaultContext.  Maybe you were confusing 
GlobalNamingResources with that.  The latter lets you define things 
once and let applications link to it if they want the service whereas 
the former makes the service available for every app whether it is 
wanted or not.

Jake





smime.p7s
Description: S/MIME Cryptographic Signature


Re: Microsoft SQL Server validation query

2004-01-09 Thread Antonio Fiol Bonnín
Hooper, Brian wrote:

These queries all seem like an awful lot of unnecessary processing.  Here's what I use:

SELECT 1+1
 

Indeed. If your server supports it, there is an even simpler one: 
select 1 or select 0.

But this is not correct SQL for an Oracle server. Equivalent Oracle 
syntax is select 1 from dual.

But on other servers, dual does not exist by default. Well... you see 
what I mean...

Antonio


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Microsoft SQL Server validation query

2004-01-08 Thread Antonio Fiol Bonnín
For any database server I can think of:

CREATE TABLE validation ( dummy char(1) );
INSERT INTO validation VALUES ( 'X' ); -- and make sure you do this only 
once

And then use as a validation query:
SELECT * FROM validation;
Well. Yes. I am ashamed of reimplementing Oracle's DUAL, but if you 
really want to know of a table that will always be there, provide it 
yourself.

And anyway, I mostly agree with Mike's statement about server-specific 
params in the config files: Adding one more ... is not too much of a 
burden.

Only if you set the validation query from outside the config files, 
which is very unlikely, Mike's statement would not strictly apply IMHO.

Antonio Fiol

Derek Mahar wrote:

Thank you to all of you for your quick replies.  It seems that the
connection pool validation query is not specific to any database server
implementation unless the query statement itself is server-specific
(that is, it refers to a special server system database, table, or
function).  I like the idea of querying the server for the date, but I'm
not sure that the date function is standard SQL and portable across all
server implementations.  Does anyone know otherwise?
Derek

-Original Message-
From: Peter Lin [mailto:[EMAIL PROTECTED] 
Sent: January 8, 2004 10:35 AM
To: Tomcat Users List
Subject: RE: Microsoft SQL Server validation query



in the past I just select the date from sql server. unless you want to
test a specific table, but that has potential performance impact.
the safe simple query to see if sql server is alive is to just select
the date.
peter lin

Allistair Crossley [EMAIL PROTECTED] wrote:
I would not do that because that would return as many 1s as there are
rows in the table. Something like count(*) may not be the most efficient
but it returns just 1 row always. Also with using 1, you cannot
guarantee a row will come back.


Allistair Crossley
__ 

Intranet Senior Developer
New Media Group, QAS Ltd
Telephone: 020 7819 5343
__
-Original Message-
From: Michael Duffy [mailto:[EMAIL PROTECTED]
Sent: 08 January 2004 15:25
To: Tomcat Users List
Subject: RE: Microsoft SQL Server validation query


Or even SELECT 1 FROM TABLE. No COUNT overhead, if
any. - MOD
--- Allistair Crossley 
wrote:
 

i think you could use anything .. maybe

SELECT COUNT(*) FROM table

The dual table is an oracle dummy table and is quite
handy, but I think the validation query can just be
any old select statement that should return true a
result always.
ADC

-Original Message-
From: Derek Mahar [mailto:[EMAIL PROTECTED]
Sent: 08 January 2004 15:15
To: Tomcat Users List
Subject: Microsoft SQL Server validation query
Does anyone happen to know which validation query I
should use for
Microsoft SQL Server?
Derek

   




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Tomcat stops handling HTTP connections, socket is SYN_RECV

2004-01-07 Thread Antonio Fiol Bonnín
I have not read through all the thread, so maybe I am repeating 
something. If so, sorry about being lazy.

You seem to be hitting maxProcessors. If you do, no more threads are 
created, and connections start getting into SYN_RECV state, simply 
because Tomcat is not accept()ing them, exactly as you told it to do.

So, either reduce your concurrency level for the tests, or increase 
maxProcessors.

Maybe there is also sth wrong with the (deprecated) connector code, as 
suggested by someone else. But even with non-deprecated connectors and 
recent Tomcats, you will have a very bad user experience if you hit 
maxProcessors.

If you were using Apache in front of Tomcat (which I know is not your 
case), thigs get even worse. In that case, you must ensure that Apache's 
MaxClients is below Tomcat's maxProcessors, and if you have a firewall 
in the middle, you must also ensure that you are using 
worker.something.socket_timeout=300 or something like that in 
workers.properties, so that your firewall does not mess things up. 
(Assuming mod_jk)

Hope that helps.

Antonio Fiol

Frode E. Moe wrote:

On Mon, Oct 27, 2003 at 13:29:50 +0100, Remy Maucherat wrote:
 

On Fri, Oct 24, 2003 at 16:01:48 +0200, [EMAIL PROTECTED] wrote:
 

When everything quiets down, tomcat seems to be unable to service
any http requests. Any attempt to connect to port 10003 with a web
browser eventually causes a No data in response-style error message.
At this point it seems the http connector listening on port 10003 has
gone zombie on me: 
   

I've figured out what's going wrong.
The following exception is printed once on standard out when things
fail:
java.lang.OutOfMemoryError: unable to create new native thread
  at java.lang.Thread.start(Native Method)
  at 
  org.apache.catalina.connector.http.HttpProcessor.threadStart(HttpProcessor.java:1178)
  at 
  org.apache.catalina.connector.http.HttpProcessor.start(HttpProcessor.java:1262)
  at 
  org.apache.catalina.connector.http.HttpConnector.newProcessor(HttpConnector.java:937)
  at 
  org.apache.catalina.connector.http.HttpConnector.createProcessor(HttpConnector.java:868)
  at 
  org.apache.catalina.connector.http.HttpConnector.run(HttpConnector.java:1075)

I looked into the source for HttpProcessor briefly; perhaps the
thread.start() on line 1178 or the threadStart() call on line 1262 
could be surrounded with a try/catch(OutOfMemoryError), and throw a 
LifecycleException?
 

Any reason for using this connector ? It's deprecated.

BTW, once there's an OOM exception, the VM is in an unpredictable state, 
and must be restarted.
   

If it is of any interest, I have recently started experiencing the same problem 
again, while doing some profiling work on a webapp. 

I'm now running Tomcat 4.1.29 on Linux 2.4.24 (i386) with Sun Java
1.4.2_02. I have also changed server.xml to use the newer Coyote
connectors:
   Connector className=org.apache.coyote.tomcat4.CoyoteConnector
  port=10003 minProcessors=50 maxProcessors=500
  enableLookups=true redirectPort=8443
  acceptCount=10 debug=100 connectionTimeout=6
  useURIValidationHack=false disableUploadTimeout=true /
When running with the following java options:
-Xrunhprof cpu=samples,thread=y;depth=10,cutoff=0,format=a,file=/tmp/log.txt -Xms64m 
-Xmsm1024m
and pounding the webapp with 1000 HTTP requests simulatenously, I got
the following on System.out:
07.jan.2004 09:27:41 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable run
SEVERE: Caught exception executing [EMAIL PROTECTED], terminating thread
java.lang.OutOfMemoryError: unable to create new native thread
   at java.lang.Thread.start(Native Method)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.init(ThreadPool.java:630)
   at org.apache.tomcat.util.threads.ThreadPool.openThreads(ThreadPool.java:505)
   at 
org.apache.tomcat.util.threads.ThreadPool.findControlRunnable(ThreadPool.java:324)
   at org.apache.tomcat.util.threads.ThreadPool.runIt(ThreadPool.java:304)
   at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:557)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
   at java.lang.Thread.run(Thread.java:534)
..after which any attempt to connect to the http port (10003 in this
case) results in java holding a half-opened connection in SYN_RECV, 
as shown by netstat -apeln | grep 10003:

tcp0  0 0.0.0.0:10003   0.0.0.0:*   LISTEN  1001   47392370   27230/java  
tcp0  0 127.0.0.1:10003 127.0.0.1:41269 SYN_RECV1001   0  -
(and several in CLOSE_WAIT state)

Other threads keep running, so the VM _seems_ stable, except for the
fact that it's no longer possible to connect to the HTTP port.
To me, it seems like it should be possible to recover from this error.
Any comments?



Re: /devices/pseudo/mm@0:null

2003-12-12 Thread Antonio Fiol Bonnín
Hello,

Not that I have used Tomcat on Solaris a lot, but I have never seen that 
file.

A general advice is to check that you close everything you open.

Antonio Fiol

Hollerman Geralyn M wrote:

While using Tomcat, I have often encountered a problem (a 
java.net.SocketException) with Too many open files. I understand 
that to combat this, I need to up the limit on file descriptors in my 
Solaris 8 system (ulimit command). The system went from 256 - 1024 
descriptors, but I still get the error, and in listing the open files, 
I will see /devices/pseudo/[EMAIL PROTECTED]:null as being used by my Tomcat 
process - over and over and over. I take it the Tomcat process is 
writing to null? Is it supposed to do that - or so much of it? Or 
does this indicate a problem somewhere?

Thanks!



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


Re: response.reset() and forward() ... problematic? DBCP related?

2003-12-11 Thread Antonio Fiol Bonnín

So . what your telling me, is that it's a concurrency problem
created by having object attributes?  That if they were, in fact being
called more like:
	doProcess2 ();

than like:

	doProcess1 ();

I wouldn't have these problems?  Very interesting.
 

Not quite. I don't really understand your structue, but it seems it 
needs some refactoring.

Please write back and ensure that's what you mean . because I'm
pretty sure it is.  Oh, fun.  Here I go to change  some 100K lines
of code :-)
 

As a rule of thumb, do not let your req and res leave local scope 
(do not store them anywhere [attribute, static attribute, other 
object, ...]).

If you need help with the refactoring and I can access your code, I 
might help on saturday. (Which timezone do you live on?)

Yours,

Antonio Fiol


smime.p7s
Description: S/MIME Cryptographic Signature


Re: response.reset() and forward() ... problematic? DBCP related?

2003-12-10 Thread Antonio Fiol Bonnín
Answer included in your text, and at the end.

Anthony Presley wrote:

[...] and I'm having a lot of errors, which
scale based on the number of users.  For instance, assuming I have
around 10 people working on the system, I will have no errors.  As that
number scales, it becomes a huge problem, and lots of error's start
showing up.  I've tracked down and squashed most of the DB errors, but
am left with the following quandry:
 

It smells like a concurrency problem.

I'm not storing any data in the session, and use forward() ... a lot. 
When the following code executes, and I only open one request (ie, I
click on the link to open a new window which fetches a servlet
response), it works flawlessly.  When I click more than once, I start
getting forward() errors.
 

Smell is getting intense ;-)

Here's some code snippets:
 

[... reduced to a minimum, but the problem still there ...]

 protected void forward(String s) {
 ServletConfig sc = null;
 ServletContext sContext = null;
 RequestDispatcher rd = null;
 
 sc = this.getServletConfig();
 sContext = sc.getServletContext();
 rd = sContext.getRequestDispatcher(s);
 rd.forward(req, res);
 

Hey! Where are you getting req and res from?!! My guess at the end.

3.  I've bumped the response buffer (in the servlet) from 8K to 75K
(75000), which reduces the errors, but they are still present.  Is there
a GOOD way to estimate the amount needed?
 

No need to increase anything. It might alleviate the problem or even 
improve performance (??), but not solve anything.

4.  Using DBCP 1.0  using the latest DBCP (1.1?), seems to reduce
the errors further (1 in 10, approx).  I've rewritten the code to ensure
that connections are being opened / closed locally, and quickly.  Timing
it shows that the DB connection is pulled from the pool for about 2300
milli, and the JSP runs for about 2 milli to display.
 

Same here. The shorter your DB connections are open, the better, but 
this will not solve your problem.

I'm not 100% sure yet if the problem persists in the JSP (using a simple
JSP and simple servlet does not cause these problems, however, the
greater the complexity, the higher the likelihood of getting these
errors  which baffle's me, because rerequesting it shows up fine,
with nothing in the logs) or the servlet.
 

But the greater the complexity, the greater your chances to get two 
users using your servlet concurrently.

Anyone seen this before?  I'm about at my wits end.  Been refactoring
for a week now, and still it persists.
 

Yes. I found it to be a very common mistake. Now you know where the 
problem lies, you probably already thought of a solution specific to 
your case.

My guess:

req and res are attributes of the Servlet, like in:
public class TestServlet extends HttpServlet {
private HttpServletRequest req;
private HttpServletResponse res;
[...]
}
So you are calling forward(s) for a request once req and res have been 
overwritten by another request.

Just in case my English is too bad, and so that the archive is useful 
for people searching it:

- NEVER use object attributes in Servlets, as a rule of thumb.
- ALWAYS use local variables instead.
If you really cannot follow the above, then:

- Make sure that you need ONLY ONE INSTANCE of the object stored in that 
attribute.
- One instance for: all concurrent users, and all successive requests.
- Make sure that this instance is THREAD SAFE.
- A typical example of this is the use of a logger.
- Another example are STATIC attributes, which are, in general, less 
error-prone in this context.

If you really cannot follow any of the above, there is still one solution:

- Make sure your servlet implements SingleThreadModel. This will 
ensure a different instance is used for all concurrent requests, or that 
no concurrent requests will occur.

Hope that helps.

Antonio Fiol



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


Sticky sessions - How to configure Apache?

2003-12-01 Thread Antonio Fiol Bonnín
Hello,

I have TWO Apache and THREE Tomcat servers. I tried to configure them to 
use mod_jk and sticky sessions.

Namely, I simply added jvmRoute=something to every server. A different 
something for each, as explained on the docs. I see it at the end of 
JSESSIONID cookie, so I must believe it is working.

However, sessions do not seem to be sticky. I am quite puzzled. Does 
one have to configure something on the Apacle workers.properties? I have 
not found anything...

Thank you very much.

Antonio Fiol

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


Re: GZIP-encoding/mod_gzip and Tomcat??

2003-11-30 Thread Antonio Fiol Bonnín
Ron Andersen wrote:

Is GZIP-encoding/mod_gzip avaliable in Tomcats web server?
 

Hello,

You can write a ServletFilter, and a HttpServletResponse wrapper to 
achieve the same results.

Look into java.util.zip.*

-- I never said it was easy ;-)

Antonio Fiol

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


  1   2   >