Pete Storey is out of the office.

2004-03-22 Thread pete . storey
I will be out of the office starting  22/03/2004 and will not return until
28/03/2004.

Thanks for the mail!  I am away until the 28th.  If you would like an
urgent response then please ring Kiss on 020 7692 9922.
thanks
Pete



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



IIS logging of page requests

2004-03-01 Thread pete . storey
Hi,
I need to analyse the logs of a site powered by Tomcat 4.1.27 and IIS, 
using the JK2 redirector DLL.  Whenever a request gets put through, it 
logs it to /jakarta/isapi_redirector2.dll instead of the actual URL it 
went to eg /index.html .  Is there any way to get IIS to log the URLs as 
entered instead of like this or do you have to write some custom logging 
component?
thanks
Pete Storey

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923
Out of hours
Support phone 020 7692 9933

URL rewriting and context paths

2004-02-02 Thread pete . storey
Hi,

Im trying to use url rewriting (in this case ISAPI Redirect) to translate 
a search engine friendly URL (ie xyz.com/123_keyword_product_name.html) 
into a tomcat one (xyz.com/app/product.do?id=123).  This all works fine 
and dandy however there is a big problem with it.  One of the uses I have 
is to map tomcat applications to the root context as far as the URL is 
concerned, but leave them under another context within tomcat itself.
I use a shared tomcat server for several applications so they cant all be 
on the root, but reponses to search engines are a lot better if the URL 
appears that way.  The problem is that in the above example, the Tomcat 
server responds with Set-Cookie: JSESSIONID=132456789; Path=/app.  This 
Path is of course that of the context path of the application.  The 
browser doesnt thus send this cookie with the next request because the 
request appears to be to the / path;  Tomcat thus gets a new request with 
no session ID and issues another one again to /app.
Is there any way I can force the session cookie to be written to the root 
context instead of the context of the application?

thanks
Pete Storey

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923
Out of hours
Support phone 020 7692 9933

Re: OT?:Can't include .js file on jsp page controlled by front contro ller servlet

2004-01-12 Thread pete . storey
A JavaScript include is a purely HTML thing - it shouldnt be processed in 
any way by the server.  You can do it by going:

script language=JavaScript src=xyz.js/script

cheers
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923




Januski, Ken [EMAIL PROTECTED]
12/01/2004 16:58
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:OT?:Can't include .js file on jsp page controlled 
by front contro ller servlet


I may be getting in over my head here as I'm really not all that familiar
with patterns. And I'm not sure that the pattern has anything to do with
problem. But I have a controller servlet through which all web requests 
must
pass. It has worked fine as is. Until I tried to include a .js file on a 
jsp
page. In that case it seems to either print it out to page, rather than
execute it, or it tries to use requestDispatcher portion of controller
servlet to forward/include it. Normally the requestDispatcher forwards
request to the requested page after it checks to see if user is logged in.
But now it seems to go into an infinite loop when forwarding. And  I guess
it's trying to use requestDispather.include because the .js resource is
included via a src='http:...'  request. I know that this is a very vague
question but I wonder if anyone has any clues as to where the problem 
might
lie or what I can start experimenting with.

email protected and scanned by AdvascanTM - keeping email useful - 
www.advascan.com





javamail and tomcat

2004-01-09 Thread pete . storey
Hi,
Im having some problems using javamail in tomcat - especially the taglibs 
mailer tag. 
The problem in this case is that it ignores any data sent to it telling it 
which SMTP server to use and by appearances sends the mail directly itself 
instead.  Has anyone seen this behaviour before and does anyone know a way 
to combat it?
thanks
Pete Storey

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923

Re: RE: urgent

2003-08-18 Thread pete . storey
Perhaps this is just mis-typing in the email but you directory for the 
classes has been spelt calsses - could be the problem if you mean that?





shaman  jain [EMAIL PROTECTED]
18/08/2003 12:02
Please respond to Tomcat Users List
 
To: Stuart MacPherson [EMAIL PROTECTED]
cc: [EMAIL PROTECTED]
Subject:Re: RE: urgent


hi friends,
this is the problem i am facing
C:\tomcat\work\Standalone\localhost\callreg\passcall_jsp.java:58: 
package callreg does not exist
   callreg.URLBean db = null;
An error occurred at line: 2 in the jsp file: /passcall.jsp
Generated servlet error:
C:\tomcat\work\Standalone\localhost\callreg\passcall_jsp.java:60: 
package callreg does not exist
 db = (callreg.URLBean) pageContext.getAttribute(db, 
PageContext.APPLICATION_SCOPE);
An error occurred at line: 2 in the jsp file: /passcall.jsp
Generated servlet error:
C:\tomcat\work\Standalone\localhost\callreg\passcall_jsp.java:63: 
package callreg does not exist
 db = (callreg.URLBean) 
java.beans.Beans.instantiate(this.getClass().getClassLoader(), 
callreg.URLBean);

and my dir structure is:
c:/tomcat/webapps/callreg/web-inf/calsses/callreg/URLBean.class
c:/tomcat/webapps/callreg/web-inf/lib/tds.jar

and i am includeing jsp as
jsp:useBean id=db scope=application class=callreg.URLBean 
/

and connecting as
Class.forName(db.getDriver());
Connection 
con=DriverManager.getConnection(db.getUrl(),db.getUser(),db.getPassword());
pls help me out
its urgent
thanx in advance
Shaman



___
Meet your old school or college friends from
1 Million + database...
Click here to reunite www.batchmates.com/rediff.asp



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




RE: Jan West/US/AM/TSA is out of the office.

2003-08-18 Thread pete . storey
If you look in the help for the list:

To stop subscription for this address, mail:
[EMAIL PROTECTED]

In both cases, I'll send a confirmation message to that address. When
you receive it, simply reply to it to complete your subscription.

It will, of course, reply automatically and voila!
Pete





Stuart MacPherson [EMAIL PROTECTED]
18/08/2003 12:59
Please respond to Tomcat Users List
 
To: 'Tomcat Users List' [EMAIL PROTECTED]
cc: 
Subject:RE: Jan West/US/AM/TSA is out of the office.


This will happen 50 times a day until 26th august...

Ahh





-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 18 August 2003 11:47
To: Tomcat Users List
Subject: Jan West/US/AM/TSA is out of the office.

I will be out of the office starting  08/18/2003 and will not return until
08/26/2003.




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




Error-page directive does nothing

2003-08-14 Thread pete . storey
Hi,
we have a lot of occasions where I use the directive

  error-page
error-code500/error-code
location/errorPages/500x.jsp/location
  /error-page

in a web.xml file but it does nothing, particularly for errors thrown by a 
servlet.  I have upgraded now to Tomcat 4.1.27 as I have seen some 
problems with this before but does anyone have any ideas?
cheers
Pete

Re: Front Controller Servlet

2003-08-14 Thread pete . storey
The reason it is crashing is because you are forwarding to a JSP page, 
however you have already taken over jsp processing in your servlet by 
declaring that it should handle *.jsp, thus it forwards in a circle until 
it runs out of stack space.
Try using another extension for your controller, such as .ktx as we use in 
ours.  This can then forward sucessfully to jsps! 

Should be:
servlet-mapping
  servlet-nameFCservlet/servlet-name
  url-pattern*.ktx/url-pattern
/servlet-mapping

Then your links can be to index.ktx instead and it will got through ok.
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923




Sharon Cohen [EMAIL PROTECTED]
05/08/2003 13:42
Please respond to Tomcat Users List
 
To: [EMAIL PROTECTED]
cc: 
Subject:Front Controller  Servlet


I am trying to build FrontController servlet for a web site on Tomcat 4 ,
after long time of changes on the web.xml file , I wasn't able to achieve
this pattern,
the web.xml portion is :

servlet-mapping
  servlet-nameFCservlet/servlet-name
  url-pattern*.jsp/url-pattern
/servlet-mapping

my problem start when the FrontController servlet needs to forward the
request to other jsp pages
and when he uses the Forward method , the tomcat activate my 
FrontController
again , and after a  while  I get : StackOverflowError .

Thanks for any help
Sharon

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




RE: how to suppor 30000 concurrent users

2003-08-08 Thread pete . storey
Sorry for being thick but Im a bit confused as to when you are doing 
anything with the sessions?  If I make a request to one server, then go on 
to another for the next request, how does server 2 get my session from 
server 1 without server 1 having had to persist the session to disk every 
time any change is made to it?
Pete





Angus Mezick [EMAIL PROTECTED]
05/08/2003 15:11
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:RE: how to suppor 3 concurrent users


Doesn't seem to have that much of an effect.  I guess I should profile
it though.  I don't want to use session persistence because then I would
need to use network session clustering.  Session clustering is a
requirement for my app.  I figure using a DB instead of memory to store
my sessions is better than sending 5 network connections to the other 5
of the 6 web servers with the session data that will only be valid to
ONE of those servers.  Before tomcat we were using Iplanet 4.1 and the
cisco load balance we have SAID it could handle session affinity but it
didn't seem to be able to.  So we went with a DB solution which, to me,
seems to be the more optimal solution.  The DB also means I can have a
MUCH larger number of active sessions using my servers because I don't
have to worry about the sessions using all my memory.  I just have to
worry about DB disk space but I had have 2 or 3 terabytes of disk while
only have 2 GB of memory.  Seems to be an easy trade.
--Angus

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, August 05, 2003 9:40 AM
 To: Tomcat Users List
 Subject: RE: how to suppor 3 concurrent users
 
 
 Angus,
 doesnt using a shared jdbc based session manager slow the 
 whole thing down 
 a lot?  Why dont you just use session persistence?
 Pete
 

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




RE: how to suppor 30000 concurrent users

2003-08-08 Thread pete . storey
Angus,
doesnt using a shared jdbc based session manager slow the whole thing down 
a lot?  Why dont you just use session persistence?
Pete

RE: how to suppor 30000 concurrent users

2003-08-06 Thread pete . storey
Oh OK cool so it is how I thought - presumably you dont use the session 
very much (in terms of sending stuff to it) or else there would be one 
serious amount of db work!
Pete

Re: Configuration Error?

2003-08-04 Thread pete . storey
The bean should be in the Tomcat/ROOT/WEB-INF/classes/mybeans directory 
not Tomcat/ROOT/WEB-INF/mybeans.  Classes underneath web-inf is the 
directory for classes.  Also, perhaps try removing the contentType 
directive at the top of the page as it is unnecessary.  Oh and also you 
have put id=bean= - remove the = from the bean=, then change that to 0 
as referenced later on.
cheers
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923




Pedro Silva [EMAIL PROTECTED]
03/08/2003 20:11
Please respond to Tomcat Users List
 
To: [EMAIL PROTECTED]
cc: 
Subject:Configuration Error?


I am really having a bad time using Apache Tomcat for the first time...
But I won't give up... Just need help...
I have a JSP page that works with a javabean (a simple test page), just
look at the code:
 
%@ page contentType=text/html; charset=iso-8859-1 language=java
import=java.sql.* errorPage= %
html
head
jsp:useBean class=mybeans.lineBean id=bean= scope=page /
 
titleUsing JavaBeans/title
meta http-equiv=Content-Type content=text/html;
charset=iso-8859-1
/head
 
body
 
%= bean0.stars(20) %
Welcome to JavaBeans!
%= bean0.doubleLine(30) %
 
/body
/html

When I try this page I get the following error:
 
type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server
Error) that prevented it from fulfilling this request.

exception 

org.apache.jasper.JasperException: Unsupported encoding: 

 at
org.apache.jasper.compiler.ParserController.getReader(ParserController.j
ava:440)

 at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
209)

 at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)

 at
org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548)

 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J
spServlet.java:176)

 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
t.java:188)

 at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)

 at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)

 at 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)

 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)

 at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:243)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)

 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)

 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

 at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:190)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)

 at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.ja
va:246)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)

 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)

 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

 at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:234
7)

 at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:180)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:566)

 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa
lve.java:170)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)

 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:170)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)

 at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468
)

 at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.ja
va:564)

 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4
72)

 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:174)

 at

RE: JVM tuning

2003-08-04 Thread pete . storey
Hmm well only a profiler could tell me that;  I was more looking for some 
(subsequently discovered) things such as you should reseize the young 
generation to be much larger than the default 25% and so on;  there are 
some rules of thumb such as this which I was looking for!
cheers
Pete





Shapira, Yoav [EMAIL PROTECTED]
04/08/2003 14:16
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:RE: JVM tuning



Howdy,

Has anyone got any clues on JVM tuning for Tomcat on Windows 2000, Sun
141

I would venture at least a few people on this list have clues.  But it's
impossible to help you without a clue about your webapp.

Yoav Shapira



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]




RE: JVM tuning

2003-08-04 Thread pete . storey
Well not really; we know that we are running Tomcat, a web container which 
has its own (fixed) characteristics.  It is a server side app which is 
processing non state based transactions which are thus highly like to 
involve a lot of objects being created and destroyed without too many 
hanging around for long;  the details of the webapp, unless it is highly 
unusual, are likely not to matter particularly.  This is a rule of thumb 
not an exact science and the vast majority of people who run Tomcat would 
benefit from running in such a configuration (or playing with it to see 
what the effects were) - read Sun's own tuning documentation and you will 
see the default settings are not said to be suitable for the majority of 
server apps.
cheers
Pete





Shapira, Yoav [EMAIL PROTECTED]
04/08/2003 14:29
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:RE: JVM tuning



Howdy,

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Monday, August 04, 2003 9:27 AM
To: Tomcat Users List
Subject: RE: JVM tuning

Hmm well only a profiler could tell me that;  I was more looking for
some
(subsequently discovered) things such as you should reseize the young
generation to be much larger than the default 25% and so on;  there are
some rules of thumb such as this which I was looking for!

I would argue any such rule of thumb is as likely to hurt performance as
improve it for your specific app.

Yoav Shapira
Millennium ChemInformatics



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]




RE: JVM tuning

2003-08-04 Thread pete . storey
Ah sorry I should really have said that I was focusing specifically on 
memory managment; general performance tuning is a completely different 
matter in which I do agree with you!  On the memory front however I would 
stand by the fact that most tomcat webapps (big or small) would benefit 
from a change in the default JVM config.

Anyway, have sorted out my problem now (by doing just that as well as a GC 
change) and performance is 10x better!

cheers
Pete





Shapira, Yoav [EMAIL PROTECTED]
04/08/2003 14:45
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:RE: JVM tuning



Howdy,

Well not really; we know that we are running Tomcat, a web container
which
has its own (fixed) characteristics.  It is a server side app which is
processing non state based transactions which are thus highly like to
involve a lot of objects being created and destroyed without too many
hanging around for long;  the details of the webapp, unless it is
highly
unusual, are likely not to matter particularly.  This is a rule of
thumb
not an exact science and the vast majority of people who run Tomcat
would
benefit from running in such a configuration (or playing with it to see
what the effects were) 

I disagree ;)

Every time I've tuned a webapp for pay, both transactional and not, both
full J2EE and just servlets/JSPs, the above has been false.  The
webapp's specific implementation matters far more (typically 3-4 orders
of magnitude) than the container implementation, especially for a mature
container which has been tuned repetitively and carefully over time.
It's precisely because of this, and because as you say performance
tuning is not a science, that a rule of thumb is as likely to hurt as it
is to help if blindly applied.

 read Sun's own tuning documentation and you will
see the default settings are not said to be suitable for the majority
of
server apps.

I appreciate the pointer - I used to help write them ;)

Good luck, however, as it's always YMMV with these things.

Yoav Shapira



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]




RE: JVM tuning

2003-08-04 Thread pete . storey
Isnt the adaptive sizing only relevant to much larger memory 
configurations (Im running this JVM with a max heap of 1-1.5Gb?
Pete





Angus Mezick [EMAIL PROTECTED]
04/08/2003 17:51
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:RE: JVM tuning


Wouldn't AdaptiveSizePolicy help? (saves you the work of Java Heap usage
analyzing :-) :

I use this on my 2x proc machine.

-XX:UseParallelGC -XX:+UseAdaptiveSizePolicy

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 Sent: Monday, August 04, 2003 9:55 AM
 To: Tomcat Users List
 Subject: RE: JVM tuning
 
 
 Ah sorry I should really have said that I was focusing 
 specifically on 
 memory managment; general performance tuning is a completely 
 different 
 matter in which I do agree with you!  On the memory front 
 however I would 
 stand by the fact that most tomcat webapps (big or small) 
 would benefit 
 from a change in the default JVM config.
 
 Anyway, have sorted out my problem now (by doing just that as 
 well as a GC 
 change) and performance is 10x better!
 
 cheers
 Pete
 
 
 
 
 
 Shapira, Yoav [EMAIL PROTECTED]
 04/08/2003 14:45
 Please respond to Tomcat Users List
 
 To: Tomcat Users List [EMAIL PROTECTED]
 cc: 
 Subject:RE: JVM tuning
 
 
 
 Howdy,
 
 Well not really; we know that we are running Tomcat, a web container
 which
 has its own (fixed) characteristics.  It is a server side 
 app which is
 processing non state based transactions which are thus highly like to
 involve a lot of objects being created and destroyed without too many
 hanging around for long;  the details of the webapp, unless it is
 highly
 unusual, are likely not to matter particularly.  This is a rule of
 thumb
 not an exact science and the vast majority of people who run Tomcat
 would
 benefit from running in such a configuration (or playing 
 with it to see
 what the effects were) 
 
 I disagree ;)
 
 Every time I've tuned a webapp for pay, both transactional 
 and not, both
 full J2EE and just servlets/JSPs, the above has been false.  The
 webapp's specific implementation matters far more (typically 
 3-4 orders
 of magnitude) than the container implementation, especially 
 for a mature
 container which has been tuned repetitively and carefully over time.
 It's precisely because of this, and because as you say performance
 tuning is not a science, that a rule of thumb is as likely to 
 hurt as it
 is to help if blindly applied.
 
  read Sun's own tuning documentation and you will
 see the default settings are not said to be suitable for the majority
 of
 server apps.
 
 I appreciate the pointer - I used to help write them ;)
 
 Good luck, however, as it's always YMMV with these things.
 
 Yoav Shapira
 
 
 
 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]
 
 
 

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




RE: Tomcat 4.1x running as NT Service Issue

2003-08-03 Thread pete . storey
I dont think the java versi0on is necessarily a problem however what you 
need to remeber is when you install the service, you fix the settings of 
the JVM.  If you want to control memory settings, you need to do it in the 
tomcat.exe command which you run to install the service.  My server is 
down at the moment so I cant give you an example but if you look in 
tomcat.exe help you can see how to add java options, and one of them will 
need to be somthing like what was suggested below (ie -Xmx128m).  As an 
aside, I personally wouldnt do the -Xms128m as well because this will mean 
that that much memory is used up irrespective of requirements.  Whilst 
this configuration is good in a server environment, in a client where 
memory is more of a premium, you should only default to what you expect it 
to use on a minimal or average basis.
cheers
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923




Robert Porter [EMAIL PROTECTED]
03/08/2003 04:49
Please respond to Tomcat Users List
 
To: 'Tomcat Users List' [EMAIL PROTECTED]
cc: 
Subject:RE: Tomcat 4.1x running as NT Service Issue


I am not sure why we are not running 1.4, but the image from corporate has
1.3.1 and we have been told to live with it. We are running pretty much 
the
same configuration from what you describe but with drastically different
results. 

I am checking on JVM settings, and I will try what you suggest.  The 
laptops
are Dell and IBM late models with 256 MB of memory and large fast drives 
so
I don't think it's the hardware.  All running W2K Pro with SQL Server 2000
Std Ed. We are using an older JDBC driver, what JDBC driver are you using?


-Original Message-
From: Nathan Ward [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 02, 2003 10:27 PM
To: Tomcat Users List
Subject: Re: Tomcat 4.1x running as NT Service Issue


I'm not sure that this is it, but you might try setting the JVM min and 
max
memory limits when starting Tomcat by adding the following to
$CATALINA_HOME\bin\catalina.bat:

set JAVA_OPS = -Xms100m -Xmx100m

Default for the JVM I believe should be 64mb, but who knows.

Why are you using jdk 1.3.1? Do you have existing code that is not
compatible with jdk 1.4? We are running Tomcat 4.1.24 as a service under
Windows 2000 Server accessing an SQL Server database on the same machine
with JDK 1.4.1_01 and it is working.

   Nathan

- Original Message -
From: Robert Porter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 02, 2003 6:57 PM
Subject: Tomcat 4.1x running as NT Service Issue


I have scanned all the archives, and have seen some issues that are 
similar
but not quite the same so I am posting this request.

We are running Tomcat 4.1.24 Binary release, as a Service on Windows 2000
SP3 and SP4 Pro version. No JSP just servlets. The Tomcat instance is
hosting 2 servlets that talk to a local SQL Server 2000 database on the 
same
machine. A VB 6 client is talking to the servlets via http post etc, and
exchanging XML documents for requests and replies.

Running as a Service, with JDK 1.3.1 as the JVM the service will crash 
after
about 10 minutes of activity. Just prior to the crash, available memory 
will
decrease to 0 and the system will slow to a crawl with a lot of disk
activity, paging I imagine.

Running Tomcat in a window alleviates the problem entirely, so I am 
assuming
there are some parameters that are being passed via the Startup.bat file
that are not happening with the service. Or perhaps to the JVM, I am very
new to Tomcat so I am not sure how to accomplish this.  However we really
want to have Tomcat running as a service since this is a laptop app being
deployed to hundreds of our users, and we don't want them mucking about 
with
the Window created by running Tomcat as a windowed service.

Plus, having it run as a service means it is one less thing to worry about
in our application code. However we can't deploy the app if it crashes 
every
10 minutes.  Any help or suggestions would be appreciated. RP2C Inc
http://www.rp2c.com [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: Tomcat 4.1x running as NT Service Issue

2003-08-03 Thread pete . storey
The settings are not controlled in the startup.bat - if you want to 
control them from the command line, you set the environment variable 
JAVA_OPTS with them.  The default settings for a Sun JVM is to allow a 
max heap of 64m - if you try to exceed this, 
java.lang.OutOfMemoryException s will be thrown and by and large the whole 
thing will fall over.  You can probably see these in the log file if you 
look.  Again if you havent specified anything in the service setup, it 
will probably run with 64m of memory as well.

Pete





Robert Porter [EMAIL PROTECTED]
03/08/2003 14:27
Please respond to Tomcat Users List
 
To: 'Tomcat Users List' [EMAIL PROTECTED]
cc: 
Subject:RE: Tomcat 4.1x running as NT Service Issue


I agree with your view on memory usage on a client, but what I am not 
clear
on is do those settings constitute a hard limit for Tomcat/JVM? And if 
so,
what happens when the limit is exceeded, or it attempts to. What we see 
now
is a gradual increase in memory usage over a 10 - 15 minute period, 
followed
by an abend of the Tomcat service. If we run the Tomcat session in a 
window,
using the stock Startup.bat file included with the binary distribution
memory usage stays flat. This is what led me to wonder if some of these
memory parameters to the JVM (during the install of the service) might be
required. I am guessing that the stock install of the service does not set
any limit on memory usage?  Is this true?  Thanks in advance!

Cheers,

Bob Porter

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 03, 2003 5:26 AM
To: Tomcat Users List
Subject: RE: Tomcat 4.1x running as NT Service Issue


I dont think the java versi0on is necessarily a problem however what you 
need to remeber is when you install the service, you fix the settings of 
the JVM.  If you want to control memory settings, you need to do it in the 

tomcat.exe command which you run to install the service.  My server is 
down at the moment so I cant give you an example but if you look in 
tomcat.exe help you can see how to add java options, and one of them will 
need to be somthing like what was suggested below (ie -Xmx128m).  As an 
aside, I personally wouldnt do the -Xms128m as well because this will mean 

that that much memory is used up irrespective of requirements.  Whilst 
this configuration is good in a server environment, in a client where 
memory is more of a premium, you should only default to what you expect it 

to use on a minimal or average basis.
cheers
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923




Robert Porter [EMAIL PROTECTED]
03/08/2003 04:49
Please respond to Tomcat Users List
 
To: 'Tomcat Users List' [EMAIL PROTECTED]
cc: 
Subject:RE: Tomcat 4.1x running as NT Service Issue


I am not sure why we are not running 1.4, but the image from corporate has
1.3.1 and we have been told to live with it. We are running pretty much 
the
same configuration from what you describe but with drastically different
results. 

I am checking on JVM settings, and I will try what you suggest.  The 
laptops
are Dell and IBM late models with 256 MB of memory and large fast drives 
so
I don't think it's the hardware.  All running W2K Pro with SQL Server 2000
Std Ed. We are using an older JDBC driver, what JDBC driver are you using?


-Original Message-
From: Nathan Ward [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 02, 2003 10:27 PM
To: Tomcat Users List
Subject: Re: Tomcat 4.1x running as NT Service Issue


I'm not sure that this is it, but you might try setting the JVM min and 
max
memory limits when starting Tomcat by adding the following to
$CATALINA_HOME\bin\catalina.bat:

set JAVA_OPS = -Xms100m -Xmx100m

Default for the JVM I believe should be 64mb, but who knows.

Why are you using jdk 1.3.1? Do you have existing code that is not
compatible with jdk 1.4? We are running Tomcat 4.1.24 as a service under
Windows 2000 Server accessing an SQL Server database on the same machine
with JDK 1.4.1_01 and it is working.

   Nathan

- Original Message -
From: Robert Porter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, August 02, 2003 6:57 PM
Subject: Tomcat 4.1x running as NT Service Issue


I have scanned all the archives, and have seen some issues that are 
similar
but not quite the same so I am posting this request.

We are running Tomcat 4.1.24 Binary release, as a Service on Windows 2000
SP3 and SP4 Pro version. No JSP just servlets. The Tomcat instance is
hosting 2 servlets that talk to a local SQL Server 2000 database on the 
same
machine. A VB 6 client is talking to the servlets via http post etc, and
exchanging XML documents for requests and replies.

Running as a Service, with JDK 1.3.1 as the JVM the service will crash 
after
about 10 minutes of activity. Just prior to the 

Re: Tomcat 4.1x running as NT Service Issue

2003-08-03 Thread pete . storey
thanks been looking for something like that for ages!





Tim Funk [EMAIL PROTECTED]
03/08/2003 16:52
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:Re: Tomcat 4.1x running as NT Service Issue


If you need to run NT as a service, use this tool to set it up. It makes 
life 
pretty nice.
http://web.bvu.edu/staff/david/tcservcfg/


-Tim
http://jakarta.apache.org/tomcat/faq/windows.html

Robert Porter wrote:
 I agree with your view on memory usage on a client, but what I am not 
clear
 on is do those settings constitute a hard limit for Tomcat/JVM? And if 
so,
 what happens when the limit is exceeded, or it attempts to. What we see 
now
 is a gradual increase in memory usage over a 10 - 15 minute period, 
followed
 by an abend of the Tomcat service. If we run the Tomcat session in a 
window,
 using the stock Startup.bat file included with the binary distribution
 memory usage stays flat. This is what led me to wonder if some of these
 memory parameters to the JVM (during the install of the service) might 
be
 required. I am guessing that the stock install of the service does not 
set
 any limit on memory usage?  Is this true?  Thanks in advance!
 
 Cheers,
 
 Bob Porter


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




RE: Tomcat 4.1x running as NT Service Issue

2003-08-03 Thread pete . storey
well in that case the tomcat.exe included with the tomcat dist is fine 
once you have fixed your setup.  It is simply run as a batch script, or as 
part of an install (you execute tomcat.exe once with the relevant 
parameters to install it)
Pete





Robert Porter [EMAIL PROTECTED]
03/08/2003 18:01
Please respond to Tomcat Users List
 
To: 'Tomcat Users List' [EMAIL PROTECTED]
cc: 
Subject:RE: Tomcat 4.1x running as NT Service Issue


Found that while googling my issue, it looks very promising, but I need
something we can include in a custom setup that will be run by users.
Although that tool will help in testing! Seen anything like it for 
deploying
webapps?



-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 03, 2003 11:52 AM
To: Tomcat Users List
Subject: Re: Tomcat 4.1x running as NT Service Issue


If you need to run NT as a service, use this tool to set it up. It makes
life 
pretty nice.
http://web.bvu.edu/staff/david/tcservcfg/


-Tim
http://jakarta.apache.org/tomcat/faq/windows.html

Robert Porter wrote:
 I agree with your view on memory usage on a client, but what I am not 
 clear on is do those settings constitute a hard limit for 
 Tomcat/JVM? And if so, what happens when the limit is exceeded, or it 
 attempts to. What we see now is a gradual increase in memory usage 
 over a 10 - 15 minute period, followed by an abend of the Tomcat 
 service. If we run the Tomcat session in a window, using the stock 
 Startup.bat file included with the binary distribution memory usage 
 stays flat. This is what led me to wonder if some of these memory 
 parameters to the JVM (during the install of the service) might be 
 required. I am guessing that the stock install of the service does not 
 set any limit on memory usage?  Is this true?  Thanks in advance!
 
 Cheers,
 
 Bob Porter


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




error-page directive has no effect

2003-08-03 Thread pete . storey
Hi,
ive got a problem currently with the error-page directive doing nothing 
when I use it in an app (on either tomcat 4.1.18 or .27).  At the bottom 
of my app's web.xml, I have the following tag:


  error-page
error-code500/error-code
location/errorPages/500x.jsp/location
  /error-page

This corresponds to a working page, however this tag is completely 
ignored.  As a result, in order to get any 500 errors to be handled 
properly, I have to put an @page errorPage directive in the top of every 
JSP - this doesnt of course work for servlets, so presents a problem then.

Has anyone any idea why it wouldnt work?  I have had this problem thinking 
about it before which meant that any Struts actions would not get handled 
by the error handler.  I ended up having to write a filter which caught 
them for me and forwarded the request to the error page with the exception 
held as a request attribute - this is obviously far from ideal!!

thanks
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923

JVM tuning

2003-08-03 Thread pete . storey
Has anyone got any clues on JVM tuning for Tomcat on Windows 2000, Sun 141 
or 142?  Im playing with some of the young/old generation and GC settings 
but am having trouble deciding what is best.  I think that I should 
probably push out the young generation to be a larger than normal amount 
as many of the objects created are very transitory, and I have seen lots 
of GC activity going on there.

On that note, has anyone tried the Sun GC portal?  Im a bit baffled as to 
how to create a log file for it - turning on the switches is all very well 
and prints to the screen OK but it doesnt seem to log to the .out files?

cheers
Pete

Problems with Tomcat in a high load environment

2003-08-01 Thread pete . storey
Hi,
we are running Tomcat 4.1.18 on Windows 2000 under JDK1.4.1_01.  We are 
using IIS as a web server connecting using the ISAPI JK 2 connector.  We 
are currently experiencing 2 seperate problems when under high load (ie  
30 requests per second):

1.  A huge number of log events (~30 sets per minute) are generated in the 
NT event log which show problems with the ISAPI connector.  Each time 
there is a problem, 7 lines are created:

Error: [jk_worker_ajp13.c (512)]: ajp13.service() Error  forwarding 
ajp13:localhost:8029 1 0
Error: [jk_worker_ajp13.c (416)]: ajp13.service() ajpGetReply recoverable 
error 3
Error: [jk_handler_response.c (178)]: handler.response() Error sending 
response 
Error: [jk_service_iis.c (157)]: jk_ws_service_t::head, 
ServerSupportFunction failed
Error: [jk_worker_ajp13.c (416)]: ajp13.service() ajpGetReply recoverable 
error 3
Error: [jk_handler_response.c (200)]: Error ajp_process_callback - write 
failed
Error: [jk_service_iis.c (247)]: jk_ws_service_t::write, WriteClient 
failed

These I think lead to the eventual crash of IIS however I also suspect 
that they may cause user errors though I havent actually seen any evidence 
of this.  Does anyone know anything about these errors or what I can do to 
reduce them?  Could it be a tuning of Tomcat issue?

2. The server is set up currently with -Xms512m and the same for Xmx. 
This, I would have thought, was OK for this application, though of course 
I could be wrong, but is in any case irrelevant to the problem as if I 
increase memory to 1Gb it makes no odds.
The server will run fine for a few minutes at about 128m of memory usage. 
At some (slightly random point with no obvious trigger), it will in a 
matter of seconds use up all available memory, thus triggering a huge rise 
in the processor usage which sits at roughly 50-60% (across 2 processors) 
constantly.  It is worth noting that 1 processor is not maxed out - the 
load is relatively evenly distributed.
After a further while, the young generation space runs out of memory and a 
process ensues of the processor load bouncing up to 100% and back to 60% 
over and over again as it GCs, reduces the momery used to ~ 15m less than 
it was, then it is used up again and so on.  This obviously seriously 
impacts the usage of the application.  I cant see why it is doing it; this 
is an ecommerce application and the loads are not that high - clearly a 
leak of some description is occuring somewhere but the speed with which 
these changes happen baffle me, and I dont thik there is much setup work I 
can do to change it.  I could install a profiler to find out whats going 
on but it is a live system and I am loath to do so.
Finally it is worth noting that I have only just made this system live and 
a functionally identical although architecturally simpler version ran 
quite happily under the same loads using no more than 256m of ram under 
JRun 3.1.

Any ideas?!

cheers
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

4, Percy Street
London
W1T 1DF

Phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923

RE: Problems with Tomcat in a high load environment

2003-08-01 Thread pete . storey
I do agree and whilst our dev environments are pretty close to the live 
ones, I dont have a particularly useful set of use cases which I can test 
with (well I do but they dont cause the problem to occur on our dev 
systems!).  Thus the only meaningful profiling would have to be done on 
the live system which clearly is less than desirable.

I also agree that 30 r/s isnt a huge load however when the site is running 
at about 12 as say it is at the moment, then this doesnt happen.  It is 
thus a problem associated with the high loads.  Also notable is a very 
large number of the following 3 types of error which occur in Tomcat and I 
believe are related to the JK2 connector (I have also tried the JK 
connector with similar results):

01-Aug-2003 17:48:01 org.apache.jk.common.ChannelSocket processConnection
INFO: Server has been restarted or reset this connection
01-Aug-2003 17:48:21 org.apache.jk.server.JkCoyoteHandler action
INFO: RESET 
01-Aug-2003 17:59:12 org.apache.jk.server.JkCoyoteHandler action
SEVERE: Error in action code 
java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at 
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:435)
at 
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:627)
at 
org.apache.jk.server.JkCoyoteHandler.action(JkCoyoteHandler.java:372)
at org.apache.coyote.Response.action(Response.java:222)
at org.apache.coyote.Response.finish(Response.java:343)
at 
org.apache.coyote.tomcat4.OutputBuffer.close(OutputBuffer.java:326)
at 
org.apache.coyote.tomcat4.CoyoteResponse.finishResponse(CoyoteResponse.java:500)
at 
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:224)
at 
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
at 
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
at 
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:632)
at 
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:590)
at 
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:707)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:536)

Perhaps it is these which cause the problem?  I cant believe that there is 
some intrinsic problem with Tomcat as clearly lots of people use it 
successfully though not, perhaps, when mated to IIS.  I am currently 
considering switching to Jetty for a bit better performance which in this 
app is crucial.  Anyone done this successfully?

cheers
Pete





Shapira, Yoav [EMAIL PROTECTED]
01/08/2003 18:45
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:RE: Problems with Tomcat in a high load 
environment



Howdy,
Even if your loathe to do it, a profiler is invaluable as long as the
profiled environment (your dev/test env) is close enough to production
to be meaningful.  You should profile, and run stress tests, on hardware
and software that's as similar as possible to production, before going
live.

FWIW, 30 requests/sec is not an extremely high load: most of our apps
routinely handle several times that load on standalone tomcat 4.1.24
(and starting at 12:01 tonight, 4.1.27 ;))

Have you tried running without the IIS front-end?  It could be worth a
shot.  Tomcat can handle the static files as well.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 1:29 PM
To: [EMAIL PROTECTED]
Subject: Problems with Tomcat in a high load environment

Hi,
we are running Tomcat 4.1.18 on Windows 2000 under JDK1.4.1_01.  We are
using IIS as a web server connecting using the ISAPI JK 2 connector.
We
are currently experiencing 2 seperate problems when under high load (ie

30 requests per second):

1.  A huge number of log events (~30 sets per minute) are generated in
the
NT event log which show problems with the ISAPI connector.  Each time
there is a problem, 7 lines are created:

Error: [jk_worker_ajp13.c (512)]: ajp13.service() Error  forwarding
ajp13:localhost:8029 1 0
Error: [jk_worker_ajp13.c (416)]: ajp13.service() ajpGetReply
recoverable
error 3
Error: [jk_handler_response.c (178)]: handler.response() Error sending
response
Error: [jk_service_iis.c (157)]: jk_ws_service_t::head,
ServerSupportFunction failed
Error: [jk_worker_ajp13.c (416)]: ajp13.service() ajpGetReply
recoverable
error 3
Error: [jk_handler_response.c (200)]: Error ajp_process_callback -
write
failed
Error: [jk_service_iis.c (247)]: jk_ws_service_t::write, WriteClient
failed

These I think lead to the eventual crash 

Alternatives to DBCP

2003-06-23 Thread pete . storey
Has anyone used any alternatives to the DBCP with Tomcat because it seems 
to get worse and worse as I use it more.  For no apparent reason on one 
server, if there is a failure of a query to clean up its resources 
properly then when it it cleaned up by the finalizer method of our query 
object it actually closes the connection and then DBCP doesnt open any 
more even though it should, so any connection attempt ends up saying 
Connection is closed.  This is obviously a bit of a problem.  I can only 
assume that the problem lies in the combination of DBCP and my code. 
Obviously I know that we shouldnt ever use a finalizer to be cleaning 
stuff up but this is is development so allows us to catch where this 
occurs in code.  The code for our Query object is included here.
The cleanUp method works fine normally it seems it is just when called by 
a finalizer that it goes wrong (although I suppose it could be caused by a 
SQL Exception in the back end of the system?).  We're using INet 
Software's Sprinta2000 SQL Server 2000 JDBC driver if that of any 
importance.
cheers
Pete


/*
 * Query.java
 *
 * Created on 27 May 2002, 15:20
 */

package com.ktdev.sql;

import javax.sql.*;
import java.sql.*;
import javax.naming.*;
import java.io.*;
import java.util.*;
import com.ktdev.errors.GetStackTrace;

import org.apache.log4j.Logger;

/**
 *
 * @author  Dominic Bevacqua
 * @version 
 *
 * Wrapper class for java.sql.Statement and java.sql.CallableStatement
 *
 */
public class Query {
 
static Logger log = Logger.getLogger(Query.class);
 
/** static variables **/
private static Hashtable JNDIEnv=null;
 
/** non-static variables **/
private Connection conn;
private Vector statements = new Vector();
private Vector resultSets = new Vector();
private Statement currentStmt;
private String callingMethodStackTrace = ;
 
private String dataSourceName;
private String commandText;
private boolean isUpdate=false;
private boolean isCallable=true;
private boolean useServerCursor=false;
private boolean returnsMultipleResultSets=false;
private int resultSetType = java.sql.ResultSet.TYPE_FORWARD_ONLY;
private int resultSetConcurrency = 
java.sql.ResultSet.CONCUR_READ_ONLY;
 
 
/** Constructors **/

// should we provide no args constructor? no real need for it but...
public Query() {
 
// This simply gets the stack that called the query so if it is 
not cleaned up properly then we can report it.
// Only run if it is debug mode.
if (log.isDebugEnabled())
callingMethodStackTrace = 
GetStackTrace.getStackTraceAsString();
 
}
 
public Query(String dataSourceName) {
 
if (log.isDebugEnabled()) {
log.debug(Creating a Query connection to  + dataSourceName);
callingMethodStackTrace = 
GetStackTrace.getStackTraceAsString();
}
this.setDataSourceName(dataSourceName);
this.openJNDIConnection();

}
 
/** Create new Query with specified commandText on specified 
dataSourceName **/
public Query(String commandText, String dataSourceName) {

this(dataSourceName);
this.setCommandText(commandText);
this.createStatement();
this.execute();
log.debug(Query created and run with commandText =  + 
commandText );
 
}
 
// In case someone does not want to use JNDI to get connection...
public Query(String url, String username, String password, String 
driver) {
 
if (log.isDebugEnabled()) {
log.debug(Creating a Query using JDBC parameters.);
callingMethodStackTrace = 
GetStackTrace.getStackTraceAsString();
}
 
try {
 
Class.forName(driver);
conn = DriverManager.getConnection(url , username, password);
 
} catch (ClassNotFoundException ce) {
 
// throw exception
throw new QueryException(ce.getMessage());
 
} catch (SQLException se) {
 
// throw exception
throw new QueryException( se );
 
} 
 
}
 
// Better way of doing it...
private void openJNDIConnection(){
 
try {
 
// Define JNDI InitialContext object.
  InitialContext ctx = new InitialContext(JNDIEnv); 
 
// Look up data source in InitialContext.
  DataSource ds = (DataSource)ctx.lookup(dataSourceName);

// get connection from pool
  conn = ds.getConnection();
 
} catch (javax.naming.NamingException ne) {
 
log.error(Caught a NamingException trying to get a Connection 
from JNDI., ne);
throw new QueryException(ne.getMessage());
 
} catch (SQLException se) {
 
log.error(Caught a SQLException trying to get a Connection 
from JNDI., se);
throw new QueryException( se );
 
} 
 
}
 
public void createStatement() {
 
// First clear the current statement as we are 

Re: Alternatives to DBCP

2003-06-23 Thread pete . storey
Thanks will do.  Presumably I just then replace the JAR file in the 
common\lib directory of the server?
thx
Pete





Tim Funk [EMAIL PROTECTED]
23/06/2003 13:16
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:Re: Alternatives to DBCP


There was recently a similar complaint in common-dev.

DBCP hasn't had a release in a very long time and has significant bug 
fixes 
in it with respect to connection handling (i think).

So your best best is to checkout from HEAD (jakarta-commons/dbcp) and 
build 
from source. There are also some milestone tags with respect to struts 
since 
the last official dbcp release, so checking out with one of the tags 
instead 
might help if a new bug was introduced since the 1.0 release.

-Tim

[EMAIL PROTECTED] wrote:
 Has anyone used any alternatives to the DBCP with Tomcat because it 
seems 
 to get worse and worse as I use it more. 


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




Hyperthreading and performance

2003-06-09 Thread pete . storey
I realise that this is slightly a JVM dependant question but doe anyone 
have any views on using Hyperthreading on Xeon processors and whether it 
will affect performance or not?  As far as I can ascertain, hyperthreading 
essentially splits the processor into two threads internally which appear 
to the OS as two processors (so on a dual system you get four).  This 
allows for performance equivalent of a dual processor system when you only 
have one proc, etc etc.
Will this help or hinder Tomcat?  Ive heard many people saying essentially 
it's better left turned off unless you have a very specific application 
that might use it (eg Photoshop), but with Tomcat being multi-threaded I 
cant see why it wouldnt benefit.
Anyone know anything a bit more definative (currently Im using Sun's 
141_01 and 02 JVM in production).
thanks
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

Please note, we have moved!

4, Percy Street
London
W1T 1DF

New permanent phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923

RE: Stopping caching in tomcat

2003-05-27 Thread pete . storey
Surely a querystring has no bearing on a URL mapping?  I will add some 
logging though to see.  I have solved the problem with a workaround by 
putting in META HTTP-EQUIV tags in the header.  After looking at MSDN I 
have added a subtely different tag of expires=-1 instead of expires=0 and 
it does now work, but essentially Im not sure why it works on the page 
itself but not as real headers.  Id certainly rather have the filter work 
instead of writing these into every page where they can easily be missed 
out.
Hmm!
Pete





Shapira, Yoav [EMAIL PROTECTED]
27/05/2003 15:20
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:RE: Stopping caching in tomcat



Howdy,
1. Meta tags will work.  They are almost the same as what you're putting
in the filter.  However, I like your filter approach better, so

2. Have you verified your filter is correctly mapped?  Add some logging
statements to it, as I for one am not sure it's being mapped to your
first action.  /*.ktx does not match /startquote.ktx?policyID=1 because
of the part after .ktx.

Yoav Shapira
Millennium ChemInformatics


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 7:25 AM
To: [EMAIL PROTECTED]
Subject: Stopping caching in tomcat

Hi,
Im running a Tomcat/IIS app and I have a major problem in that I am
using
struts to power a set of actions in the site and the first action that
is
linked to is done as a link : /startquote.ktx?policyID=1 .  IE6 however
caches this page and so doesnt run the action to pull up the page.
this
causes various things not to be set up properly.
Furthermore, the index page is also cached which means that a session
is
not instatiated for the user so the first time they submit a page, they
get a session timed out problem.
I have written a filter which I hoped would cure caching but it hasnt
made
any difference.  I know caching is a problem but I cant seem to find
any
way around it!  Has anyone got any ideas?  Putting in meta tags has
never
really worked before but maybe it will - if so what should they be?

The filter is below:

/*
 * AntiCachingFilter.java
 *
 * Created on 27 May 2003, 10:58
 */

package com.ktdev.filters;

import java.io.*;
import java.net.*;
import java.util.*;
import java.text.*;
import javax.servlet.*;
import javax.servlet.http.*;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 *
 * @author  Pete Storey
 * @version
 */

public class AntiCachingFilter extends GenericFilter {

public AntiCachingFilter() {
}

/**
 *
 * @param request The servlet request we are processing
 * @param result The servlet response we are creating
 * @param chain The filter chain we are processing
 *
 * @exception IOException if an input/output error occurs
 * @exception ServletException if a servlet error occurs

 */
public void doFilter(ServletRequest request, ServletResponse
response,
FilterChain chain)
throws IOException, ServletException {

HttpServletResponse httpResponse = (HttpServletResponse)
response;

httpResponse.setHeader(Pragma, no-cache);
httpResponse.setHeader(Expires, 0);
httpResponse.setHeader(Cache-control, no-cache,
must-revalidate);

// Go on to the next one
chain.doFilter(request, response);

}

}

In web.xml

  filter
filter-nameAntiCachingFilter/filter-name
descriptionSets anti caching headers in the
response/description
filter-classcom.ktdev.filters.AntiCachingFilter/filter-class
  /filter

  filter-mapping
filter-nameAntiCachingFilter/filter-name
url-pattern/*.ktx/url-pattern
  /filter-mapping

Thanks
Pete

Kiss Technologies

http://www.kisstechnologies.co.uk/

Please note, we have moved!

4, Percy Street
London
W1T 1DF

New permanent phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923



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]




Re: Tomcat - JDBC - MS SQL Driver Recommendations? (was: Tomcat / JDBC / MSSQL / Connection lost and won't reconnect)

2003-05-27 Thread pete . storey
We use iNet software's Sprinta 2000 driver and find it excellent.  It is 
high performance and provides considerably more features than the MS 
driver.  It is not very high cost (a few hundred dollars for a site 
license IIRC) and is both fully type 4 compliant and small.
Their whole range of drivers is very good and I have found them to be a 
lot better than any others for type 4 drivers - I would use them every 
time (and I have for some of their other products too!)
Go to www.inetsoftware.de if you would like a look
Pete





Paul \(BRI\) [EMAIL PROTECTED]
27/05/2003 16:13
Please respond to Tomcat Users List
 
To: 'Tomcat Users List' [EMAIL PROTECTED]
cc: 
Subject:Tomcat - JDBC - MS SQL Driver Recommendations? 
(was: Tomcat / JDBC / MS SQL / Connection lost and won't reconnect)


I had posted this question about reconnection problems with MS's JDBC
driver. While it turned out that no one had the same issue on this, I
wondered what drivers are best for Tomcat - SQL Server. Are there other
suitable free drivers? Are others using commercial drivers? I have read
some of the reviews on various sites - but words from those actually
using the drivers would be appreciated.

If this question seems to afar from tomcat I would be happy to post
elsewhere. But it is nice to find a good group dedicated to tomcat -
this is new to me (coming from MS) and I have been happy so far learning
more each day.

Thanks for your help,

Paul

-Original Message-
From: Paul (BRI) [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 23, 2003 10:28 AM
To: [EMAIL PROTECTED]
Subject: Tomcat / JDBC / MS SQL / Connection lost and won't reconnect


I am having a problem that I am guessing can't be uncommon. I wanted to
provide details on my exact setup to see if anyone has solved this...or
if I am doing something stupid..

I have: Tomcat 4.1.x, Microsoft's JDBC Type 4 driver, and MS SQL Server
2000. Tomcat is running on a linux (red hat) box and SQL Server is
running on a separate box (with Windows 2000 Server). The application
sitting on the linux box is a web application. Tomcat is the only server
(for the web and servlets).

I noticed that if there is any interruption in the network connection
between the two boxes the connection is dropped and Tomcat (or the
driver) will not reconnect until I shutdown/startup Tomcat. I have seen
some code for autoReconnect for mySQL and wasn't clear if that was the
answer for MS drivers. If so, what is the syntax for this? 

I am curious if this is common. Or, is using a Microsoft Driver the
problem? :o It seens hard to believe that the default behavior of the
driver allows for this connection drop. Am I doing something else wrong?

Below is the resource entry in my server.xml file. Thank you very much
for your help. Paul

!-- connection pooling --
Resource name=jdbc/myName auth=Container
type=javax.sql.DataSource/Resource

 ResourceParams name=jdbc/myName
 parameter
 namefactory/name
 
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
 /parameter

 !--MS SQL User name--
 parameter
 nameusername/name
 valuemyUserName/value
 /parameter

 !--MS SQL Password--
 parameter
 namepassword/name
 valuemyPassword/value
 /parameter

 !--JDBC Driver Class Name--
 parameter
 namedriverClassName/name
 
valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value
 /parameter

 !--MS SQL Server Url*--
 parameter
 nameurl/name
 
valuejdbc:microsoft:sqlserver://xxx.xxx.xxx.xxx:;DatabaseName=myNa
me/value
 /parameter

 !--To configure a DBCP DataSource so that abandoned dB
connections are removed and recycled --
 parameter
 nameremoveAbandoned/name
 valuetrue/value
 /parameter

 !--Use the removeAbandonedTimeout parameter / 
seoonds.--
 parameter
 nameremoveAbandonedTimeout/name
 value60/value
 /parameter

 !-- Maximum number of dB connections in pool.  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
 value30/value
 /parameter

 

default page cannot be removed

2003-03-17 Thread pete . storey
Im having a very strange problem under tomcat 4.1.18 whereby I am 
deploying an app onto the root context of the server.  My default page is 
index.jsp, however whe  i then view this page in the application I always 
get the initial welcome page from the welcome application.  Now this 
application no longer exists in the server so I am baffled as to where 
it's coming from and why I get the wrong thing.  If i delet index.jsp, 
then I get a 404 error as expected.  This is equally true if say I use 
default.jsp.  I am presuming that this is a bug in tomcat as I cant 
understand anything else that could be causing it.  Has anyone else seen 
this problem?
cheers
Pete Storey

Kiss Technologies

http://www.kisstechnologies.co.uk/

Please note, we have moved!

4, Percy Street
London
W1T 1DF

New permanent phone numbers:

Phone 020 7692 9922
Fax 020 7692 9923

RE: default page cannot be removed

2003-03-17 Thread pete . storey
Thanks Jan,
did the trick!
Pete





Jan Behrens [EMAIL PROTECTED]
17/03/2003 22:00
Please respond to Tomcat Users List
 
To: Tomcat Users List [EMAIL PROTECTED]
cc: 
Subject:RE: default page cannot be removed


Hi Pete,

 Im having a very strange problem under tomcat 4.1.18 whereby I am
 deploying an app onto the root context of the server.  My default page 
is
 index.jsp, however whe  i then view this page in the application I 
always
 get the initial welcome page from the welcome application.  Now this
 application no longer exists in the server so I am baffled as to where
 it's coming from and why I get the wrong thing.  If i delet index.jsp,
 then I get a 404 error as expected.  This is equally true if say I use
 default.jsp.  I am presuming that this is a bug in tomcat as I cant
 understand anything else that could be causing it.  Has anyone else seen
 this problem?
 cheers
 Pete Storey

i am not sure but i think i've seen something alike, only with 
class-files. i
had a static class containing certain parameters for my app. when i 
deployed
to my nb for a presentation i had to change these parameters and recompile
same class. the new build however seemed to be ignored by tomcat - through
restarts and i don't know what... only after i deleted everything in the
%TOMCAT ROOT %/work/ directory i could finaly convince him to accept my
changes...

have you tried same yet?

regards jan


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