Re: jsp stuff

2005-07-22 Thread beetle

Thankyou very much for your info,best regards,Gregory
- Original Message - 
From: "ganesan malairaja" <[EMAIL PROTECTED]>

To: 
Sent: Saturday, July 23, 2005 2:17 AM
Subject: RE: jsp stuff



thanks


From: Adile Abbadi <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" 
To: Tomcat Users List 
Subject: RE: jsp stuff
Date: Fri, 22 Jul 2005 11:12:16 -0600

You don't need to change anything in tomcat to make it access a database
except one thing - you need is a compliant JDBC driver which you through
into the Common Library directory of tomcat. Once tomcat starts it will 
load
the driver and then at that point you can use code to access the Database. 
I

would recommend you use a pooling tool as well - to pool your connections
and limit resource use.

Check google - lots of info out there.

HTH

Adile


-Original Message-
From: ganesan malairaja [mailto:[EMAIL PROTECTED]
Sent: July 21, 2005 8:53 PM
To: tomcat-user@jakarta.apache.org
Subject: jsp stuff


hi guys

i want to know is there any setting to be done with tomcat so the JSP 
codes

can access the database ( MySQL) and display the information ?


thank you



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

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.9.2/54 - Release Date: 7/21/05

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.2/55 - Release Date: 7/21/05


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




Ganesan_Malairaja



-
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: jsp stuff

2005-07-22 Thread ganesan malairaja

thanks


From: Adile Abbadi <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" 
To: Tomcat Users List 
Subject: RE: jsp stuff
Date: Fri, 22 Jul 2005 11:12:16 -0600

You don't need to change anything in tomcat to make it access a database
except one thing - you need is a compliant JDBC driver which you through
into the Common Library directory of tomcat. Once tomcat starts it will 
load
the driver and then at that point you can use code to access the Database. 
I

would recommend you use a pooling tool as well - to pool your connections
and limit resource use.

Check google - lots of info out there.

HTH

Adile


-Original Message-
From: ganesan malairaja [mailto:[EMAIL PROTECTED]
Sent: July 21, 2005 8:53 PM
To: tomcat-user@jakarta.apache.org
Subject: jsp stuff


hi guys

i want to know is there any setting to be done with tomcat so the JSP codes
can access the database ( MySQL) and display the information ?


thank you



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

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.9.2/54 - Release Date: 7/21/05

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.2/55 - Release Date: 7/21/05


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




Ganesan_Malairaja



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



Re: getting Tomcat 5.5 daemon/service to startup automatically on bootup?

2005-07-22 Thread Bill Barker

"Ferindo Middleton Jr" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> I'm running *Tomcat/5.5.6 on* Fedora Core 4. What is the best way to get 
> my Tomcat server to start automatically on bootup. My server does use SSL. 
> I have read through the info on setting up tomcat as a daemon under Unix 
> at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html and this 
> works after i run the command:
>
> ./bin/jsvc -Djava.endorsed.dirs=./common/endorsed -cp ./bin/bootstrap.jar 
> \
>-outfile ./logs/catalina.out -errfile ./logs/catalina.err \
>org.apache.catalina.startup.Bootstrap
>
>
> but when the computer reboots, no daemon/service  restarts the tomcat 
> automatically. How do you get it to start automatically during bootup.
>

In the jsvc-src/native directory where you unpacked the jsvc source code 
there is a file called Tomcat5.sh.  Edit that so that it specifies the 
options you want.  Then copy it to /etc/init.d.  Then cd to /etc/rc2.d (or 
rc3.d if you boot to init-level three) do:
  ln -s ../init.d/Tomcat5.sh S75tomcat



> Ferindo
>
> -- 
> Ferindo Middleton
> Chief Architect
> Sleekcollar.com 




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



Re: Can't get ssl redirection to work properly

2005-07-22 Thread beetle

DEAR  SIR
Thankyou for your mail, best regards Gregory
- Original Message - 
From: "Terence M. Bandoian" <[EMAIL PROTECTED]>

To: 
Sent: Friday, July 22, 2005 9:52 PM
Subject: Re: Can't get ssl redirection to work properly



Hi,

You might try including a URL pattern containing only "/" in addition to
the "/*" pattern.

-Terence M. Bandoian



Hi again.. I don´t know if this mail reached the mailinglist som I
just reply to myself to get the attention again ;).
Is this kind of behaviour by tomcat normal with the redirection?. Does
behave in this way even if you just have an application.war file
deployed on a standalone tomcat?

Best regards
Stefan Nilsson.
On 7/15/05, Stefan Nilsson <[EMAIL PROTECTED]> wrote:



I am running Jboss 4.0.1 with the tomcat 5.0 and I have an
application.ear called pds running on it. To access the application
you simple write "http://adress:8080/pds";

Now I wanted to enable ssl on the webapp.war in the application so I
changed the server.xml and web.xml and created a keystore and
everything. I redirect from "8080" to "8443" and everything works as
long as do like this.
https://adress:8443/pds - works!!

http://adress:8080/pds/login.jsp - works! get redirected to
https://adress:8443/pds/x

http://adress:8080/pds - doesn´t work - I time out and get a no page
found error.

I really need the the old url "http://adress:8080/pds"; to be
redirected to "https://adress:8443/pds "

Any suggestions??
Best regards
Stefan Nisson

Below follows some relevant sections from my server.xml and web.xml:

=== server.xml ==

  

  


=== web.xml =

  Security for Julius PDS
  
  Julius web Security
  Redirect all to SSL
  /*
  
  
  Protection should be CONFIDENTIAL
  CONFIDENTIAL
  
  




-
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: Can't get ssl redirection to work properly

2005-07-22 Thread Terence M. Bandoian
Hi,

You might try including a URL pattern containing only "/" in addition to
the "/*" pattern.

-Terence M. Bandoian


>> Hi again.. I don´t know if this mail reached the mailinglist som I
>> just reply to myself to get the attention again ;).
>> Is this kind of behaviour by tomcat normal with the redirection?. Does
>> behave in this way even if you just have an application.war file
>> deployed on a standalone tomcat?
>>
>> Best regards
>> Stefan Nilsson.
>> On 7/15/05, Stefan Nilsson <[EMAIL PROTECTED]> wrote:
>>  
>>
>>> I am running Jboss 4.0.1 with the tomcat 5.0 and I have an
>>> application.ear called pds running on it. To access the application
>>> you simple write "http://adress:8080/pds";
>>>
>>> Now I wanted to enable ssl on the webapp.war in the application so I
>>> changed the server.xml and web.xml and created a keystore and
>>> everything. I redirect from "8080" to "8443" and everything works as
>>> long as do like this.
>>> https://adress:8443/pds - works!!
>>>
>>> http://adress:8080/pds/login.jsp - works! get redirected to
>>> https://adress:8443/pds/x
>>>
>>> http://adress:8080/pds - doesn´t work - I time out and get a no page
>>> found error.
>>>
>>> I really need the the old url "http://adress:8080/pds"; to be
>>> redirected to "https://adress:8443/pds "
>>>
>>> Any suggestions??
>>> Best regards
>>> Stefan Nisson
>>>
>>> Below follows some relevant sections from my server.xml and web.xml:
>>>
>>> === server.xml ==
>>>
>>>   >>   port = "8080"
>>>   address = "${jboss.bind.address}"
>>>   maxThreads = "150"
>>>   minSpareThreads = "25"
>>>   maxSpareThreads = "75"
>>>   enableLookups = "false"
>>>   redirectPort = "8443"
>>>   acceptCount = "100"
>>>   connectionTimeout = "2"
>>>   disableUploadTimeout = "true"/>
>>>
>>>   >>   port = "8443"
>>>   address = "${jboss.bind.address}"
>>>   maxThreads = "100"
>>>   minSpareThreads = "5"
>>>   maxSpareThreads = "15"
>>>   scheme = "https"
>>>   secure = "true"
>>>   clientAuth = "false"
>>>   keystoreFile = "./keystore"
>>>   keystorePass = "secret"
>>>   sslProtocol = "TLS"/>
>>>
>>>
>>> === web.xml =
>>> 
>>>   Security for Julius PDS
>>>   
>>>   Julius web Security
>>>   Redirect all to SSL
>>>   /*
>>>   
>>>   
>>>   Protection should be CONFIDENTIAL
>>>   CONFIDENTIAL
>>>   
>>>   
>>

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



Re: Apache2+jk+tomcat5.028+uri utf-8 [NOT] SOLVED

2005-07-22 Thread Chris Brown

An update on the problem

Reading through some other posts I got the suspicion that errno=13 was 
privilege related. On a hunch turned off SELINUX 
(http://fedora.redhat.com/docs/selinux-faq-fc3/index.html#id2825232) and 
everything worked great! The next step is to figure out how to run with it 
back on, but that got me going again.



- Original Message - 
From: "Chris Brown" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Thursday, July 21, 2005 4:06 PM
Subject: Re: Apache2+jk+tomcat5.028+uri utf-8 [NOT] SOLVED


Hello, Sorry for not replying to the thread referenced in my subject (See 
July 1st, 2005), I'm new to the list and didn't have the email to reply 
to.


I am having the same trouble that Paul and Steve encountered. (Error 
connecting to tomcat from mod_jk). Like Steve I have two similarly 
configured machines, one works, one doesn't. I can provide configuration 
files and more detailed logs but the errors I get are similar. Maybe I can 
peek someone's interest or jog a memory by proviging more detail.


I'm running two identically configured Fedora Core 4 boxes. The one that 
works is running on a Pentium II 450mhz running (FC4 i386), the one that 
doesn't work is running on a Xeon 2.8ghz (FC4 x86_64).


I've compiled mod_jk v1.2.14.1 from source on each box configured 
everything with simple settings from the tomcat connector HOWTOs. I'm 
running apache 2.0.54-10. I also tried downloading a precompiled binary 
(jakarta-tomcat-connectors-jk-1.2.10-linux-sles9-x86_64-prefork.so) but 
didn't have any better results.


I tried pointing the working box's workers.properties file to the other 
boxes tomcat to confirm tomcat was in fact listening on port 8009. That 
worked.


I turned off my firewall to ensure that wasn't the issue. below is the log 
from mod_jk. I can provide one with debug message but thought I'd start 
with the shorter version.


Thanks for any help on this matter, I'm stumped.
Chris Brown

[Thu Jul 21 00:18:16 2005] [error] init_jk::mod_jk.c (2356): Initializing 
shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] init_jk::mod_jk.c (2356): Initializing 
shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] jk_child_init::mod_jk.c (2312): 
Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] jk_child_init::mod_jk.c (2312): 
Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] jk_child_init::mod_jk.c (2312): 
Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] jk_child_init::mod_jk.c (2312): 
Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] jk_child_init::mod_jk.c (2312): 
Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] jk_child_init::mod_jk.c (2312): 
Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] jk_child_init::mod_jk.c (2312): 
Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:17 2005] [error] jk_child_init::mod_jk.c (2312): 
Attachning shm:/etc/httpd/logs/jk-runtime-status errno=13
[Thu Jul 21 00:18:21 2005] [info]  jk_open_socket::jk_connect.c (444): 
connect to 127.0.0.1:8009 failed with errno=13
[Thu Jul 21 00:18:21 2005] [info] 
ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to 
(127.0.0.1:8009) with (errno=13)
[Thu Jul 21 00:18:21 2005] [info]  ajp_send_request::jk_ajp_common.c 
(1248): Error connecting to the Tomcat process.
[Thu Jul 21 00:18:21 2005] [info]  ajp_service::jk_ajp_common.c (1749): 
Sending request to tomcat failed,  recoverable operation attempt=1
[Thu Jul 21 00:18:21 2005] [info]  jk_open_socket::jk_connect.c (444): 
connect to 127.0.0.1:8009 failed with errno=13
[Thu Jul 21 00:18:21 2005] [info] 
ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to 
(127.0.0.1:8009) with (errno=13)
[Thu Jul 21 00:18:21 2005] [info]  ajp_send_request::jk_ajp_common.c 
(1248): Error connecting to the Tomcat process.
[Thu Jul 21 00:18:21 2005] [info]  ajp_service::jk_ajp_common.c (1749): 
Sending request to tomcat failed,  recoverable operation attempt=2
[Thu Jul 21 00:18:21 2005] [info]  jk_open_socket::jk_connect.c (444): 
connect to 127.0.0.1:8009 failed with errno=13
[Thu Jul 21 00:18:21 2005] [info] 
ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to 
(127.0.0.1:8009) with (errno=13)
[Thu Jul 21 00:18:21 2005] [info]  ajp_send_request::jk_ajp_common.c 
(1248): Error connecting to the Tomcat process.
[Thu Jul 21 00:18:21 2005] [info]  ajp_service::jk_ajp_common.c (1749): 
Sending request to tomcat failed,  recoverable operation attempt=3
[Thu Jul 21 00:18:21 2005] [error] ajp_service::jk_ajp_common.c (1758): 
Error connecting to tomcat. Tomcat is probably not started or is listening 
on the wrong port. worker=ajp13w failed
[Thu Jul 21 00:18:21 2005] [info] 

RE: getting Tomcat 5.5 daemon/service to startup automatically on bootup?

2005-07-22 Thread Pugalia, Jai P \(JP\)

The following link has information on starting Tomcat as a service on
Linux:

http://www.spaceprogram.com/knowledge/2004/01/starting-tomcat-as-service
-on-linux.html

JP 

-Original Message-
From: Ferindo Middleton Jr [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 22, 2005 4:13 PM
To: tomcat-user@jakarta.apache.org
Subject: getting Tomcat 5.5 daemon/service to startup automatically on
bootup?

I'm running *Tomcat/5.5.6 on* Fedora Core 4. What is the best way to get
my Tomcat server to start automatically on bootup. My server does use
SSL. I have read through the info on setting up tomcat as a daemon under
Unix at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html and
this works after i run the command:

./bin/jsvc -Djava.endorsed.dirs=./common/endorsed -cp
./bin/bootstrap.jar \
-outfile ./logs/catalina.out -errfile ./logs/catalina.err \
org.apache.catalina.startup.Bootstrap


but when the computer reboots, no daemon/service  restarts the tomcat
automatically. How do you get it to start automatically during bootup.

Ferindo

--
Ferindo Middleton
Chief Architect
Sleekcollar.com


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



getting Tomcat 5.5 daemon/service to startup automatically on bootup?

2005-07-22 Thread Ferindo Middleton Jr
I'm running *Tomcat/5.5.6 on* Fedora Core 4. What is the best way to get 
my Tomcat server to start automatically on bootup. My server does use 
SSL. I have read through the info on setting up tomcat as a daemon under 
Unix at http://jakarta.apache.org/tomcat/tomcat-5.5-doc/setup.html and 
this works after i run the command:


./bin/jsvc -Djava.endorsed.dirs=./common/endorsed -cp ./bin/bootstrap.jar \
   -outfile ./logs/catalina.out -errfile ./logs/catalina.err \
   org.apache.catalina.startup.Bootstrap


but when the computer reboots, no daemon/service  restarts the tomcat 
automatically. How do you get it to start automatically during bootup.


Ferindo

--
Ferindo Middleton
Chief Architect
Sleekcollar.com


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



Re: Problem running Tomcat on Windows 64-Bit Edition

2005-07-22 Thread Spors, Jeffrey R
Bill, thanks for the response.
I could not find a binary for srvbatch so I started looking at compiling
a 64bit version myself; however, I don't have any knowledge of makefiles
and can't seem to get my attempted makefiles to run.  Is it possible I
could get the makefiles you used (or the 64bit binary for that matter)? 
Also, a README for commons-daemon talks about needing Cygwin.  Is this
something I'll need to get?  Thanks for the help.

Jeff Spors
Winona State University


-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Barker
Sent: Thursday, July 21, 2005 9:00 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: Problem running Tomcat on Windows 64-Bit Edition

There is a srvbatch in commons-daemon (I'm too lazy to look if there is
a 
binary released for it :) that will allow you run the batch files as a 
service.

You can also grab the source from commons-daemon and compile a 64bit
version 
yourself (only the MSDK is needed, but you need to create your own 
makefiles).

I've done both, and they both work well (but only the second one lets
you 
have the nice configuration GUI :).

"Spors, Jeffrey R" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
I am trying to run Tomcat 5.5.9 as a service on Windows Server 2003
64-Bit Edition.

The following scenarios work fine:
 - 32-bit JDK and Tomcat 5.5 running as a service and using startup.bat
 - 64-bit JDK and Tomcat 5.5 using startup.bat

However, I can't run 64-bit JDK and Tomcat 5.5 as a service because it
runs tomcat5.exe, which is 32-bit app (32-bit apps cannot reference
64-bit apps and vice versa on Windows 64).

Is there a 64-bit binary for tomcat5.exe, is it possible for me to build
tomcat5.exe as a 64-bit app from source, or is there a way of getting
Tomcat to run as a service using only the .bat files?  Thanks for any
help.

Jeff Spors
Winona State University 




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



basic authentication won't accept password (intermittent)

2005-07-22 Thread Eric

Hello,

My client has a password-protected folder (as shown in the snippet from 
my web.xml below). The problem is that, when accessing a protected 
resource (/members/jobs/index.html), it sometimes asks for the login 
several times before returning the requested page. (This is using BASIC 
authentication, so the browser pops up a dialog in response to the 401.) 
Occasionally it gives up and shows the 401 Unauthorized error page instead.


This problem is reproducible across several browsers on Windows 2000 
(IE6, Firefox, Opera, lynx ...). The Authorization header is the same 
for both successful and unsuccessful requests.


Hosting provider's environment:
Linux 2.4.24 on i686
Apache 2.0.47
Tomcat 5.5.4
Java: Blackdown-1.4.2-rc1

In server.xml, I've increased maxThreads to 250, although this is not a 
high-volume site. (Obviously I'm shooting in the dark at this point ;-)


My questions are: (1) Where should we look for misconfiguration, whether 
in my app or in the hosting environment? (2) Is there any other 
explanation for this behavior?


This is my first Tomcat site in production, so hopefully it's a 
configuration problem. I appreciate any suggestions!


Thanks,
Eric:)

=== from my web.xml ===


   BASIC
   Members Area



   Authorized members
   members



   
   
   Search Engine
   /jsp/admin/*
   
   
   Data Listing
   /list.do
   
   
   admin
   



   
   
   members area
   /members/*
   
   
   members
   



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



RE: Error 500 messages

2005-07-22 Thread Adile Abbadi
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



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  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%>
>>
>><%
>>}
>>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:
>>
>>
>><%@ 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%>
>>
>><%
>>}
>>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):
>>
>>
>><%@ 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%>
>>
>><%
>>}
>>rs.close();
>>SQLS.close();
>>connMgr.freeConnection("podb",Conn);
>>%>
>>
>>An error will get thrown to the screen
>>
>>org.apache.jasper.JasperException: Unable to compile class f

Re: Error 500 messages

2005-07-22 Thread Tim Funk

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

<%
   }
   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:


<%@ 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%>

<%
   }
   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):


<%@ 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%>

<%
   }
   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

/var/lib/tomcat4/work/Standalone/localhost/podims/testdb_jsp.java:57: ')'
expected
if (col1.equals("yes") {

However if I try to force a null pointer error by correcting my syntax
error - I get a blank screen! If remove the include I get the null pointer
error no problem. The other behaviour I noticed as well is that as I said
before if the include is above the <%@ page language piece it works
fine - only if its an html - if its another jsp file - I get a blank


screen


as well.

So has anyone else seen this behaviour - is there a fix or a work around -
should I got back to Tomcat 3?? I'm going to try your suggestion Rob and


see


if that helps at all, but to me its seems like an issue with the JSP
compiler.

Cheers

Adile





RE: Error 500 messages

2005-07-22 Thread Adile Abbadi
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  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%>
> 
> <%
> }
> 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:
>
> 
> <%@ 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%>
> 
> <%
> }
> 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):
>
> 
> <%@ 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%>
> 
> <%
> }
> 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
>
> /var/lib/tomcat4/work/Standalone/localhost/podims/testdb_jsp.java:57: ')'
> expected
>   if (col1.equals("yes") {
>
> However if I try to force a null pointer error by correcting my syntax
> error - I get a blank screen! If remove the include I get the null pointer
> error no problem. The other behaviour I noticed as well is that as I said
> before if the include is above the <%@ page language piece it works
> fine - only if its an html - if its another jsp file - I get a blank
screen
> as well.
>
> So has anyone else seen this behaviour - is there a fix or a work around -
> should I got back to Tomcat

Re: Error 500 messages

2005-07-22 Thread Tim Funk
This line  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%>

<%
}
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:


<%@ 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%>

<%
}
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):


<%@ 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%>

<%
}
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

/var/lib/tomcat4/work/Standalone/localhost/podims/testdb_jsp.java:57: ')'
expected
if (col1.equals("yes") {

However if I try to force a null pointer error by correcting my syntax
error - I get a blank screen! If remove the include I get the null pointer
error no problem. The other behaviour I noticed as well is that as I said
before if the include is above the <%@ page language piece it works
fine - only if its an html - if its another jsp file - I get a blank screen
as well.

So has anyone else seen this behaviour - is there a fix or a work around -
should I got back to Tomcat 3?? I'm going to try your suggestion Rob and see
if that helps at all, but to me its seems like an issue with the JSP
compiler.

Cheers

Adile



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



RE: Error 500 messages

2005-07-22 Thread Adile Abbadi
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%>

<%
}
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:


<%@ 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%>

<%
}
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):


<%@ 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%>

<%
}
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

/var/lib/tomcat4/work/Standalone/localhost/podims/testdb_jsp.java:57: ')'
expected
if (col1.equals("yes") {

However if I try to force a null pointer error by correcting my syntax
error - I get a blank screen! If remove the include I get the null pointer
error no problem. The other behaviour I noticed as well is that as I said
before if the include is above the <%@ page language piece it works
fine - only if its an html - if its another jsp file - I get a blank screen
as well.

So has anyone else seen this behaviour - is there a fix or a work around -
should I got back to Tomcat 3?? I'm going to try your suggestion Rob and see
if that helps at all, but to me its seems like an issue with the JSP
compiler.

Cheers

Adile

-Original Message-
From: Rob Hills [mailto:[EMAIL PROTECTED]
Sent: July 21, 2005 9:36 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: Error 500 messages


Hi Adile,

I did say it was untested, and I've spotted a problem in my code already
(why are bugs so invisible BEFORE you press the send button??!!)

On 22 Jul 2005 at 9:41, Rob Hills wrote:

> Something like the following (untested) in your error.jsp should do the
trick:
>
> <%
>   if (exception == null) {
> %>
> A null exception was encountered
> <%
>   } else {
> if (exception instanceof SQLException) {
>   Exception e = exception;  // WRONG

the 

Re: Reloading web context in a cluster

2005-07-22 Thread Peter Rossbach

Davide Romanini schrieb:


Il giorno ven, 22/07/2005 alle 16.39 +0200, Peter Rossbach ha scritto:
 


Hey,

a)   don't share things between cluster nodes!
   



You mean that Tomcat has problems using a shared filesystem???

 


No, tomcat has no problem with shared systems

b)   before you change your lib at one node please shutdown the context 
with manager app or ant tasks.
c)   Release change at runtime with cluster is heavy and can not made 
with the same nodes.
 OK, when no class changed that used inside session replication, it 
can be work!

d)   Don't change all nodes at the same time.
 Change one and
 after restart context - see that all session comes in.
 Then made change the others.
e)   Build cluster domains and not running all nodes inside one cluster.
 Tomcat cluster replicated all sessions between every node and 
this is very memory intensive.


   



We are not using (for now) clustering features of Tomcat: we only have 6
instances of Tomcat running without knowing of the others, we have no
session replication.

 

OK, but the word "cluster" means to mean me that replication is 
active... :-)



So the only solution to update my classes seems to be:

- unload the Axis context for each of the six machines
- update my jar file into WEB-INF/lib
- reload the Axis context for each of the six machines

 



Have you at the reloading="true" to your context.xml? At default tomcat 
not look for class and jar updates!



Am I right?

 


I think no!


Bye,
Davide Romanini



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




 




--
J2EE Systemarchitekt und Tomcat Experte

http://objektpark.de/
http://tomcat.objektpark.org/
http://centaurus.sourceforge.net/

Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:(49) 175 1660884
E-Mail:  [EMAIL PROTECTED]




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



RE: jsp stuff

2005-07-22 Thread Adile Abbadi
You don't need to change anything in tomcat to make it access a database
except one thing - you need is a compliant JDBC driver which you through
into the Common Library directory of tomcat. Once tomcat starts it will load
the driver and then at that point you can use code to access the Database. I
would recommend you use a pooling tool as well - to pool your connections
and limit resource use.

Check google - lots of info out there.

HTH

Adile


-Original Message-
From: ganesan malairaja [mailto:[EMAIL PROTECTED]
Sent: July 21, 2005 8:53 PM
To: tomcat-user@jakarta.apache.org
Subject: jsp stuff


hi guys

i want to know is there any setting to be done with tomcat so the JSP codes
can access the database ( MySQL) and display the information ?


thank you



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

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.9.2/54 - Release Date: 7/21/05

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.338 / Virus Database: 267.9.2/55 - Release Date: 7/21/05


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



Re: Request parameter data not being recognised as UTF-8

2005-07-22 Thread Martin Bromley
If you take a look at the API docs for ServletRequest.setCharacterEncoding(), they say 


"This method must be called prior to reading request parameters or reading input 
using getReader()."

By the time execution gets to your JSP page, something has probably read your 
request parameters - maybe an MVC controller servlet of some sort.

Martin

Tim Koop wrote:

Thanks Mikolaj.  That did it.

For some reason running request.setCharacterEncoding("UTF-8") in my code 
does nothing, but if it gets run from a Filter it works great.


Tim Koop



Mikolaj Rydzewski wrote:


Tim Koop wrote:

I have a web page form that is expecting UTF-8 data, but when my code 
gets the data, the getParameter() methods don't return the right 
thing.  I have to run this code to get the right thing:


String value = new 
String(request.getParameter("fieldName").getBytes("ISO-8859-1"), 
"UTF-8");




Please take a look at SetCharacterEncodingFilter servlet in Tomcat's 
example apps. It does the job you need. Its sources are located in 
webapps/jsp-examples/WEB-INF/classes/filters (at least in Tomcat 5.5).


Regards



-
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: Request parameter data not being recognised as UTF-8

2005-07-22 Thread Tim Koop

Thanks Mikolaj.  That did it.

For some reason running request.setCharacterEncoding("UTF-8") in my code 
does nothing, but if it gets run from a Filter it works great.


Tim Koop



Mikolaj Rydzewski wrote:


Tim Koop wrote:

I have a web page form that is expecting UTF-8 data, but when my code 
gets the data, the getParameter() methods don't return the right 
thing.  I have to run this code to get the right thing:


String value = new 
String(request.getParameter("fieldName").getBytes("ISO-8859-1"), 
"UTF-8");



Please take a look at SetCharacterEncodingFilter servlet in Tomcat's 
example apps. It does the job you need. Its sources are located in 
webapps/jsp-examples/WEB-INF/classes/filters (at least in Tomcat 5.5).


Regards



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



RE: Max thread/session timeouts

2005-07-22 Thread Darek Czarkowski
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: Reloading web context in a cluster

2005-07-22 Thread Davide Romanini
Il giorno ven, 22/07/2005 alle 16.39 +0200, Peter Rossbach ha scritto:
> Hey,
> 
> a)   don't share things between cluster nodes!

You mean that Tomcat has problems using a shared filesystem???

> b)   before you change your lib at one node please shutdown the context 
> with manager app or ant tasks.
> c)   Release change at runtime with cluster is heavy and can not made 
> with the same nodes.
>   OK, when no class changed that used inside session replication, it 
> can be work!
> d)   Don't change all nodes at the same time.
>   Change one and
>   after restart context - see that all session comes in.
>   Then made change the others.
> e)   Build cluster domains and not running all nodes inside one cluster.
>   Tomcat cluster replicated all sessions between every node and 
> this is very memory intensive.
> 

We are not using (for now) clustering features of Tomcat: we only have 6
instances of Tomcat running without knowing of the others, we have no
session replication.

So the only solution to update my classes seems to be:

- unload the Axis context for each of the six machines
- update my jar file into WEB-INF/lib
- reload the Axis context for each of the six machines

Am I right?

Bye,
Davide Romanini



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



Re: Reloading web context in a cluster

2005-07-22 Thread Peter Rossbach

Hey,

a)   don't share things between cluster nodes!
b)   before you change your lib at one node please shutdown the context 
with manager app or ant tasks.
c)   Release change at runtime with cluster is heavy and can not made 
with the same nodes.
 OK, when no class changed that used inside session replication, it 
can be work!

d)   Don't change all nodes at the same time.
 Change one and
 after restart context - see that all session comes in.
 Then made change the others.
e)   Build cluster domains and not running all nodes inside one cluster.
 Tomcat cluster replicated all sessions between every node and 
this is very memory intensive.


Peter


Davide Romanini schrieb:


Hi,

I'm developing some web services using Axis. The whole axis context
(containing all my services) is embedded as a servlet into Tomcat 5.5.9.
Any time I create a new version of one service, I need to replace the
previous jar file into WEB-INF/lib, so to make changes effective I also
must reload the axis context (using manager facility).

My problem is that in production environment we have 6 machines with a
shared filesystem (gpfs) in load-balancing. So I think that if I do a
reload of the context using manager, I actually reload just one of the 6
istances of Tomcat (the one answered me in that moment), but the other 5
don't see the changes made to WEB-INF/lib and continue to run and old
version of the service.

Take into account that I don't have access to each single machine of the
cluster, so I can't do a reload of all the 6 contexts from my machine.

There's a way to propagate a context reload between the clusters?? I
really need to access each machine and reload for each single Tomcat
instance?

Thanks in advance.

Bye,
Davide Romanini


-
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: Change Apache Run User

2005-07-22 Thread Raghupathy,Gurumoorthy
In httpd.conf ther us user and group .. Change that  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 22 July 2005 15:22
To: tomcat-user@jakarta.apache.org
Subject: Change Apache Run User


 
I currently run startup scripts for Apache and Tomcat in the /etc/rc3.d
folder.  In the default setup the user 'nobody' is the one who the
Apache service runs as.  Does anyone know how to change the user that
Apache runs under?

Thanks for you help.


This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information.  If you have
received it in error, please notify the sender immediately and delete the
original.  Any other use of the email by you is prohibited.

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



Change Apache Run User

2005-07-22 Thread uttam.g.dubal
 
I currently run startup scripts for Apache and Tomcat in the /etc/rc3.d
folder.  In the default setup the user 'nobody' is the one who the
Apache service runs as.  Does anyone know how to change the user that
Apache runs under?

Thanks for you help.


This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.

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



Re: Replacing a class file

2005-07-22 Thread Tim Koop

That sounds like it should work to me.  I do the same thing every day.

Perhaps this code has also been compiled into a jar and is sitting in 
WEB-INF/lib or tomcat/shared.


Or try deleting the files in the tomcat/work directory. I think 
technically this shouldn't fix it, but it doesn't hurt if you're desperate.


And of course check all the obvious things like: Are you sure you are 
copying the new class file? Are you sure you saved the java file when 
you compiled it?  Are you sure you are putting it in the right 
directory?  Perhaps you have more than one web app/web site on your 
server.  If you have more that one instance of Tomcat running maybe you 
restarted the wrong one.  Check file permissions.  Maybe the new class 
is actually running and the changes you made to the java file don't 
actually fix the problem.


Tim Koop



none none wrote:


Hello,
I am very new to tomcat, I hope someone is able to help me out.

There is a Java application sitting in one of the servers and I have been asked 
to modify some code in there.
I figured out that the code need to be changed is in one of the class files, so 
I found the java source code, modified it on my desktop, compile it then I 
simply replaced the old class file with the new one under WEB-INF.

Now, I did a "service tomcat restart" command, but the change didn't take 
effect. I am totally confused and don't know what to do. How do I make tomcat pick-up the 
new class file?

Any help would be great.
Thank you.

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



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



Re: Request parameter data not being recognised as UTF-8

2005-07-22 Thread Mikolaj Rydzewski

Tim Koop wrote:

I have a web page form that is expecting UTF-8 data, but when my code 
gets the data, the getParameter() methods don't return the right 
thing.  I have to run this code to get the right thing:


String value = new 
String(request.getParameter("fieldName").getBytes("ISO-8859-1"), 
"UTF-8");


Please take a look at SetCharacterEncodingFilter servlet in Tomcat's 
example apps. It does the job you need. Its sources are located in 
webapps/jsp-examples/WEB-INF/classes/filters (at least in Tomcat 5.5).


Regards

--
Mikolaj Rydzewski  <[EMAIL PROTECTED]>
Becomo S.A.
tel. (12) 2927104




smime.p7s
Description: S/MIME Cryptographic Signature


Re: Request parameter data not being recognised as UTF-8

2005-07-22 Thread Manfred Steurer

Try saving the JSP-File itself as UTF-8.
Worked for me at a similar Problem.

- ms



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



Re: Request parameter data not being recognised as UTF-8

2005-07-22 Thread Tim Koop

Thanks Mark.

I entered "Tübingen" and I got back "Data posted to this form was: 
Tübingen".  localhost_log also has "Tübingen"


It does this for both port 8080 (Tomcat directly), and port 80 (through 
Apache).


I checked the Tomcat 4.1.31 release notes 
(http://apache.sunsite.ualberta.ca/jakarta/tomcat-4/v4.1.31/RELEASE-NOTES) 
and the closest thing I could find is the following, which is only 
documentation.


[4.1.31] Docs:
Correctly document default value for useBodyEncodingForURI

I modified the simple jsp page to have these lines:
   <%
 out.print("Char endoding = " + request.getCharacterEncoding() + "");
 request.setCharacterEncoding("utf-8");
 out.print("Data posted to this form was: " + request.getParameter("mydata") + 
"");
 out.print("Char endoding = " + request.getCharacterEncoding() + "");
   %>

The response was:

Char endoding = null

Data posted to this form was: Tübingen

Char endoding = utf-8


Should I have something in my web.xml file?  Is there some way to verify 
that what I enter in the Connector tag in server.xml is actually 
sticking?  I couldn't find any errors in localhost.log nor in 
cataline.out (well, no relavent errors at least).


Thanks a lot, to anyone who has any ideas.

--
Tim Koop




Mark Thomas wrote:



1. Try accessing Tomcat directly to see if mod_jk is causing problems.
2. Try 4.1.31 - it has a bunch of bug fixes that might (I haven't 
checked the release note for details) help
3. Try the following simple test JSP and once this works, see how your 
app is different.


<%@ page contentType="text/html; charset=UTF-8" %>


  
Encoding fun
  
  
Data posted to this form was:
<%
  request.setCharacterEncoding("UTF-8");
  out.print(request.getParameter("mydata"));
%>



  
  
  

  


Mark


-
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: Jsp and xml

2005-07-22 Thread Tim Koop

Two things I can think of:

1. Remember that a line that contains <% ...code... %>  will also 
produce an end-of-line (eol) character, so instead of something like this:

<% for (int i=0; i
 
<% } %>

do something like this:

<% for (int i=0; i
<% } %>

or this:

<% for (int i=0; i
<% } %>

2.  Maybe you are producing the xml/jsp on a Windows computer that 
produces CR + LF characters and viewing it on a computer that interprets 
these as two separate EOL characters.  This is not as likely as number 1 
above.


Tim Koop




Kiran Patel wrote:


Hello all,

I am creating a xml document using JSP.  The JAVA codes in JSP creates blank 
lines in xml document.  How can I remove this or how can I don't create.  I 
will appreciate any help.

Thank You,

Kiran Patel
Software Engineer
Solutions Inc.

 



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



Replacing a class file

2005-07-22 Thread none none
Hello,
 I am very new to tomcat, I hope someone is able to help me out.
 
There is a Java application sitting in one of the servers and I have been asked 
to modify some code in there.
 I figured out that the code need to be changed is in one of the class files, 
so I found the java source code, modified it on my desktop, compile it then I 
simply replaced the old class file with the new one under WEB-INF.
 
 Now, I did a "service tomcat restart" command, but the change didn't take 
effect. I am totally confused and don't know what to do. How do I make tomcat 
pick-up the new class file?
 
Any help would be great.
Thank you.

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

Problem Bringing up Admin

2005-07-22 Thread J. Ryan Kelley
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.




Re: Can't get ssl redirection to work properly

2005-07-22 Thread Manfred Steurer

I think you have a problem with the url-pattern in the web.xml.
It redirects anything after pds/ to ssl - but in http://adress:8080/pds 
there is nothing.


I don't have time to test now, but it may work without any url-pattern 
or just * instead of /*.


- ms

Stefan Nilsson wrote:


Hi again.. I don´t know if this mail reached the mailinglist som I
just reply to myself to get the attention again ;).
Is this kind of behaviour by tomcat normal with the redirection?. Does
behave in this way even if you just have an application.war file
deployed on a standalone tomcat?

Best regards
Stefan Nilsson. 


On 7/15/05, Stefan Nilsson <[EMAIL PROTECTED]> wrote:
 


I am running Jboss 4.0.1 with the tomcat 5.0 and I have an
application.ear called pds running on it. To access the application
you simple write "http://adress:8080/pds";

Now I wanted to enable ssl on the webapp.war in the application so I
changed the server.xml and web.xml and created a keystore and
everything. I redirect from "8080" to "8443" and everything works as
long as do like this.
https://adress:8443/pds - works!!

http://adress:8080/pds/login.jsp - works! get redirected to
https://adress:8443/pds/x

http://adress:8080/pds - doesn´t work - I time out and get a no page
found error.

I really need the the old url "http://adress:8080/pds"; to be
redirected to "https://adress:8443/pds "

Any suggestions??
Best regards
Stefan Nisson

Below follows some relevant sections from my server.xml and web.xml:

=== server.xml ==

  

  


=== web.xml =

  Security for Julius PDS
  
  Julius web Security
  Redirect all to SSL
  /*
  
  
  Protection should be CONFIDENTIAL
  CONFIDENTIAL
  
  

   



-
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: Can't get ssl redirection to work properly

2005-07-22 Thread Stefan Nilsson
Hi again.. I don´t know if this mail reached the mailinglist som I
just reply to myself to get the attention again ;).
Is this kind of behaviour by tomcat normal with the redirection?. Does
behave in this way even if you just have an application.war file
deployed on a standalone tomcat?

Best regards
Stefan Nilsson. 

On 7/15/05, Stefan Nilsson <[EMAIL PROTECTED]> wrote:
> I am running Jboss 4.0.1 with the tomcat 5.0 and I have an
> application.ear called pds running on it. To access the application
> you simple write "http://adress:8080/pds";
> 
> Now I wanted to enable ssl on the webapp.war in the application so I
> changed the server.xml and web.xml and created a keystore and
> everything. I redirect from "8080" to "8443" and everything works as
> long as do like this.
> https://adress:8443/pds - works!!
> 
> http://adress:8080/pds/login.jsp - works! get redirected to
> https://adress:8443/pds/x
> 
> http://adress:8080/pds - doesn´t work - I time out and get a no page
> found error.
> 
> I really need the the old url "http://adress:8080/pds"; to be
> redirected to "https://adress:8443/pds "
> 
> Any suggestions??
> Best regards
> Stefan Nisson
> 
> Below follows some relevant sections from my server.xml and web.xml:
> 
> === server.xml ==
> 
>port = "8080"
>address = "${jboss.bind.address}"
>maxThreads = "150"
>minSpareThreads = "25"
>maxSpareThreads = "75"
>enableLookups = "false"
>redirectPort = "8443"
>acceptCount = "100"
>connectionTimeout = "2"
>disableUploadTimeout = "true"/>
> 
>port = "8443"
>address = "${jboss.bind.address}"
>maxThreads = "100"
>minSpareThreads = "5"
>maxSpareThreads = "15"
>scheme = "https"
>secure = "true"
>clientAuth = "false"
>keystoreFile = "./keystore"
>keystorePass = "secret"
>sslProtocol = "TLS"/>
> 
> 
> === web.xml =
> 
>Security for Julius PDS
>
>Julius web Security
>Redirect all to SSL
>/*
>
>
>Protection should be CONFIDENTIAL
>CONFIDENTIAL
>
>
>

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



getServletContext() returns "/" for default context defined outside of server.xml

2005-07-22 Thread Martin Bromley

Hi, I'm trying to setup the default Context for a Host, without defining it in 
server.xml.

In conf/Catalina/localhost I've created a file named .xml, and defined the Context within 
it, without defining the path - I understand from the Tomcat docs that it should be 
inferred as "".

This is all working fine, apart from one issue:  a call to HttpServletRequest.getServletContext() returns "/" 
rather than "" - the servlet API says "" is correct .  If the default context is defined in 
server.xml, getServletContext() returns "" as it should.

I'm guessing that this might be a bug, but I'm reluctant to say so because I suspect I might be 
doing something wrong - the Tomcat docs do say "it is not recommended to place 
 elements directly in the server.xml file", but then creating a .xml file 
seems a little odd to me...  Is that really the right way to do it?

I've tested this on Tomcat 5.5.4 and 5.5.7.

Cheers
Martin


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



Re: Configure "email catcher" for dev and stage environments?

2005-07-22 Thread Tim Funk
An "easier" solution is to build your own mail server which eats all the 
emails or redirects them to a test email account where you can view the results.


-Tim

Marc Guillemot wrote:


Hi,

in dev and stage environments, we are working with real data but have to 
avoid that email are really sent to the users. Our current solution is 
that the code sending emails checks what the current environment is to 
know if it should really send the email to the specified address or to a 
special configured "catch address".


This is not really a clean solution and I was wondering how other are 
proceding? Is there a possibility to configure Tomcat to say that the 
provided mail Session should not really send the emails but "catch them"?
 


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



Re: Limitting bandwidth: Filedownload

2005-07-22 Thread Tim Funk
Sounds like you would need to write a servlet filter to perform the 
throttling. I'd guess there are some out there that do similar.


-Tim

Lars Nielsen Lind wrote:


Hi.

 


Is there a way to make two channels with Apache / Jakarta-Tomcat regarding
to the Internet connections bandwidth?

 


One channel serving jsp, html, gif, jpg, png files, another channel serving
pdf, xls, doc files. Lets say the bandwidth totally are 512 kb is it then
possible to define for instance 384 kb for the first channel and 128 kb for
the last channel, vice versa?

 


The files are physically placed in the filesystem outside of Apache /
Jakarta-Tomcat webapp directory and is fetched with a download servlet
component.

  


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



Re: Max thread/session timeouts

2005-07-22 Thread Peddireddy Srikanth
Hi Michael,
Thanks for the information.
I will try to further study this problem and let you know if I found
anything useful.
Mean while can you let me know about any JVM options that you are
using for running your tomcat and that you think will be useful in
server performance and scalability. So that I can check whether any
one of them are applicable in our context.

regards
Srikanth Peddireddy. 

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: Max thread/session timeouts

2005-07-22 Thread Michael Kleinhenz
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]



Configure "email catcher" for dev and stage environments?

2005-07-22 Thread Marc Guillemot

Hi,

in dev and stage environments, we are working with real data but have to avoid that email are really sent to the users. 
Our current solution is that the code sending emails checks what the current environment is to know if it should really 
send the email to the specified address or to a special configured "catch address".


This is not really a clean solution and I was wondering how other are proceding? Is there a possibility to configure 
Tomcat to say that the provided mail Session should not really send the emails but "catch them"?


Marc.


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



Reloading web context in a cluster

2005-07-22 Thread Davide Romanini
Hi,

I'm developing some web services using Axis. The whole axis context
(containing all my services) is embedded as a servlet into Tomcat 5.5.9.
Any time I create a new version of one service, I need to replace the
previous jar file into WEB-INF/lib, so to make changes effective I also
must reload the axis context (using manager facility).

My problem is that in production environment we have 6 machines with a
shared filesystem (gpfs) in load-balancing. So I think that if I do a
reload of the context using manager, I actually reload just one of the 6
istances of Tomcat (the one answered me in that moment), but the other 5
don't see the changes made to WEB-INF/lib and continue to run and old
version of the service.

Take into account that I don't have access to each single machine of the
cluster, so I can't do a reload of all the 6 contexts from my machine.

There's a way to propagate a context reload between the clusters?? I
really need to access each machine and reload for each single Tomcat
instance?

Thanks in advance.

Bye,
Davide Romanini


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



Re: Max thread/session timeouts

2005-07-22 Thread Peddireddy Srikanth
Michael,

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. So what you told "Tomcat on Windows doesn't
scale well" is bothering me

I heard about clustering on diferent boxes. Is the process of running
multiple tomcats on a single machine will be same??
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.

Thanks in advance.

With regards
Srikanth.P

On 7/22/05, Michael Kleinhenz <[EMAIL PROTECTED]> wrote:
> 
> >  We're running an application on Tomcat that often hits the limit of
> > 150 threads.  Can someone with experience changing this value give me
> > advice on it?  How big can you make this number?  How much extra memory
> > do I need if I say change it to, say, 500?  Thanks.
> 
> just a few facts on threads in Tomcat:
> 
>  . you'll need (Xss*max_threads)+Xmx+x memory in your box, where x is
>the memory needed by the basic JVM tasks besides the thread space
>(say, 100MB).
> 
>  . on ia32/Windows, you can only assign 1.6GB (Xmx-)memory to a single
>JVM. A value above it will break the 2GB barrier and will not run.
> 
>  . you need to find the balance between max_threads and Xmx. A lower Xmx
>gives you a higher max_threads and vice versa.
> 
>  . Tomcat on Windows doesn't scale well. Use multiple Tomcat instances
>on one box if you have a large box. In my setup, I run 4 Tomcats on a
>2xXeon system with 4GB memory. Each Tomcat gets 1000 threads and
>512MB. This is _much_ faster than a single Tomcat with all
>memory and 4000 threads.
> 
>  . Windows 2003 Server, at least the Standard Edition has major
>limitations in both TCP connections and memory. There are some
>workarounds using esoteric registry keys, but none of them works
>well. Windows is a crippled desktop os that wants to be on the
>server. If you want really high performance on large boxes, use
>Linux (Kernel 2.6!). You even get a better administration
>interface. Hate this inefficient administration-by-clicking ;-)
> 
> -- Michael
> 
> --
> Dipl.-Technoinform Michael Kleinhenz
> tarent GmbH . Bahnhofstraße 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]



Tomcat 5.0.19 + parsing XML

2005-07-22 Thread Francesco Pellegrini



Hi 
all,
 
I have 
an environment with Tomcat 5.0.19 (jre 1.4.2)  whit SQL Server 
database.
 
I should create a 
new one web application, that call a remote host (by socket on TCP/IP) and 
read/write stream XML.
 
I have already more 
web application runs on Tomcat Servlet container, 
 
I would know if is 
possible integrate  Tomcat with one parser XML (for example 
JDOM).
 
Otherwise 
which Application server can i choose??
 
Thanks in 
advance,
 
Francesco.
 
 
 
 

  
  

   
  

  Telematica 
  Italia s.r.l.Piazza 
  della Repubblica, 1 - 05100 TerniTel. 0744/431616 - Fax 
  0744.428739e-mail:[EMAIL PROTECTED] 
  Sito:www.telematicaitalia.it 
  
 


tomcat SSL problem

2005-07-22 Thread tam wei
Hi all,

I am trying to open a SSL connection from a tomcat server (called it TC1) 
that locate within a DMZ to the other tomcat server (called it TC2) which is 
located in external network.

I got the following in the TC1 system.out,

WARNING: Servlet.service() for servlet HelloWorld threw exception
java.net.SocketException: Default SSL context init failed: null
at javax.net.ssl.DefaultSSLSocketFactory.createSocket(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Sou
rce)
at HelloWorld.doGet(HelloWorld.java:20)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:214)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:825)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:738)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
int.java:526)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFol
lowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:684)
at java.lang.Thread.run(Unknown Source)

Here is the servlet i place in TC1 which open a SSL connection to TC2.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.net.URL;
import java.net.URLConnection;

public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request,HttpServletResponse response) 
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("Hello World");

URL url = new URL("https://154.123.23.10:8443";);
URLConnection con = url.openConnection(); 
con.connect();

}
}

 I have used java keytool to generate a self-signed cert and also a keystore 
in TC2. Below is the Connector element of the server.xml of TC2



I also imported the self-signed cert into the truststore of machine which 
host the TC1. The place i store the self-signed cert of TC2 is 
jre_home\lib\security\cacerts

I think i have setup the SSL correctly.

Does anyone know how to resolve the exception "java.net.SocketException: 
Default SSL context init failed: null" I mentioned above?

Thanks for your help

wx


Re: What commands to run in the Tomcat Debug Mode on Linux

2005-07-22 Thread Christoph Kutzinski

Wendy Smoak wrote:


I'm also unsure of the difference between 'run' and 'start'.  If you just
type 'catalina.bat' with no parameters, it prints out a usage statement that
lists 'jpda start' but not 'run jpda'.  Since it lists both 'run -security'
and 'start -security' separately I have to wonder if  'run jpda' is even a
valid option.


"run jpda" does not work. But "jpda run" works fine , I use it all the 
time.


Christoph


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