Re: close pooled conection-by value or by reference

2005-07-24 Thread Bertrand Renuart
If you want to make sure the connection is closed/release in any case, put
the close() call inside a finally clause:


  Connection connection = DatabaseManager.getConnection();
  try {
 //jdbc work.
  }
  finally {
DatabaseManager.closeConnection(connection);
  }

This way, whatever happens inside the try block, you are sure
closeConnection will be called (think about an exception being thrown in
the try block...)


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



Re: Error 500 messages

2005-07-24 Thread Tim Funk
The response is being comitted before the erro is being thrown. You need to 
set the buffer size to be larger. Its a page directive.



-Tim


Adile Abbadi wrote:


Hi Tim,

Thank you very much - that has helped - however I discovered that the
problem still exists if I have an include within an include - ie.

I have an include called this

jsp:include page=navmenu.jsp flush=false

Inside that include I have another include also with flush set to false -
and I still get a blank page - however if I remove the includes within the
include then the exception is visible. Any ideas on this?

Cheers

Adile


-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: July 22, 2005 12:42 PM
To: Tomcat Users List
Subject: Re: Error 500 messages


flush=false

-Tim

Adile Abbadi wrote:



Hi Tim,

Thanx for the information - I forgot about that. I guess the question is


why


did it work in Tomcat 3 and not Tomcat 4 and second is there a workaround


to


get it to work?

Adile


-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: July 22, 2005 12:20 PM
To: Tomcat Users List
Subject: Re: Error 500 messages


This line jsp:include page=top.html flush=true will commit the
response
and send html back to the client. Once that is done - no error messages


will


be sent back to the client and you will end up with a blank screen.

-Tim

Adile Abbadi wrote:




Hi Rob,

Thanx for this - this is great - I may have to use this because I think I
have truly found a bug in Tomcat as this issue is not happening on my


Tomcat



3 server. I did a bit more investigation and I found some interesting
things. This is going to be a long email with code and stuff but whoever
wants to read it please do - because the results are weird.

I created the following simple JSP page

%@ page language=java
import=javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager %
%^M
  String query = select * from patient_info where ref_client = 38


and



pat_lname like '%SM'ITH%';;
  DBConnectionManager connMgr;
  connMgr = DBConnectionManager.getInstance();
  Connection Conn = connMgr.getConnection(podb);
  Statement SQLS = Conn.createStatement();
  ResultSet rs = SQLS.executeQuery(query);
  String col1 = null;
  String col2 = null;
  while(rs.next()) {
  col1 = rs.getString(pat_id);
  col2 = rs.getString(pat_fname);
%
%=col1%: %=col2%br
br
%
  }
  rs.close();
  SQLS.close();
  connMgr.freeConnection(podb,Conn);
%

As you can see I did a syntax error in the query and  the error comes to


the



screen as expected

javax.servlet.ServletException: ERROR:  syntax error at or near ITH at
character 74

I said that's weird so I tried to compare my complicated JSP files to what


I



have here to see what is different (if I did something wrong)  and I found
this

If I add an include at certain parts of the page - I see the result I was
talking about. For example if I do this:

jsp:include page=top.html flush=true
%@ page language=java
import=javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager %
%^M
  String query = select * from patient_info where ref_client = 38


and



pat_lname like '%SM'ITH%';;
  DBConnectionManager connMgr;
  connMgr = DBConnectionManager.getInstance();
  Connection Conn = connMgr.getConnection(podb);
  Statement SQLS = Conn.createStatement();
  ResultSet rs = SQLS.executeQuery(query);
  String col1 = null;
  String col2 = null;
  while(rs.next()) {
  col1 = rs.getString(pat_id);
  col2 = rs.getString(pat_fname);
%
%=col1%: %=col2%br
br
%
  }
  rs.close();
  SQLS.close();
  connMgr.freeConnection(podb,Conn);
%

I get the error page as I should - however If I move the include to below
the %@ page language=java - I get a blank page!!

Now here is where it gets weirder - if I force a java syntax error like as
follows (I corrected the query):

jsp:include page=top.html flush=true
%@ page language=java
import=javax.crypto.*,java.sql.*,java.net.*,dbc.DBConnectionManager %
%^M
  String query = select * from patient_info where ref_client = 38


and



pat_lname like '%SMITH%';;
  DBConnectionManager connMgr;
  connMgr = DBConnectionManager.getInstance();
  Connection Conn = connMgr.getConnection(podb);
  Statement SQLS = Conn.createStatement();
  ResultSet rs = SQLS.executeQuery(query);
  String col1 = null;
  String col2 = null;
  if (col1.equals(yes) {
//test
 }
  while(rs.next()) {
  col1 = rs.getString(pat_id);
  col2 = rs.getString(pat_fname);
%
%=col1%: %=col2%br
br
%
  }
  rs.close();
  SQLS.close();
  connMgr.freeConnection(podb,Conn);
%

An error will get thrown to the screen

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 2 in the jsp file: /testdb.jsp


domain missing from html:rewrite html:link etc

2005-07-24 Thread Mark Benussi
I have recently moved ISPs and my sites are experiencing some strange
behaviour.

Basically on some of my sites (Not just one) and on some of the links (Not
just all) When using html:link (A struts tag library) and the other
associated tags (rewrite etc) the domain is missing.

This is also seen when using the sslext tag library which made me think that
it was a Tomcat configuration as opposed to a code specific thing (The code
has been tested in development, system test and another live environment).

I am going to give out some addresses so that people can see the problem,
but hope this won't attract unhelpful UI comments or activity as I know the
sites aren't perfect.

First customer:

http://www.cibustraining.com/view/menu.do?id=1

The links at the bottom Privacy Policy | Terms  Conditions have this
problem.

The code for them is:

html:link page=/view/page.do?id=8 title=Privacy PolicyPrivacy
Policy/html:link
 | html:link page=/view/page.do?id=7 title=Terms amp; ConditionsTerms
amp; Conditions/html:link

Second customer

http://www.goodcookshop.com/view/menu.do?id=2

The links in the top right Why become a goodcookshop.com member? and
Register me have this problem, although the second has an extra slash after
the domain and the first one has no domain.

The code for them is:

tr
td colspan=2sslext:link page=/view/page.do?id=8 title=Why
become a goodcookshop.com member?Why become a goodcookshop.com
member?/sslext:link/td
/tr
tr
td colspan=2sslext:link page=/registration/begin.doRegister
me/sslext:link/td
/tr

Finally I attach the server.xml for the original working configuration and
the new one which seems to be causing problems.

Original

Server port=18005 shutdown=SHUTDOWN debug=0
Listener
className=org.apache.catalina.mbeans.ServerLifecycleListener debug=0/
Listener
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
debug=0/
Service name=Catalina
!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080
--
Connector port=18008 enableLookups=false
redirectPort=8443 debug=0 protocol=AJP/1.3 /
Engine name=Catalina defaultHost=localhost debug=99
Logger
className=org.apache.catalina.logger.FileLogger prefix=catalina_log.
suffix=.txt timestamp=true debug=99 /
Host name=www.goodcookshop.com debug=0
appBase=/web unpackWARs=true autoDeploy=true
Aliaswww.thegoodcookshop.com/Alias
Aliaswww.goodcookshop.co.uk/Alias
Logger
className=org.apache.catalina.logger.FileLogger prefix=goodcookshop.
suffix=.txt timestamp=true /
Context path= docBase= /
/Host
/Engine
Realm className=org.apache.catalina.realm.MemoryRealm /
/Service
/Server

New one

?xml version=1.0?
Server port=8108 shutdown=SHUTDOWN debug=0
  Service name=Tomcat-Apache
  Connector className=org.apache.coyote.tomcat5.CoyoteConnector
protocol=AJP/1.3 port=8208 minProcessors=5 maxProcessors=75
acceptCount=10 debug=0/
  Engine name=alberta debug=0 defaultHost=goodcookshop.com
  Host name=goodcookshop.com debug=0 unpackWARs=true
autoDeploy=true deployXML=true deployOnStartup=false
appBase=/home/tgcslimited/tomcat/webapps
Aliaswww.goodcookshop.com/Alias
Logger
className=org.apache.catalina.logger.FileLogger
directory=/home/tgcslimited/logs prefix=tomcat. suffix=.txt
timestamp=true/
Context path=/
docBase=../../public_html debug=0 reloadable=true/
  /Host
  /Engine
  /Service
/Server

Appreciate your time on this one as I didn't have any joy with google.

Cheers,

Mark

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



how to build tomcat -locally- after downloading all sources to your local box

2005-07-24 Thread cmllpz
 http://jakarta.apache.org/tomcat/tomcat-5.0-doc/building.html

 explains the ant-based process in which sources are downloaded from CVS.

 How do you go if all sources you want to first download locally and
ocassionally check them using ant checkout?

 thing is that when you, for example, do a google search trying not to miss the
right one on: 'build tomcat ant source installation compile local'

 you get ten of thousands of articles

 Albretch

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



[ANN] Apache Jakarta Tomcat v5.5.10-alpha Released

2005-07-24 Thread Yoav Shapira
The Apache Jakarta Tomcat team is proud to announce the immediate availability
of Tomcat 5.5.10-alpha. This build contains 110 improvements, including bug
fixes, enhancements, and documentation updates.  There are several interesting
new features, such as Apache Portable Runtime (APR)-based HTTP/1.1 and AJP/1.3
protocol handlers with SSL support, an experimental NIO-Socket channel for the
AJP/1.3 connector, improved support for Java 5 using the Eclipse 3.1 JDT,
clustering support at the Engine and Host levels, and more.

The Release notes are available at
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/RELEASE-NOTES

Please refer to the change log for the list of changes:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/changelog.html

Downloads: Binaries: http://jakarta.apache.org/site/binindex.cgi#tomcat-5.5
Sources: http://jakarta.apache.org/site/sourceindex.cgi#tomcat-5.5

The Apache Jakarta Tomcat Team 

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



how to get the original requestURI after jsp:forward()

2005-07-24 Thread Marten Lehmann

Hello,

I have a forward to a jsp-file. This jsp-file needs to know which URI 
was requested in the initial request. Currently, I can only see the 
requestURI of the forwarded jsp-file. Any ideas?


Regards
Marten

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



Re: how to get the original requestURI after jsp:forward()

2005-07-24 Thread Mark Thomas

You need to read SRV.8.4 of the servlet specification.

Mark

Marten Lehmann wrote:

Hello,

I have a forward to a jsp-file. This jsp-file needs to know which URI 
was requested in the initial request. Currently, I can only see the 
requestURI of the forwarded jsp-file. Any ideas?


Regards
Marten

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



forcing non-cookie sessions?

2005-07-24 Thread Marten Lehmann

Hello,

is there a way to force tomcat (or a web-container in general) not to 
use cookies to keep track of sessions, but to use url-rewriting with the 
;jsessionid=sessID suffix instead?


Regards
Marten

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



I can´t add mod_rewrite.so to the module folder in apache http server

2005-07-24 Thread Adriana Suarez
Hi, I'm knew with http server and I'm trying to make a load balancer
with the http server and two tomcats in linux. I follow the set up
instructions and I use: ./configure --enable-module=rewrite
--enable-module=proxy and other modules. It compiled and installed
without any errors.

My problem is: the mod_proxy.so , mod_rewrite.so don't appear
anywhere, What do I have to do in order to get these *.so?

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



Re: how to get the original requestURI after jsp:forward()

2005-07-24 Thread Marten Lehmann

Hi,


You need to read SRV.8.4 of the servlet specification.


I read it now. However, it's stated there, that path-related-values 
should be overwritten by the container in all request-dispatcher 
occurences. This means: include and forward. But for an include, I can 
see the original requestURI, for an forward, I see the local one. Is 
there any way to obtain the original one? Unfortunately, there's nothing 
like request.getSuper().getRequestURI() or similar. Are all references 
to previous objects cutted?


Regards
Marten

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



Re: I can´t add mod_rewrite.so to t he module folder in apache http server

2005-07-24 Thread Marten Lehmann

Hello,


My problem is: the mod_proxy.so , mod_rewrite.so don't appear
anywhere, What do I have to do in order to get these *.so?


if you don't ask the compiler to create them, they aren't created as 
shared modules, but are included in the httpd-binary by default. Look at 
the output of bin/httpd -l, they should appear there.


Regards
Marten

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



compiling

2005-07-24 Thread ganesan malairaja


if i add new jsp file to the a folder in webapps

will it be compiled when i access it  or i must compile it before accessing 
it ..


thankx



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



What is APR ?

2005-07-24 Thread Anto Paul
Hi all,
Is APR for Tomcat is any native library or java ? Where to get it ?
-- 
rgds
Anto Paul

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



Blocking public access to certain Context

2005-07-24 Thread Foo Shyn
Hi all,

I get this request to configure Tomcat 4.1 so that certain context can be
allow to be access through local IP and not through public IP. I'd tried to
used the valve tag settings in the Context tag to deny the request but
failed. It seems that the tag only denied the configured client IP. Is there
any other configuration i can do to block public access to certain context
in Tomcat??

Thanx.

Regards,
F.S.


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



how to run more than one tomcat on single machine

2005-07-24 Thread Peddireddy Srikanth
Michael.

I am a bit new to deployment and related stuff, so can you tell me how
to run more than one tomcat on a single machine. Is the process is
same as having load balancing tomcat clusters on different machines.
or  
Please direct me towards any documentation on this. I will get the
info from there.

regards
Srikanth


On 7/22/05, Michael Kleinhenz [EMAIL PROTECTED] wrote:
 Peddireddy,
 
  your mail is very informative.
  we have a very similar set up (4 Xeon processors 3.5 GB Ram and
  WIn2003 Standard edition) and hardpart is that we cant change this
  setup and switch to Linux.
 
 same problem over here. The computing centre of our client can't provide
 Linux servers. I'm struggling with this problem for 3 weeks now.
 
  I heard about clustering on diferent boxes. Is the process of running
  multiple tomcats on a single machine will be same??
 
 My experience was that with a single Tomcat on a large machine, you'll
 never use that box fully. Besides that you can't get the Sun JVM to
 accept a large amount of threads while giving them enough memory, Tomcat
 seems to have performance problems with 3000+ threads busy at the same
 time. The BEA JVM (JRockit) performs better in terms of memory and
 threads but is slower than the Sun JVM. If you have rather complex
 database operations performed by your webapp, this will get you into
 trouble, because if there is a single bottleneck in the whole system,
 the requests will pile up in the server, it hits its thread limit, and
 ceases operation.
 
 So, I have made good experiences with 4 Tomcats on a 2xXeon with 4GB.
 The server's load is somewhere between 70% and 100% while running with
 high load and can handle more concurrent requests than a single Tomcat.
 
  You talked about some workarounds using esoteric registry keys, can
  you eloborate on this or tell me where I can get details about it and
  the details about limitations placed by windows2003  on a single
  process in terms of number of threads, memory etc.
 
 We use 2003 Standard Edition and get the following limitations:
 
  . Windows only provides 2GB memory to all applications running,
   regardless of how much memory you have. All other memory is used for
   Windows itself. With a registry key, you can extend this to 3GB. I
   don't have the key handy, but it can be found in MSDN.
 
  . The somewhat larger problem is the crappy TCP stack on Windows. A
   single Tomcat easily handles 1000 concurrent connections, but if I start
   4 Tomcats, I get a WSAENOBUFS error (An operation on a socket could not
   be performed because the system lacked sufficient buffer space or
   because a queue was full) at about 3300 concurrent connections.
   Because each Tomcat runs with his own instance of the JVM, I suppose
   the problem is Windows, the network or anything else that is used by all
   Tomcats at the same time. Even worse, after such a crash, there is a
   10% chance, the Tomcats not resuming normal operation but crashes
   completely.
 
  . Windows has a default limit of 5000 ephemeral ports that can be used
   fo outgoing connections. This can be changed with the MaxUserPorts
   registry key. Also, the TcpTimedWaitDelay key is relevant for network
   performance. Both are described here:
 
   
 http://msdn.microsoft.com/library/en-us/randz/protocol/tcp_time-wait_delay.asp
 
 I'm now really irritated by this problem. I need a capacity of about
 15000 concurrent connections for my project. I also have 3 2xXeon
 servers here, but windows (or anything else) doesn't allow more than
 ~8000 connections until it dies.
 
 -- Michael
 
 --
 Dipl.-Technoinform. Michael Kleinhenz
 tarent GmbH . Bahnhofstr. 13 . 53123 Bonn
 fon +49 (228) / 52 67 5-0 . fax +49 (228) / 52 67 5-25
 
 -
 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: Problem Bringing up Admin

2005-07-24 Thread Peddireddy Srikanth
may be you would have done this but I want to know...
whethere you extracted all  files from that admin archive (zip or tar)
and placed the files in respective folders like
 admin.xml in catalina home\conf\Catalina\localhost
 admin folder in  catalina home\server\webapps\

Srikanth

On 7/22/05, J. Ryan Kelley [EMAIL PROTECTED] wrote:
 I've installed tomcat 5.5.9 and downloaded the admin package.  When I
 attempt to access http://localhost:8080/admin/ I get a blank screen the
 first time, then if i reload I get the following error message in my
 browser.
 
 
 HTTP Status 503 - Servlet admin.login_jsp is currently unavailable
 
 *type* Status report
 *message* _Servlet admin.login_jsp is currently unavailable_
 *description* _The requested service (Servlet admin.login_jsp is
 currently unavailable) is not currently available._
 
 Apache Tomcat /5.5.9
 
 
 
 
 I've read around on several forums, and the usual cause of this seems to
 be duplicate instances of the file struts.jar, however I can only locate
 the struts.jar file that is in
 $CATALINA_HOME/server/webapps/admin/WEB-INF/lib.  Is anyone familiar
 with this problem, I'm sure that it's probably a basic solution, i'm a
 complete and total newbie to tomcat.
 
 Thanks in advance,
 
 --
 J. Ryan Kelley
 Trinity Transport, Inc.
 
 
 


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



running tomcat on windows as webserver and using it as webcontainer for IIS

2005-07-24 Thread Peddireddy Srikanth
Hi ,

Anyone can tell me whether it is better to run tomcat as stanalone
webserver on windows (win 2003 to be specefic) or run it as web
container along with IIS
I want to know which set up would be preferrable in terms of
performance and scalability of application.

regards
Srikanth.P

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



Re: What is APR ?

2005-07-24 Thread Bill Barker
http://apr.apache.org/

Anto Paul [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
Hi all,
Is APR for Tomcat is any native library or java ? Where to get it ?
-- 
rgds
Anto Paul 




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



Re: basic authentication won't accept password (intermittent)

2005-07-24 Thread Eric

Hi again,

I just discovered bug 33157: basic authentication fails in some cases, 
reported in Tomcat 5.5.4.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33157

It doesn't describe my exact problem, but it's the best theory so far. 
Unfortunately the hosting provider is unlikely to install 5.5.9 in the 
near future ;-) Will report back to the list when the resolution is known.



Best,
Eric:)



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