Re: Tomcat 6.0 - Cannot startup Tomcat service

2009-05-31 Thread Jonathan Camilleri
After a bit of tinkering, I uninstalled JDK 1.6 u13 and:
1. Installed JDK 1.6 u14
Release notes:
http://java.sun.com/javase/6/webnotes/6u14.html
Download link:
https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/viewproductdetail-start?productref=jdk-6u14-oth-...@cds-cds_developer
2. Uninstalled Tomcat 6.0.18 and re-installed, using default JVM (within UI)


Tomcat is up and running.  Joy :)  My only problem is that this seemed to
have confused Eclipse 3.4.2, because it's displaying ugly messages on
startup, however, I guess that's another issue.

Thanks,

Jonathan


2009/5/31 Caldarale, Charles R chuck.caldar...@unisys.com

  From: Martin Gainty [mailto:mgai...@hotmail.com]
  Subject: RE: Tomcat 6.0 - Cannot startup Tomcat service
 
  //i would suggest changing
  C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
  to C:\PROGRA~1\Java\jre6\bin\client\jvm.dll

 Completely unnecessary; the service launcher works fine with the JVM in the
 default location.

  set JAVA_OPTS environment variable
  -XXaltjvm=C:\PROGRA~1\Java\jre6
 
  set JAVA_HOME environment variable
  C:\PROGRA~1\Java\jre6

 This is Tomcat running as a Windows service; environment variables aren't
 used.

 What the OP does need to do is install a 64-bit JVM, since he's using the
 64-bit service wrapper.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you received
 this in error, please contact the sender and delete the e-mail and its
 attachments from all computers.


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




-- 
Jonathan Camilleri

Mobile (MT): 00356 7982 7113
E-mail: camilleri@gmail.com
Please consider your environmental responsibility before printing this
e-mail.

I usually reply to e-mails within 2 business days.  If it's urgent, give me
a call.


Re: Potential connection leakage

2009-05-31 Thread Johnny Lui
Dear Chris

I see. Thanks a lot. Your article is useful.


Regards
Johnny



On Sat, May 30, 2009 at 11:35 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Johnny,

 On 5/28/2009 11:53 PM, Johnny Lui wrote:
 Potential connection leakage:4

 Looks like you might be leaking connections. You should fix that!

 http://blog.christopherschultz.net/?p=68

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

 iEYEARECAAYFAkogqWcACgkQ9CaO5/Lv0PAuYQCfVGwzJ+hYFqFsO8fJgGsuTjXb
 JW0AmwZpeEYCbGneTys+iM0TV1cVsdg9
 =T4Ef
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: jk Status not showing errors

2009-05-31 Thread Lawrence Lamprecht
I do not know if this is relevant or not, but I have just installed the latest 
version of mod_jk and the jkstatus is very much better than it used to be.

I had the same issue with loadbalancers not showing when they are offline or 
broken. With the latest version, jksataus has the possibility to auto refresh 
itself. This now shouws when load balancers go down without a request being 
send to it. It is pretty dynamic as well. I ran several tests where I took one 
of the balancers down, and left jkstatus refreshing every 10 seconds and that 
told me that the worker was in error.

It also shows you that the work is OK - IDLE when the worker is not being used 
but is good. As soon as it receives a request the status then changes to OK.

Hope this helps.

Kind regards / Met vriendelijke groet,
Lawrence Lamprecht
Application Content Manager
QUADREM Netherlands B.V.
Kabelweg 61, 1014 BA  Amsterdam
Post Office Box 20672, 1001 NR  Amsterdam
Office: +31 20 880 41 16
Mobile: +31 6 13 14 26 31
Fax: +31 20 880 41 02



Read our blog: Intelligent Supply Management - Your advantage


-Original Message-
From: Rainer Jung [mailto:rainer.j...@kippdata.de] 
Sent: Saturday, May 30, 2009 2:46 PM
To: Tomcat Users List
Subject: Re: jk Status not showing errors

On 29.05.2009 22:50, Matthew Laird wrote:
 Good afternoon,
 
 I've been trying to get the jkstatus component of mod_jk running, and
 I'm not quite sure what I'm doing wrong in trying to have it report dead
 Tomcat instances.
 
 I have two tomcat instances setup in a load balancer, as a test I've
 taken down one of them.  However the jkstatus screen still shows both of
 them as OK.  I'm not sure what I'm missing from my workers.properties
 file to make it test the Tomcat and report a failed instance, so I can
 set Nagios to monitor this page and report problems.
 
 My workers.properties is:
 
 worker.list=production,development,old,jkstatus
 
 worker.production.type=lb
 worker.production.balance_workers=production1,production2
 worker.production.sticky_session=True
 worker.production.method=S
 
 worker.lbbasic.type=ajp13
 worker.lbbasic.connect_timeout=1
 worker.lbbasic.recovery_options=7
 worker.lbbasic.socket_keepalive=1
 worker.lbbasic.socket_timeout=60
 
 worker.production1.reference=worker.lbbasic
 worker.production1.port=8009
 worker.production1.host=localhost
 #worker.production1.redirect=production2
 
 worker.production2.reference=worker.lbbasic
 worker.production2.port=8012
 worker.production2.host=localhost
 #worker.production2.activation=disabled
 
 worker.development.port=8010
 worker.development.host=localhost
 worker.development.type=ajp13
 
 worker.old.port=8011
 worker.old.host=localhost
 worker.old.type=ajp13
 
 worker.jkstatus.type=status
 
 
 Any advice on extra options to make jkstatus check and report when one
 of the Tomcat instances isn't responding would be appreciated.

I assume, that the actual error detection works and you are really only
asking about display in status worker. I also assume your are using a
recent mod_jk. Nevertheless do yourself a favor and look at the Timeouts
documentation page to improve your configuration.

Until recently, only workers used via a load balancing worker had good
manageability with jkstatus. Very recently also pure AJP workers without
any load balancer got more useful information in their display.

So let's talk about your worker production. Whenever a request comes
in the lb first checks whether it already carries a session for one of
the nodes 1 or 2, or whether the request can be freely balanced.

The status of a worker (node) in jkstatus can only change, if a request
is been sent to the worker. So if all your requests belong say to node
2, you'll never notice anything is wrong with 1. But if 1 is broken, and
a request for one comes in, or a request that is freely balanceable and
the lb decides to send it to 1, then JK will detect the problem and
display it. The display will switch from OK to ERR.

If you want to parse the info, do not choose the html format, instead
choose a different output format, like XML or the properties format
(line oriented).

Regards,

Rainer


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: retrive Arabic data

2009-05-31 Thread abdul razack
Hi,
 
Please accept my appreciation for responding my queries.
The problem of retrieving Arabic data is solved.
 
As told, it is not straight answer to the problem and need to figure out step 
by step.
After making sure that everything is perfect from application and database 
point of view, I figured out problem lies in regional and language option 
setting on Windows server. And I corrected the same.
 
Again thank you for the help in achieving the significant result.
 

Thanks  Regards
-Abdul Razack



--- On Sat, 5/30/09, George Sexton geor...@mhsoftware.com wrote:


From: George Sexton geor...@mhsoftware.com
Subject: Re: retrive Arabic data
To: Tomcat Users List users@tomcat.apache.org
Date: Saturday, May 30, 2009, 8:38 PM


Christopher Schultz wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 George,

 On 5/28/2009 3:59 PM, George Sexton wrote:
   
 The issue is the default character set for Java. I've noticed that at
 least at one point in time, the default character set for Java running
 under windows was Windows-1252. Running under Linux it defaults to
 ISO-8859-1.
     

 That's a bold statement.

 $ uname -a
 Linux chadis 2.6.14-gentoo-r5 #2 PREEMPT Sat Dec 17 16:30:55 EST 2005
 i686 AMD Athlon(tm) XP 1700+ AuthenticAMD GNU/Linux

 $ java -version
 java version 1.6.0_13
 Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
 Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

 $ java -classpath .. Env | grep file\.encoding=
 file.encoding=ANSI_X3.4-1968

 That's ASCII, baby!

   
My statements were based on tests I ran at one point in time. Here's 
some tests I ran today:

OpenSuSE 10.3, 11.0 and 11.1 = UTF-8.
Windows XP w/ JDK 1.6.0_13 = Cp1252
MacOS 10.5 = MacRoman


-- 
George Sexton
MH Software, Inc.
Voice: +1 303 438 9585
URL:   http://www.mhsoftware.com/


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




  

How to do with response.sendError() after the ServletOutputStream is established?

2009-05-31 Thread 流水音
HI,ALL:

Servlet code(deployed on Tomcat server):
private void execute(HttpServletRequest req, HttpServletResponse
resp) throws ServletException, IOException {
   try {
int count = 0;
while(count 100){
 out.write(97); // writes 'a' to client
 count++;
 if(count == maxcount()){
 throw new Exception(errors.);
 }
}
}catch(Exception e){
 resp.sendError(605);
 return;
}
}

private int maxcount(){
 return 9;// or return 15;
}

Client code:

URL url = new URL(urlAddress);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setAllowUserInteraction(false);
conn.connect();
InputStream input = null;
try {
input = conn.getInputStream();
int count=0;
while((input.read()) != -1){
count++;
}
System.out.println(total read is:  + count);
} catch (IOException e) {
int code = conn.getResponseCode();
System.out.println(Response code is:  + code);
}finally{
   Closer.close(input);
}

when the maxcount() returns 15, the exception is thrown out before the
first buffer is flushed, then client can get the response code of: 605
but when the maxcount() returns 9, the exception is thrown out
after some buffers flushes, so the client can not get the exception
anymore, the response code is 200.

so, if I want to get the exception during the data transferring in the
client, do you guys have any idea hot to do that?

Thanks and Best Regards.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org