Failed to install Tomcat5 service

2007-06-13 Thread hezjing

Hi!

I got this error when trying to install Tomcat 5.5.23 on Windows XP:

Failed to install Tomcat5 service.
Check your settings and permissions
Ignore and continue anyway (not recommended)?

the above error occurs with these status:
..
tomcat-users.xml written
Remove folder: C:\Temp\confinstall
Using Jvm: C:\Program Files\Java\jre1.5.0_11\bin\client\jvm.dll

I abort the installation at this point.

After searching the Google, I tried to set the environment variable
TEMP and TMP to C:\Temp, but that doesn't help either.

When I open the Services (Local) window, I see that there is a service
named Apache Tomcat (Apache Tomcat 5.5.23 Server -
http://tomcat.apache.org/"; ...
I think this service is created but not being remove when I abort the
Tomcat installation.

Please help, thank you!


--

Hez

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Thread Pool

2007-06-13 Thread Andre Prasetya

I am a bit loss reading your message.

is the flow like this ?
a java program called a servlet in multi thread mode
while the request is being processed, the java program called another
process and somehow end up in calling another servlet in the same manner as
above. But then the program have to wait the 1st call to finish instead of
it running on seperate thread.

Am i true ?
if truethen the mistake is at your java program and not at tomcat. If you
need thread pooling, you can use jdk5's ExecutorService.


On 6/12/07, Siraj Haider <[EMAIL PROTECTED]> wrote:


I am using tomcat version:5.5.20 java version:1.6.0-b105 os version:
intel solaris 5.10
scenario is: my java program call a servlet which return to my java
program using sendData and then goes into a loop to perform other
functions.  Now after i get the control back in my java program i try to
call another servlet on the same tomcat, but it waits until the previous
servlet call (which was in a loop to perform other functions) is done.
I have these settings in my servler.xml for thread pooling:
maxThreads="1000" minSpareThreads="100" maxSpareThreads="200"
acceptCount="500".  Can somebody please how to fix this problem ?



This electronic mail message and any attachments may contain information
which is privileged, sensitive and/or otherwise exempt from disclosure under
applicable law. The information is intended only for the use of the
individual or entity named as the addressee above. If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution (electronic or otherwise) or forwarding of, or the taking of
any action in reliance on, the contents of this transmission is strictly
prohibited. If you have received this electronic transmission in error,
please notify us by telephone, facsimile, or e-mail as noted above to
arrange for the return of any electronic mail or attachments. Thank You.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
-Andre-

People see things the way they are and say "why ?" I see things that never
were and say "Why not ?"


Re: Erratic HTTP response behavior

2007-06-13 Thread Matt Cosentino
I'm not setting the transfer-encoding, but thanks.

- Original Message 
From: Martin Gainty <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Wednesday, June 13, 2007 8:47:28 PM
Subject: Re: Erratic HTTP response behavior

if you are setting Transfer-encoding to 'chunked' as in
response.setHeader( "Transfer-Encoding", "chunked");
then read and follow these directives
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html

Caveat Emptor!
Martin-
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Len Popp" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Wednesday, June 13, 2007 7:38 PM
Subject: Re: Erratic HTTP response behavior


> It's pretty obvious by now that no-one's going to be able to email you
> a solution to your problem, which seems unique or at least very
> unusual. You're going to have to dig deeply into this one yourself.
>
> Here's what I'd do, if it helps you any. I would track the problem
> requests from the browser to the server and back again, at several
> points, to see where it's going wrong.
> - Look at the request and response in the browser using a plug-in like
> LiveHTTPHeaders or ieHTTPHeaders.
> - Log the requests received by Tomcat (AccessLogValve or 
> RequestDumperValve).
> - Put logging messages in your application, in every servlet or JSP,
> to see what piece of code is executed for each request.
> - Use a network sniffer (e.g. Wireshark) to see if the HTTP responses
> are being sent to the correct clients. You may have to log traffic at
> both the client and server ends if there's a proxy or gateway between
> them.
>
> Given all of those logs, you should be able to figure out where a
> particular request went astray - in Tomcat, in the application, or in
> the network. My money's on the network.
> -- 
> Len
>
> On 6/13/07, Matt Cosentino <[EMAIL PROTECTED]> wrote:
>> Well that didn't last long.  After making some other changes the problem 
>> has returned... with a vengeance!  Seriously, it's even weirder than 
>> before.  Not only are some responses coming back chunked, but some are 
>> coming back completely wrong.  Like I try to open my index page and it 
>> responds with an image.  I tried reverting everything that I changed back 
>> to how they were before and the problem doesn't go away.  So strange, 
>> could really use some help.
>>
>> - Original Message 
>> From: Matt Cosentino <[EMAIL PROTECTED]>
>> To: Tomcat Users List 
>> Sent: Wednesday, June 13, 2007 2:20:24 PM
>> Subject: Re: Erratic HTTP response behavior
>>
>> Ok, so I made a small change and somehow I think I fixed it.  I removed 
>> the following line from my page:
>>
>> 
>>
>> This happened by accident, I only removed it because the icon didn't 
>> exist at that path.  After doing that I noticed that everything would 
>> always load correctly.
>>
>> I then added it back to see if that really did fix it, and sure enough 
>> the problem came back.  Then I just moved the line before some files that 
>> I often had problems loading, and the problem went away.  So it seems to 
>> me that when Tomcat tried to respond to that request it was breaking the 
>> responses of the other resources, somehow.  I don't understand it, but I 
>> figured I'd at least share my experience in case this helps anyone else.
>>
>> - Original Message 
>> From: Matt Cosentino <[EMAIL PROTECTED]>
>> To: Tomcat Users List 
>> Sent: Monday, June 11, 2007 1:07:37 PM
>> Subject: Re: Erratic HTTP response behavior
>>
>> In a previous discussion it was said that the problem was fixed in 
>> 5.5.17, so maybe the problem was reintroduced somehow.
>>
>> - Original Message 
>> From: Matt Cosentino <[EMAIL PROTECTED]>
>> To: Tomcat Users List 
>> Sent: Friday, June 8, 2007 6:12:28 PM
>> Subject: Re: Erratic HTTP response behavior
>>
>> I tried looking through the archive and just couldn't find any help.  The 
>> problem has recently reproduced itself on a new Tomcat 5.5.23 install on 
>> one of my co-worker's machine, so it's not my PC.  I've also experienced 
>> it more often with random images or other resources not loading, and when 
>> I check the network monitor in Firebug it lists the transfer-encoding for 
>> them as chunked.  Luckily this problem has never surfaced on our 
>> production server which is version 5.5.17, but I don't see any 
>> configuration differences.  This is driving me nuts, so any help would be 
>> greatly appreciated.
>>
>> - Original Message 
>> From: Matt Cosentino <[EMAIL PROTECTED]>
>> To: Tomcat Users List 
>> Sent: Friday, May 25, 2007 4:09:57 PM
>> Subject: Re: Erratic HTTP response behavior
>>
>> No I am on intending on using chunked responses.  Is the

Re: Erratic HTTP response behavior

2007-06-13 Thread Matt Cosentino
Thanks, I've been using Firebug to track the requests and responses from 
Firefox, which is how I found the strange chunked transfer encoding behavior.  
I'll try some of the other things you mentioned.

- Original Message 
From: Len Popp <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Wednesday, June 13, 2007 6:38:43 PM
Subject: Re: Erratic HTTP response behavior

It's pretty obvious by now that no-one's going to be able to email you
a solution to your problem, which seems unique or at least very
unusual. You're going to have to dig deeply into this one yourself.

Here's what I'd do, if it helps you any. I would track the problem
requests from the browser to the server and back again, at several
points, to see where it's going wrong.
- Look at the request and response in the browser using a plug-in like
LiveHTTPHeaders or ieHTTPHeaders.
- Log the requests received by Tomcat (AccessLogValve or RequestDumperValve).
- Put logging messages in your application, in every servlet or JSP,
to see what piece of code is executed for each request.
- Use a network sniffer (e.g. Wireshark) to see if the HTTP responses
are being sent to the correct clients. You may have to log traffic at
both the client and server ends if there's a proxy or gateway between
them.

Given all of those logs, you should be able to figure out where a
particular request went astray - in Tomcat, in the application, or in
the network. My money's on the network.
-- 
Len

On 6/13/07, Matt Cosentino <[EMAIL PROTECTED]> wrote:
> Well that didn't last long.  After making some other changes the problem has 
> returned... with a vengeance!  Seriously, it's even weirder than before.  Not 
> only are some responses coming back chunked, but some are coming back 
> completely wrong.  Like I try to open my index page and it responds with an 
> image.  I tried reverting everything that I changed back to how they were 
> before and the problem doesn't go away.  So strange, could really use some 
> help.
>
> - Original Message 
> From: Matt Cosentino <[EMAIL PROTECTED]>
> To: Tomcat Users List 
> Sent: Wednesday, June 13, 2007 2:20:24 PM
> Subject: Re: Erratic HTTP response behavior
>
> Ok, so I made a small change and somehow I think I fixed it.  I removed the 
> following line from my page:
>
> 
>
> This happened by accident, I only removed it because the icon didn't exist at 
> that path.  After doing that I noticed that everything would always load 
> correctly.
>
> I then added it back to see if that really did fix it, and sure enough the 
> problem came back.  Then I just moved the line before some files that I often 
> had problems loading, and the problem went away.  So it seems to me that when 
> Tomcat tried to respond to that request it was breaking the responses of the 
> other resources, somehow.  I don't understand it, but I figured I'd at least 
> share my experience in case this helps anyone else.
>
> - Original Message 
> From: Matt Cosentino <[EMAIL PROTECTED]>
> To: Tomcat Users List 
> Sent: Monday, June 11, 2007 1:07:37 PM
> Subject: Re: Erratic HTTP response behavior
>
> In a previous discussion it was said that the problem was fixed in 5.5.17, so 
> maybe the problem was reintroduced somehow.
>
> - Original Message 
> From: Matt Cosentino <[EMAIL PROTECTED]>
> To: Tomcat Users List 
> Sent: Friday, June 8, 2007 6:12:28 PM
> Subject: Re: Erratic HTTP response behavior
>
> I tried looking through the archive and just couldn't find any help.  The 
> problem has recently reproduced itself on a new Tomcat 5.5.23 install on one 
> of my co-worker's machine, so it's not my PC.  I've also experienced it more 
> often with random images or other resources not loading, and when I check the 
> network monitor in Firebug it lists the transfer-encoding for them as 
> chunked.  Luckily this problem has never surfaced on our production server 
> which is version 5.5.17, but I don't see any configuration differences.  This 
> is driving me nuts, so any help would be greatly appreciated.
>
> - Original Message 
> From: Matt Cosentino <[EMAIL PROTECTED]>
> To: Tomcat Users List 
> Sent: Friday, May 25, 2007 4:09:57 PM
> Subject: Re: Erratic HTTP response behavior
>
> No I am on intending on using chunked responses.  Is there a way to disable 
> it?
>
> - Original Message 
> From: Christopher Schultz <[EMAIL PROTECTED]>
> To: Tomcat Users List 
> Sent: Friday, May 25, 2007 4:02:58 PM
> Subject: Re: Erratic HTTP response behavior
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Matt,
>
> You're right, this /is/ erratic behavior. I think something is going
> wrong with your headers or something:
>
> Matt Cosentino wrote:
> > 0 HTTP/1.1 200 OKServer: Apache-Coyote/1.1Transfer-Encoding: 
> > chunkedDate: Fri, 18 May 2007 22:35:13 GMT
>
> Your response headers appear to be after the body of the response.
> Either that or the headers I see there are supposed to be the headers
> from the next chunk and/or re

Re: Tomcat Server CPU utilization goes upto 400%

2007-06-13 Thread PTS

Sumit,

Look at the design of the app. Is each session doing a query every 30 
seconds? Also is the database on the same server?


I had an app that was originally designed to be for a few users that each 
session hit the database. Due to the amount of processing of the data it had 
a snowball effect that after more than a few users connected the system 
began to fall behind and the system came to a crawl. Since my query was the 
same for all users, I was able to spawn a thread to do a query every few 
minutes and cache the results, then each session grabbed a copy of the 
cached data from memory.


I would also have to agree that it appears to be an application issue, 
especially after experiencing it myself. Or more accurately doing it to 
myself.


Doug


- Original Message - 
From: "Sumit Gaikaiwari" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Wednesday, June 13, 2007 11:17 PM
Subject: RE: Tomcat Server CPU utilization goes upto 400%





There is an application deployed that refreshes after every 30 seconds.
After every 30 seconds, it requeries database and fetches the data. This
was a design requirement for this application. Generally large numbers
of sessions of this application are running (450-500).

Regards,
Sumit Gaikaiwari


-Original Message-
From: Andre Prasetya [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 13, 2007 4:22 PM
To: Tomcat Users List
Subject: Re: Tomcat Server CPU utilization goes upto 400%

i think its more to application problem instead of tomcat problem. Is
there
any application hosted inside tomcat that get infinite loop or use a
kind of
loop checking something that utilize the thread fully ? try solving that
with the application developer

On 6/13/07, Sumit Gaikaiwari <[EMAIL PROTECTED]> wrote:



Hello,



We are using tomcat 5.0.25 on Red Hat Enterprise Linux server. There

two

applications in webapps. We are facing an issue from around 3-4 months
where the CPU utilization by java process (tomcat) goes quite high:
around 400% in every 4-5 days. The application gets very slow and

tomcat

needs to be restarted for normal operation. The output of top command

is

as below-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# top

Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie

Cpu(s): 25.1% us,  0.1% sy,  0.0% ni, 74.5% id,  0.2% wa,  0.0% hi,
0.0% si

Mem:   4086472k total,  2487676k used,  1598796k free,   217464k

buffers


Swap:  6094824k total,0k used,  6094824k free,  1811576k

cached




  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND

1038 root  16   0  545m 244m  61m S  101  6.1   1156:22 java

1 root  16   0  2556  552  472 S0  0.0   0:01.17 init

2 root  RT   0 000 S0  0.0   0:00.31

migration/0






Here is the status of active threads-

Thread Status-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# ps -Le -o
pid,user,s,lwp,pcpu,args | awk '$3 != "S" { print }'

1038 root R  1093 19.8 /usr/local/j2sdk1.4.2_12/bin/java -Xmx256m
-Xms128m -Djava.awt.headless=true -Dsun.awt.font.advancecache=off
-Djava.endorsed.dirs=/usr/local/jakarta-tomcat-5.0.25/common/endorsed
-classpath


/usr/local/j2sdk1.4.2_12/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.25/



bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.25/bin/commons-logging-a

pi.jar -Dcatalina.base=/usr/local/jakarta-tomcat-5.0.25
-Dcatalina.home=/usr/local/jakarta-tomcat-5.0.25
-Djava.io.tmpdir=/usr/local/jakarta-tomcat-5.0.25/temp
org.apache.catalina.startup.Bootstrap start

20544 root R 20544  0.0 ps -Le -o pid,user,s,lwp,pcpu,args



This was status at certain instant of time. After 5 hours from this
instant, the utilization reached to 400% and also there were many
threads which were using almost 150% of CPU time.



The system configuration is -



[EMAIL PROTECTED] ~]# wget --quiet -O - --user admin --password nimda
http://localhost:8080/manager/serverinfo

OK - Server info

Tomcat Version: Apache Tomcat/5.0.25

OS Name: Linux

OS Version: 2.6.9-42.0.2.ELsmp

OS Architecture: i386

JVM Version: 1.4.2_12-b03

JVM Vendor: Sun Microsystems Inc.



Please can any one tell me possible cause for this issue? This issue

has

become very critical and needs to be fixed out soon.



Regards,

Sumit Gaikaiwari



-**Nihilent***

" *** All information contained in this communication is confidential,
proprietary, privileged and is intended for the addressees only. If

you have

received this E-mail in error please notify mail administrator by

telephone

on +91-20-39846100 or E-mail the sender by replying to this message,

and

then delete this E-mail and other copies of it from your computer

system.

Any unauthorized dissemination, publication, transfer or use of the

contents

of this communication, with or without modifications is punishable

under the

relevant law.

Nihilent has scanned this mail with current virus checking

technologies.

However, Nihilent makes no repr

Re: Invalid Content-Length error for the size greater than

2007-06-13 Thread Bill Barker

"Christopher Schultz" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Bill,
>
> Bill Barker wrote:
>> This would let us
>> see what mod_proxy_ajp is sending to Tomcat (which I very strongly 
>> suspect
>> is wrong).
>
> Tomcat should still accept any valid numeric Content-Length header, even
> if it exceeds Integer.MAX_VALUE. The Java AJP connector currently
> requires an int, but should accept something larger (albeit with reduced
> support through the HttpServletRequest.getContentLength method).
>
> An end user should always be able to parse their own Content-Length
> header for large values. In this case, mod_whatever is breaking the
> number. However, once mod_whatever is fixed, the AJP connector will
> still trip over the fact that the value exceeds maxint.
>
> (Looks like you have a fix for that. Which connectors does it cover?)
>

All of the non-deprecated ones now from TC 3.3-6.x (at least in SVN), 
including the upcoming TC 5.5.24: 
http://mail-archives.apache.org/mod_mbox/tomcat-dev/200706.mbox/[EMAIL 
PROTECTED] 
But they mostly worked (or at least didn't do more than drop the connection) 
before this.


>> However, if my guess is right, then the problem is with httpd sending a 
>> bad
>> value for the Content-Length header, so you would have to report it over
>> there and get it fixed.  I don't have enough spare cycles to test this
>> myself, but I'm sure that between you and Chris it will get nailed down.
>
> Two mod_jk heavy-lifters frequent the list (Mladen and Rainer). If it
> turns out that Daniel is using mod_jk, they should be notified
> separately. From Daniel's messages plus the info available in the bug,
> it's unclear whether he is using mod_jk or mod_proxy_ajp. That
> information is important to identify before bothering someone on either
> project ;)
>

Of course both Mladen and Rainer are on [EMAIL PROTECTED], so they have seen 
the 
traffic on the bug report (as are a couple of the other mod_proxy_ajp 
developers).

> This discussion can probably be taken off the mailing list and into
> Bugzilla: http://issues.apache.org/bugzilla/show_bug.cgi?id=42608
>

Unless you are also on [EMAIL PROTECTED], you haven't CCed yourself on this one.

> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGbtD59CaO5/Lv0PARAhnOAJ4lyY65R4Ery20fPa0vDortYsO3vwCgroyq
> JSIy1JBN/u7zFBRS0nj4HKw=
> =+YL4
> -END PGP SIGNATURE-
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat Server CPU utilization goes upto 400%

2007-06-13 Thread Sumit Gaikaiwari



There is an application deployed that refreshes after every 30 seconds.
After every 30 seconds, it requeries database and fetches the data. This
was a design requirement for this application. Generally large numbers
of sessions of this application are running (450-500). 

Regards,
Sumit Gaikaiwari


-Original Message-
From: Andre Prasetya [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 13, 2007 4:22 PM
To: Tomcat Users List
Subject: Re: Tomcat Server CPU utilization goes upto 400%

i think its more to application problem instead of tomcat problem. Is
there
any application hosted inside tomcat that get infinite loop or use a
kind of
loop checking something that utilize the thread fully ? try solving that
with the application developer

On 6/13/07, Sumit Gaikaiwari <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
>
>
>
> We are using tomcat 5.0.25 on Red Hat Enterprise Linux server. There
two
> applications in webapps. We are facing an issue from around 3-4 months
> where the CPU utilization by java process (tomcat) goes quite high:
> around 400% in every 4-5 days. The application gets very slow and
tomcat
> needs to be restarted for normal operation. The output of top command
is
> as below-
>
>
>
> [EMAIL PROTECTED] jakarta-tomcat-5.0.25]# top
>
> Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie
>
> Cpu(s): 25.1% us,  0.1% sy,  0.0% ni, 74.5% id,  0.2% wa,  0.0% hi,
> 0.0% si
>
> Mem:   4086472k total,  2487676k used,  1598796k free,   217464k
buffers
>
> Swap:  6094824k total,0k used,  6094824k free,  1811576k
cached
>
>
>
>   PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
>
> 1038 root  16   0  545m 244m  61m S  101  6.1   1156:22 java
>
> 1 root  16   0  2556  552  472 S0  0.0   0:01.17 init
>
> 2 root  RT   0 000 S0  0.0   0:00.31
migration/0
>
>
>
>
>
> Here is the status of active threads-
>
> Thread Status-
>
>
>
> [EMAIL PROTECTED] jakarta-tomcat-5.0.25]# ps -Le -o
> pid,user,s,lwp,pcpu,args | awk '$3 != "S" { print }'
>
> 1038 root R  1093 19.8 /usr/local/j2sdk1.4.2_12/bin/java -Xmx256m
> -Xms128m -Djava.awt.headless=true -Dsun.awt.font.advancecache=off
> -Djava.endorsed.dirs=/usr/local/jakarta-tomcat-5.0.25/common/endorsed
> -classpath
>
/usr/local/j2sdk1.4.2_12/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.25/
>
bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.25/bin/commons-logging-a
> pi.jar -Dcatalina.base=/usr/local/jakarta-tomcat-5.0.25
> -Dcatalina.home=/usr/local/jakarta-tomcat-5.0.25
> -Djava.io.tmpdir=/usr/local/jakarta-tomcat-5.0.25/temp
> org.apache.catalina.startup.Bootstrap start
>
> 20544 root R 20544  0.0 ps -Le -o pid,user,s,lwp,pcpu,args
>
>
>
> This was status at certain instant of time. After 5 hours from this
> instant, the utilization reached to 400% and also there were many
> threads which were using almost 150% of CPU time.
>
>
>
> The system configuration is -
>
>
>
> [EMAIL PROTECTED] ~]# wget --quiet -O - --user admin --password nimda
> http://localhost:8080/manager/serverinfo
>
> OK - Server info
>
> Tomcat Version: Apache Tomcat/5.0.25
>
> OS Name: Linux
>
> OS Version: 2.6.9-42.0.2.ELsmp
>
> OS Architecture: i386
>
> JVM Version: 1.4.2_12-b03
>
> JVM Vendor: Sun Microsystems Inc.
>
>
>
> Please can any one tell me possible cause for this issue? This issue
has
> become very critical and needs to be fixed out soon.
>
>
>
> Regards,
>
> Sumit Gaikaiwari
>
>
>
> -**Nihilent***
>
> " *** All information contained in this communication is confidential,
> proprietary, privileged and is intended for the addressees only. If
you have
> received this E-mail in error please notify mail administrator by
telephone
> on +91-20-39846100 or E-mail the sender by replying to this message,
and
> then delete this E-mail and other copies of it from your computer
system.
> Any unauthorized dissemination, publication, transfer or use of the
contents
> of this communication, with or without modifications is punishable
under the
> relevant law.
>
> Nihilent has scanned this mail with current virus checking
technologies.
> However, Nihilent makes no representations or warranties to the effect
that
> this communication is virus-free.
>
> Nihilent reserves the right to monitor all E-mail communications
> through  its Corporate Network. *** "
>
>

*-




-- 
-Andre-

People see things the way they are and say "why ?" I see things that
never
were and say "Why not ?"

-**Nihilent***

" *** All information contained in this communication is confidential,
proprietary, privileged and is intended for the addressees only. If you
have received this E-mail in error please notify mail administrator by
telephone on +91-20-39846100 or E-mail the sender by replying to this
message, and then delete this E-mail and other copies of it from your
computer system. Any unauthorized

[CVE-2007-2450]: Apache Tomcat XSS vulnerability in Manager

2007-06-13 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

CVE-2007-2450: Apache Tomcat XSS vulnerabilities in Manager

Severity: low (cross-site scripting)

Vendor:
The Apache Software Foundation

Versions Affected:
Tomcat 4.0.0 to 4.0.6
Tomcat 4.1.0 to 4.1.36
Tomcat 5.0.0 to 5.0.30
Tomcat 5.5.0 to 5.5.24
Tomcat 6.0.0 to 6.0.13

Description:
The Manager and Host Manager web applications do not escape some user
provided data before including it in the output. This enables a XSS
attack. The user must be logged in to the Manager or Host Manager web
application.

Mitigation:
1. Log out of the Manager or Host Manager application (close the
browser) once tasks requiring use of the manager have been completed.

Example:
http://example.com:8080/manager/html/upload";
method="post" enctype="multipart/form-data">




Credit:
These issues were discovered by Daiki Fukumori, Secure Sky Technology.

References:
http://tomcat.apache.org/security.html

Mark Thomas




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

iD8DBQFGcKdkb7IeiTPGAkMRAt1IAKCR47H3juKSvEdGwymOMCpKZdXi8wCgvrzl
aQy4/FihDqtrwRDLl0f/asA=
=RGcQ
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[CVE-2007-2449] Apache Tomcat XSS vulnerabilities in the JSP examples

2007-06-13 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

CVE-2007-2449: Apache Tomcat XSS vulnerabilities in the JSP examples

Severity: low (cross-site scripting)

Vendor:
The Apache Software Foundation

Versions Affected:
Tomcat 4.0.0 to 4.0.6
Tomcat 4.1.0 to 4.1.36
Tomcat 5.0.0 to 5.0.30
Tomcat 5.5.0 to 5.5.24
Tomcat 6.0.0 to 6.0.13

Description:
The JSP examples web application displays does not escape some user
provided data before including it in the output. This enables a XSS
attack.

Mitigation:
1. Undeploy the examples web application(s).

Example:
http://host:port/jsp-examples/snp/snoop.jsp;alert()test.jsp

Credit:
These issues were discovered by an unknown security researcher and
reported to JPCERT.

References:
http://tomcat.apache.org/security.html

Mark Thomas




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

iD8DBQFGcKbJb7IeiTPGAkMRAi9BAKDsuoomGh2n9BYl7mT/tGEjQ+HIlQCdHjnU
zdreMwViLR/bDBnys5YkhPk=
=SK7+
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Erratic HTTP response behavior

2007-06-13 Thread Martin Gainty

if you are setting Transfer-encoding to 'chunked' as in
response.setHeader( "Transfer-Encoding", "chunked");
then read and follow these directives
http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html

Caveat Emptor!
Martin-
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Len Popp" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Sent: Wednesday, June 13, 2007 7:38 PM
Subject: Re: Erratic HTTP response behavior



It's pretty obvious by now that no-one's going to be able to email you
a solution to your problem, which seems unique or at least very
unusual. You're going to have to dig deeply into this one yourself.

Here's what I'd do, if it helps you any. I would track the problem
requests from the browser to the server and back again, at several
points, to see where it's going wrong.
- Look at the request and response in the browser using a plug-in like
LiveHTTPHeaders or ieHTTPHeaders.
- Log the requests received by Tomcat (AccessLogValve or 
RequestDumperValve).

- Put logging messages in your application, in every servlet or JSP,
to see what piece of code is executed for each request.
- Use a network sniffer (e.g. Wireshark) to see if the HTTP responses
are being sent to the correct clients. You may have to log traffic at
both the client and server ends if there's a proxy or gateway between
them.

Given all of those logs, you should be able to figure out where a
particular request went astray - in Tomcat, in the application, or in
the network. My money's on the network.
--
Len

On 6/13/07, Matt Cosentino <[EMAIL PROTECTED]> wrote:
Well that didn't last long.  After making some other changes the problem 
has returned... with a vengeance!  Seriously, it's even weirder than 
before.  Not only are some responses coming back chunked, but some are 
coming back completely wrong.  Like I try to open my index page and it 
responds with an image.  I tried reverting everything that I changed back 
to how they were before and the problem doesn't go away.  So strange, 
could really use some help.


- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Wednesday, June 13, 2007 2:20:24 PM
Subject: Re: Erratic HTTP response behavior

Ok, so I made a small change and somehow I think I fixed it.  I removed 
the following line from my page:




This happened by accident, I only removed it because the icon didn't 
exist at that path.  After doing that I noticed that everything would 
always load correctly.


I then added it back to see if that really did fix it, and sure enough 
the problem came back.  Then I just moved the line before some files that 
I often had problems loading, and the problem went away.  So it seems to 
me that when Tomcat tried to respond to that request it was breaking the 
responses of the other resources, somehow.  I don't understand it, but I 
figured I'd at least share my experience in case this helps anyone else.


- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Monday, June 11, 2007 1:07:37 PM
Subject: Re: Erratic HTTP response behavior

In a previous discussion it was said that the problem was fixed in 
5.5.17, so maybe the problem was reintroduced somehow.


- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, June 8, 2007 6:12:28 PM
Subject: Re: Erratic HTTP response behavior

I tried looking through the archive and just couldn't find any help.  The 
problem has recently reproduced itself on a new Tomcat 5.5.23 install on 
one of my co-worker's machine, so it's not my PC.  I've also experienced 
it more often with random images or other resources not loading, and when 
I check the network monitor in Firebug it lists the transfer-encoding for 
them as chunked.  Luckily this problem has never surfaced on our 
production server which is version 5.5.17, but I don't see any 
configuration differences.  This is driving me nuts, so any help would be 
greatly appreciated.


- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, May 25, 2007 4:09:57 PM
Subject: Re: Erratic HTTP response behavior

No I am on intending on using chunked responses.  Is there a way to 
disable it?


- Original Message 
From: Christopher Schultz <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, May 25, 2007 4:02:58 PM
Subject: Re: Erratic HTTP response behavior

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

You're right, this /is/ erratic behavior. I think something is going
wrong with your headers or something:

Matt Cosentino wrote:
> 0 HTTP/1.1 200 OKServer: 
> Apache-Coyote/1.1Trans

Re: JSVC with JDK 6 on Intel Xenon x86_64

2007-06-13 Thread Bill Barker
Easiest is to symlink amd64 to i386.

Second easiest is to edit Makefile and change the CPU variable to be i386 
and recompile.  You could also edit location.c and add the right path and 
recompile.

"ben short" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi,
>
> I'm trying to compile jsvc on a RedHat 4 ES box. I have installed JDK
> 6 and typing java -version at the shell prompt tells me its installed
> OK.
> I then compile jsvc with that jdk and it completes ok.
> When I try and run the following startup script I get the following
> debug output.
>
>
> #!/bin/bash
> # chkconfig: 2345 101  05
> # description: Apache Tomcat 6
>
> JAVA_HOME='/usr/lib/jvm/java-1.6.0-sun'
> CATALINA_HOME='/usr/local/tomcat/tomcat6'
>
> CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar
> CLASSPATH=${CLASSPATH}:$CATALINA_HOME/bin/commons-daemon.jar
> CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
> echo $CLASSPATH
>
> JAVA_OPTS='-Xms1024m -Xmx3072m -server'
> JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE
> -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
>
> # Uncomment the next line to enable java debuging
> #JAVA_OPTS=${JAVA_OPTS} ${JAVA_DEBUG_OPTS}
> echo $JAVA_OPTS
>
>
> TOMCAT_USER=daemon
>
> TMPDIR=/var/tmp
>
>
> RC=0
>
> case "$1" in
>
>  start)
>
>   $CATALINA_HOME/bin/jsvc   \
> -debug \
> -user $TOMCAT_USER \
> -home $JAVA_HOME   \
> -jvm server \
> -Dcatalina.home=$CATALINA_HOME \
> -Xmx256m \
> -Djava.io.tmpdir=$TMPDIR \
> -Djava.awt.headless=true \
> -outfile $CATALINA_HOME/logs/catalina.out \
> -errfile $CATALINA_HOME/logs/catalina.err \
> -cp $CLASSPATH  \
> org.apache.catalina.startup.Bootstrap
>
>RC=$?
>
>[ $RC = 0 ] && touch /var/lock/subsys/tomcat
>;;
>
>  stop)
>
>PID=`cat /var/run/jsvc.pid`
>kill $PID
>
>   RC=$?
>
>[ $RC = 0 ] && rm -f /var/lock/subsys/tomcat /var/run/jsvc.pid
>;;
>
>  *)
>echo "Usage: $0 {start|stop}"
>exit 1
>
> esac
> exit $RC
>
>
> 13/06/2007 13:28:41 10653 jsvc debug: +-- DUMPING PARSED COMMAND LINE
> ARGUMENTS --
> 13/06/2007 13:28:41 10653 jsvc debug: | Detach:  True
> 13/06/2007 13:28:41 10653 jsvc debug: | Show Version:No
> 13/06/2007 13:28:41 10653 jsvc debug: | Show Help:   No
> 13/06/2007 13:28:41 10653 jsvc debug: | Check Only:  Disabled
> 13/06/2007 13:28:41 10653 jsvc debug: | Stop:False
> 13/06/2007 13:28:41 10653 jsvc debug: | Wait:0
> 13/06/2007 13:28:41 10653 jsvc debug: | Run as service:  No
> 13/06/2007 13:28:41 10653 jsvc debug: | Install service: No
> 13/06/2007 13:28:41 10653 jsvc debug: | Remove service:  No
> 13/06/2007 13:28:41 10653 jsvc debug: | JVM Name:"server"
> 13/06/2007 13:28:41 10653 jsvc debug: | Java Home:
> "/usr/lib/jvm/java-1.6.0-sun"
> 13/06/2007 13:28:41 10653 jsvc debug: | PID File: 
> "/var/run/jsvc.pid"
> 13/06/2007 13:28:41 10653 jsvc debug: | User Name:   "daemon"
> 13/06/2007 13:28:41 10653 jsvc debug: | Extra Options:   5
> 13/06/2007 13:28:41 10653 jsvc debug: |
> "-Dcatalina.home=/usr/local/tomcat/tomcat6"
> 13/06/2007 13:28:41 10653 jsvc debug: |   "-Xmx256m"
> 13/06/2007 13:28:41 10653 jsvc debug: |   "-Djava.io.tmpdir=/var/tmp"
> 13/06/2007 13:28:41 10653 jsvc debug: |   "-Djava.awt.headless=true"
> 13/06/2007 13:28:41 10653 jsvc debug: |
> "-Djava.class.path=/usr/local/tomcat/tomcat6/bin/bootstrap.jar:/usr/local/tomcat/tomcat6/bin/commons-daemon.jar:/usr/lib/jvm/java-1.6.0-sun/lib/tools.jar"
> 13/06/2007 13:28:41 10653 jsvc debug: | Class Invoked:
> "org.apache.catalina.startup.Bootstrap"
> 13/06/2007 13:28:41 10653 jsvc debug: | Class Arguments: 0
> 13/06/2007 13:28:41 10653 jsvc debug:
> +---
> 13/06/2007 13:28:41 10654 jsvc debug: user changed to 'daemon'
> 13/06/2007 13:28:41 10653 jsvc debug: User 'daemon' validated
> 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate Java Home
> in /usr/lib/jvm/java-1.6.0-sun
> 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
> configuration file /usr/lib/jvm/java-1.6.0-sun/jre/lib/jvm.cfg
> 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
> configuration file /usr/lib/jvm/java-1.6.0-sun/lib/jvm.cfg
> 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
> configuration file /usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/jvm.cfg
> 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
> configuration file /usr/lib/jvm/java-1.6.0-sun/lib/amd64/jvm.cfg
> 13/06/2007 13:28:41 10653 jsvc debug: VM configuration file not found
> 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
> /usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/classic/libjvm.so
> 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
> /usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/client/libjvm.so
> 13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
> /usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/libjvm.so
> 13/06/

Re: Key store password via console

2007-06-13 Thread Bill Barker

"Moritz" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi,
>
> I have defined a TLS connector, but I don't want to write the password for 
> my key store in plain text into the server.xml file. Is it possible to 
> enter the password via the console during startup? Or is there any other 
> workaround?
>

Yes, all you have to do is use TC 3.3 ;-).

Nobody ever showed an interest in porting this feature of 3.3 to later 
versions of Tomcat, so no you can't.

> Thanks!
> Moritz
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to populate userPrincipal in request object

2007-06-13 Thread Bill Barker

"shahab" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Hi:
>
> I am trying to find out how to poulate the userPrincipal from
> HttpServletRequest.
>
> I have the following code to retrieve the principal -
> HttpServletRequest request = ServletActionContext.getRequest();
> Principalprincipal = request.getUserPrincipal(); // get a Principal object
>
> My qn is to how to set the userPrincipal.

The easiest way is to write a HttpServletRequestWrapper that overrides the 
getUserPrincipal method and returns the Principal you want to use. 
Otherwise, you can't do it from Servlet code.  You would have to write a 
Valve that would have access to Tomcat's internal Request object and could 
set it there.

>
> thanx
>
>
>
> shahab wrote:
>>
>> Hi:
>>
>> Would you please let me know how can I set the userPrincipal in request
>> Object.
>> I am setting the Principal and roles in Subject (2 Principal object
>> according to JAAS implementation).
>>
>> When i run the code in debugger, I see the Subject in "reuqest" null, 
>> also
>> userPrincipal is null. Also, instead of role map in "request", its
>> updating security map.
>>
>> Thanx
>>
>
> -- 
> View this message in context: 
> http://www.nabble.com/how-to-populate-userPrincipal-in-request-object-tf3914736.html#a11105770
> Sent from the Tomcat - User mailing list archive at Nabble.com.
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mod_jk along side mod_dir -- How to get PHP to be seen as a default page

2007-06-13 Thread Mark Thomas
Dan D. wrote:
> Hello,


When starting a new thread (ie sending a message to the list about a
new topic) please do not reply to an existing message and change the
subject line. This is known as thread hijacking and to many of the
list archiving services and mail clients used by list subscribers this
makes your new message appear as part of the old thread. This makes it
harder for other users to find relevant information when searching the
lists.

It should also be noted that many list subscribers automatically
ignore any messages that hijack another thread.

The correct procedure is to create a new message with a new subject.
This will start a new thread.

Thanks,

Mark


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



mod_jk along side mod_dir -- How to get PHP to be seen as a default page

2007-06-13 Thread Dan D.

Hello,

First the versions:
Apache : 1.3.33
Tomcat: 6.0.13
mod_jk: 1.2.23

I am currently working on upgrading our environment to a newer version of 
Tomcat and mod_jk, and seem to be running into an issue with mod_jk and 
mod_dir.  More specifically, the issue I am running into is the default file 
list.


As I understand, it is intended behavior for the Apache DirectoryIndex 
directive to be more or less ignored, and instead the  
directive in web.xml is used to determine which files are loaded and in 
which order by default.


Now, the issue I run into is that I do not know in advance what our 
customers will be loading on their site.  There is a very real possibility 
that they may have an index.php file, which we want to have load first. 
This is something that I want to have Apache load, instead of Tomcat 
attempting to parse it, since we run php in a sandbox (suPHP).


Everything I have attempted, ends up basically the same when attempting to 
view a site by the hostname only (ie., http://hostname.tld/)


If I add
   index.php
to the  in my web.xml, it simply asks me to download the 
php file, instead of it being parsed by Apache.


If it is not in the welcome-file-list, it simply goes to the next one that 
is (index.html) and is still parsed by Tomcat, not Apache.


The related Apache Jk settings are as follows:


In addition, after the mod_jk include, but prior to any Jk settings, I have 
the following:



LoadModule dir_module   libexec/mod_dir.so
LoadModule jk_modulelibexec/mod_jk.so


   DirectoryIndex default.html default.htm index.php index.shtml index.html 
index.htm home.html home.htm welcome.html index.jsp



   SetEnvIf REQUEST_URI ^/(.*)/*.php$ no-jk
   SetEnvIf REQUEST_URI ^/(.*)/*.html$ no-jk


JkWorkersFile /web/conf/workers.properties
JkUnMount /*.php local
JkMountFile /web/conf/uriworkermap.properties
JkLogFile /web/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %U %T"

The contents of workers.properties are:

worker.list=local,jkstatus
# Set properties for worker1 (ajp13)
worker.local.type=ajp13
worker.local.host=localhost
worker.local.port=8009
worker.local.lbfactor=1
worker.jkstatus.type=status
worker.local.mount=/ /*



The contents of uriworkermap.properties are:
#exclude extensions
!*.html=local
!*.php=local


I understand that there are a few settings that are redundant, but I have 
tried every "don't touch php, tomcat" setting I can find, and it is still 
attempting to parse it.


Also a thing to note.  This only happens when attempting to view the default 
page.  If I browse directly to http://hostname.tld/index.php, it works fine.


So, my question is, how do I either prevent Tomcat from handling these 
requests, or tell it to pass them back to Apache if it doesn't know what to 
do with them?


I thank you for your time and help in this matter,

Dan D.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Erratic HTTP response behavior

2007-06-13 Thread Len Popp

It's pretty obvious by now that no-one's going to be able to email you
a solution to your problem, which seems unique or at least very
unusual. You're going to have to dig deeply into this one yourself.

Here's what I'd do, if it helps you any. I would track the problem
requests from the browser to the server and back again, at several
points, to see where it's going wrong.
- Look at the request and response in the browser using a plug-in like
LiveHTTPHeaders or ieHTTPHeaders.
- Log the requests received by Tomcat (AccessLogValve or RequestDumperValve).
- Put logging messages in your application, in every servlet or JSP,
to see what piece of code is executed for each request.
- Use a network sniffer (e.g. Wireshark) to see if the HTTP responses
are being sent to the correct clients. You may have to log traffic at
both the client and server ends if there's a proxy or gateway between
them.

Given all of those logs, you should be able to figure out where a
particular request went astray - in Tomcat, in the application, or in
the network. My money's on the network.
--
Len

On 6/13/07, Matt Cosentino <[EMAIL PROTECTED]> wrote:

Well that didn't last long.  After making some other changes the problem has 
returned... with a vengeance!  Seriously, it's even weirder than before.  Not 
only are some responses coming back chunked, but some are coming back 
completely wrong.  Like I try to open my index page and it responds with an 
image.  I tried reverting everything that I changed back to how they were 
before and the problem doesn't go away.  So strange, could really use some help.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Wednesday, June 13, 2007 2:20:24 PM
Subject: Re: Erratic HTTP response behavior

Ok, so I made a small change and somehow I think I fixed it.  I removed the 
following line from my page:



This happened by accident, I only removed it because the icon didn't exist at 
that path.  After doing that I noticed that everything would always load 
correctly.

I then added it back to see if that really did fix it, and sure enough the 
problem came back.  Then I just moved the line before some files that I often 
had problems loading, and the problem went away.  So it seems to me that when 
Tomcat tried to respond to that request it was breaking the responses of the 
other resources, somehow.  I don't understand it, but I figured I'd at least 
share my experience in case this helps anyone else.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Monday, June 11, 2007 1:07:37 PM
Subject: Re: Erratic HTTP response behavior

In a previous discussion it was said that the problem was fixed in 5.5.17, so 
maybe the problem was reintroduced somehow.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, June 8, 2007 6:12:28 PM
Subject: Re: Erratic HTTP response behavior

I tried looking through the archive and just couldn't find any help.  The 
problem has recently reproduced itself on a new Tomcat 5.5.23 install on one of 
my co-worker's machine, so it's not my PC.  I've also experienced it more often 
with random images or other resources not loading, and when I check the network 
monitor in Firebug it lists the transfer-encoding for them as chunked.  Luckily 
this problem has never surfaced on our production server which is version 
5.5.17, but I don't see any configuration differences.  This is driving me 
nuts, so any help would be greatly appreciated.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, May 25, 2007 4:09:57 PM
Subject: Re: Erratic HTTP response behavior

No I am on intending on using chunked responses.  Is there a way to disable it?

- Original Message 
From: Christopher Schultz <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, May 25, 2007 4:02:58 PM
Subject: Re: Erratic HTTP response behavior

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

You're right, this /is/ erratic behavior. I think something is going
wrong with your headers or something:

Matt Cosentino wrote:
> 0 HTTP/1.1 200 OKServer: Apache-Coyote/1.1Transfer-Encoding: 
chunkedDate: Fri, 18 May 2007 22:35:13 GMT

Your response headers appear to be after the body of the response.
Either that or the headers I see there are supposed to be the headers
from the next chunk and/or request in a keepalive request.

Are you intending to use "chunked" responses? 'Cause it looks like they
are being used. There was some in-depth discussion of chunked responses
somewhat recently on the list. Perhaps you could take a look at that for
some reference points (but I'm not saying that it will solve your problem).

I think the problem might be that you are getting chunked encoding for
some reason, but you don't really want it.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG

RE: How to get Tomcat to send proper charset?

2007-06-13 Thread Allen,Eva
Thanks, Andrew, but it just isn't working.  I went and got proximotron
and I'm looking at the headers.  What I've found is that when I don't
explicitly set the character set in the content type header and the
character set uses UTF-8, the only thing that's wrong is the browser
doesn't recognize the character set as UTF-8.  If I go in and manually
change the character set in the browser to UTF-8 everything displays as
it should.

However, if I use response.setContentType("text/html; charset=UTF-8");

then the header gets set right, but the content is pure gibberish.  I
don't know what is coming back.  It doesn't look right in either
iso-8859-1 or utf-8.  This worked fine in Tomcat 4; I didn't have to
specify what the character set was for the browser to "know" because it
was in the meta header for the web page.  For some reason, in Tomcat 5,
the meta header is being ignored and I can't seem to luck up on the
right combination to get the browser to display UTF-8 when the string
that coming back to be posted is UTF-8.  I know I can't be the first
person to need this!  What changed about Tomcat 5 that would break this?
Any clues as to what I can change in my code to fix it?  I spent a great
deal of last night looking for a solution and all I found was encoding
in the URI doesn't work like it used to; there was nothing about
encoding in the rendered web page itself.

-Original Message-
From: Andrew Chapman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 13, 2007 4:26 AM
To: users@tomcat.apache.org
Subject: RE: How to get Tomcat to send proper charset?

Eva,

This will work. I think the problem in the response.setContentType() is
as simple as a typo. An extra quote seems to have crept in, so:

response.setContentType("text/html; charset="UTF-8")

SHOULD BE

response.setContentType("text/html; charset=UTF-8")

Andy

-Original Message-
From: Allen,Eva [mailto:[EMAIL PROTECTED]
Sent: 13 June 2007 04:36
To: Tomcat Users List
Subject: How to get Tomcat to send proper charset?

We just recently switched our platform from tomcat 4.124 to Tomcat
5.5.23 and now languages Japanese, Chinese (traditional) and Chinese
(simplified) are not displaying properly.   Here's a little background.

We use servlets to build HTML code to be output (please no comments on
how bad an idea this is; it's legacy code, we must support it).  What
we'd done up until now is determine the language to be used from the
login page, save it in the session and use it to determine what
character set should be output.  The character set was explicitly stated
in a meta header on the output web page like so



Page Title

 
or



Page Title


That is no longer working.  It was suggested that tomcat was paying
attention to the HTTP Content-Type header to determine what character
set to display so I modified the code a little bit to use

response.setContentType("text/html; charset="UTF-8") or
response.setContentType("text/html; charset="iso-8859-1")

depending on which was appropriate.

But even though that response header is explicitly set in the code,
somehow, somewhere it's changed again, because I've determined that the
content type response header looks like this:

 Content-Type: text/html;charset=ISO-8859-1

What's going on?  Why is Tomcat ignoring what we're telling it?  How can
we get Tomcat to send the correct response header so that our Japanese
and Chinese readers can see something other than gibberish?
--
Eva Allen
Consulting Software Engineer, OCLC, Inc.
6565 Kilgour Pl., Dublin, OH  43017
614.764.6009 | [EMAIL PROTECTED]
Views contained herein are my own; they do not necessarily reflect those
of my employer



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Erratic HTTP response behavior

2007-06-13 Thread Matt Cosentino
Well that didn't last long.  After making some other changes the problem has 
returned... with a vengeance!  Seriously, it's even weirder than before.  Not 
only are some responses coming back chunked, but some are coming back 
completely wrong.  Like I try to open my index page and it responds with an 
image.  I tried reverting everything that I changed back to how they were 
before and the problem doesn't go away.  So strange, could really use some help.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Wednesday, June 13, 2007 2:20:24 PM
Subject: Re: Erratic HTTP response behavior

Ok, so I made a small change and somehow I think I fixed it.  I removed the 
following line from my page:



This happened by accident, I only removed it because the icon didn't exist at 
that path.  After doing that I noticed that everything would always load 
correctly.

I then added it back to see if that really did fix it, and sure enough the 
problem came back.  Then I just moved the line before some files that I often 
had problems loading, and the problem went away.  So it seems to me that when 
Tomcat tried to respond to that request it was breaking the responses of the 
other resources, somehow.  I don't understand it, but I figured I'd at least 
share my experience in case this helps anyone else.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Monday, June 11, 2007 1:07:37 PM
Subject: Re: Erratic HTTP response behavior

In a previous discussion it was said that the problem was fixed in 5.5.17, so 
maybe the problem was reintroduced somehow.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, June 8, 2007 6:12:28 PM
Subject: Re: Erratic HTTP response behavior

I tried looking through the archive and just couldn't find any help.  The 
problem has recently reproduced itself on a new Tomcat 5.5.23 install on one of 
my co-worker's machine, so it's not my PC.  I've also experienced it more often 
with random images or other resources not loading, and when I check the network 
monitor in Firebug it lists the transfer-encoding for them as chunked.  Luckily 
this problem has never surfaced on our production server which is version 
5.5.17, but I don't see any configuration differences.  This is driving me 
nuts, so any help would be greatly appreciated.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, May 25, 2007 4:09:57 PM
Subject: Re: Erratic HTTP response behavior

No I am on intending on using chunked responses.  Is there a way to disable it?

- Original Message 
From: Christopher Schultz <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, May 25, 2007 4:02:58 PM
Subject: Re: Erratic HTTP response behavior

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

You're right, this /is/ erratic behavior. I think something is going
wrong with your headers or something:

Matt Cosentino wrote:
> 0 HTTP/1.1 200 OKServer: Apache-Coyote/1.1Transfer-Encoding: 
> chunkedDate: Fri, 18 May 2007 22:35:13 GMT

Your response headers appear to be after the body of the response.
Either that or the headers I see there are supposed to be the headers
from the next chunk and/or request in a keepalive request.

Are you intending to use "chunked" responses? 'Cause it looks like they
are being used. There was some in-depth discussion of chunked responses
somewhat recently on the list. Perhaps you could take a look at that for
some reference points (but I'm not saying that it will solve your problem).

I think the problem might be that you are getting chunked encoding for
some reason, but you don't really want it.

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

iD8DBQFGV08C9CaO5/Lv0PARArfQAJoD+kMZLUVWthGyRuv0NWKIKSuXcACfYh+I
sJuvF8+a8MgIcIu3gd1hGak=
=u9oS
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






   
Be
 a better Globetrotter. Get better travel answers from someone who knows. 
Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







 

Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

---

Re: Thread Pool

2007-06-13 Thread Filip Hanik - Dev Lists

you need to call start(), not run()

Filip

Siraj Haider wrote:
Hello, Now I have changed my servlet.  I have created a new class 
ResultFetcher extended by thread and now I am doing the checking part 
inside that Thread.run() method.  and calling the new class like this :


  ResultFetcher rf = new ResultFetcher(something);
  rf.setDaemon(true);
  rf.run();
  System.out.println("RETURNING THE CONROL~!!");

now the problem is, its not printing this "RETURNING..." statement until 
the whole run() process is completed, which is very weird. 


thanks
Siraj

Martin Gainty wrote:
  

Siraj--

Try setting your thread object as a daemon?
thread.setDaemon(true)
http://java.sun.com/j2se/1.5.0/docs/api/

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please 
notify

the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - From: "Siraj Haider" <[EMAIL PROTECTED]>
To: 
Sent: Monday, June 11, 2007 2:00 PM
Subject: Thread Pool


I am using tomcat version:5.5.20 java version:1.6.0-b105 os version:
intel solaris 5.10
scenario is: my java program call a servlet which return to my java
program using sendData and then goes into a loop to perform other
functions.  Now after i get the control back in my java program i try to
call another servlet on the same tomcat, but it waits until the previous
servlet call (which was in a loop to perform other functions) is done.
I have these settings in my servler.xml for thread pooling:
maxThreads="1000" minSpareThreads="100" maxSpareThreads="200"
acceptCount="500".  Can somebody please how to fix this problem ?



This electronic mail message and any attachments may contain 
information which is privileged, sensitive and/or otherwise exempt 
from disclosure under applicable law. The information is intended only 
for the use of the individual or entity named as the addressee above. 
If you are not the intended recipient, you are hereby notified that 
any disclosure, copying, distribution (electronic or otherwise) or 
forwarding of, or the taking of any action in reliance on, the 
contents of this transmission is strictly prohibited. If you have 
received this electronic transmission in error, please notify us by 
telephone, facsimile, or e-mail as noted above to arrange for the 
return of any electronic mail or attachments. Thank You.




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






This electronic mail message and any attachments may contain information which 
is privileged, sensitive and/or otherwise exempt from disclosure under 
applicable law. The information is intended only for the use of the individual 
or entity named as the addressee above. If you are not the intended recipient, 
you are hereby notified that any disclosure, copying, distribution (electronic 
or otherwise) or forwarding of, or the taking of any action in reliance on, the 
contents of this transmission is strictly prohibited. If you have received this 
electronic transmission in error, please notify us by telephone, facsimile, or 
e-mail as noted above to arrange for the return of any electronic mail or 
attachments. Thank You.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Erratic HTTP response behavior

2007-06-13 Thread Matt Cosentino
Ok, so I made a small change and somehow I think I fixed it.  I removed the 
following line from my page:



This happened by accident, I only removed it because the icon didn't exist at 
that path.  After doing that I noticed that everything would always load 
correctly.

I then added it back to see if that really did fix it, and sure enough the 
problem came back.  Then I just moved the line before some files that I often 
had problems loading, and the problem went away.  So it seems to me that when 
Tomcat tried to respond to that request it was breaking the responses of the 
other resources, somehow.  I don't understand it, but I figured I'd at least 
share my experience in case this helps anyone else.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Monday, June 11, 2007 1:07:37 PM
Subject: Re: Erratic HTTP response behavior

In a previous discussion it was said that the problem was fixed in 5.5.17, so 
maybe the problem was reintroduced somehow.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, June 8, 2007 6:12:28 PM
Subject: Re: Erratic HTTP response behavior

I tried looking through the archive and just couldn't find any help.  The 
problem has recently reproduced itself on a new Tomcat 5.5.23 install on one of 
my co-worker's machine, so it's not my PC.  I've also experienced it more often 
with random images or other resources not loading, and when I check the network 
monitor in Firebug it lists the transfer-encoding for them as chunked.  Luckily 
this problem has never surfaced on our production server which is version 
5.5.17, but I don't see any configuration differences.  This is driving me 
nuts, so any help would be greatly appreciated.

- Original Message 
From: Matt Cosentino <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, May 25, 2007 4:09:57 PM
Subject: Re: Erratic HTTP response behavior

No I am on intending on using chunked responses.  Is there a way to disable it?

- Original Message 
From: Christopher Schultz <[EMAIL PROTECTED]>
To: Tomcat Users List 
Sent: Friday, May 25, 2007 4:02:58 PM
Subject: Re: Erratic HTTP response behavior

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

You're right, this /is/ erratic behavior. I think something is going
wrong with your headers or something:

Matt Cosentino wrote:
> 0 HTTP/1.1 200 OKServer: Apache-Coyote/1.1Transfer-Encoding: 
> chunkedDate: Fri, 18 May 2007 22:35:13 GMT

Your response headers appear to be after the body of the response.
Either that or the headers I see there are supposed to be the headers
from the next chunk and/or request in a keepalive request.

Are you intending to use "chunked" responses? 'Cause it looks like they
are being used. There was some in-depth discussion of chunked responses
somewhat recently on the list. Perhaps you could take a look at that for
some reference points (but I'm not saying that it will solve your problem).

I think the problem might be that you are getting chunked encoding for
some reason, but you don't really want it.

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

iD8DBQFGV08C9CaO5/Lv0PARArfQAJoD+kMZLUVWthGyRuv0NWKIKSuXcACfYh+I
sJuvF8+a8MgIcIu3gd1hGak=
=u9oS
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






   
Be
 a better Globetrotter. Get better travel answers from someone who knows. 
Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







 

Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






  

Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTE

Re: Nio problems on OSX

2007-06-13 Thread Filip Hanik - Dev Lists

documented here
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
-Djava.net.preferIPv4Stack=true

Filip

Peter wrote:

Hi

I'm trying to use the Nio connector with Tomcat 6.0.13 running with Java 
1.5.0_07 on OSX 10.4.9. When trying to access port 8080 which was declared with 
the Nio connector I just get a blank response and see the following in 
catalina.out:

Jun 13, 2007 10:47:02 AM org.apache.tomcat.util.net.NioEndpoint setSocketOptions
SEVERE:
java.net.SocketException: Invalid argument
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setIntOption(Net.java:152)
at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
at sun.nio.ch.SocketOptsImpl.setInt(SocketOptsImpl.java:46)
at sun.nio.ch.SocketOptsImpl$IP.typeOfService(SocketOptsImpl.java:249)
at sun.nio.ch.OptionAdaptor.setTrafficClass(OptionAdaptor.java:158)
at sun.nio.ch.SocketAdaptor.setTrafficClass(SocketAdaptor.java:330)
at 
org.apache.tomcat.util.net.SocketProperties.setProperties(SocketProperties.java:171)
at 
org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:967)
at 
org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1183)
at java.lang.Thread.run(Thread.java:613)

I also use the native library:

Jun 13, 2007 10:46:30 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [false], accept filters [false], 
random [true].

Incidentally, does APR not support sendfile on OSX? 


Here are my connector definitions:





Any ideas?

Thanks
Peter



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Deployment issues

2007-06-13 Thread Sumit Gupta
Hi,
 
We have multiple applicaitons running on tomcat (24 x 7).
 
Sometimes, the appications gets undeployed automaticaly without any changes. 
Can you please let me know the reason?
 
Also, at times some applications does not work and we need to restart the 
Tomcat server to run those applications. Any idea why this happens?
 
Please help me out on these issues.
 
Thanks,
Sumit



 

Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091

Nio problems on OSX

2007-06-13 Thread Peter
Hi

I'm trying to use the Nio connector with Tomcat 6.0.13 running with Java 
1.5.0_07 on OSX 10.4.9. When trying to access port 8080 which was declared with 
the Nio connector I just get a blank response and see the following in 
catalina.out:

Jun 13, 2007 10:47:02 AM org.apache.tomcat.util.net.NioEndpoint setSocketOptions
SEVERE:
java.net.SocketException: Invalid argument
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setIntOption(Net.java:152)
at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:372)
at sun.nio.ch.SocketOptsImpl.setInt(SocketOptsImpl.java:46)
at sun.nio.ch.SocketOptsImpl$IP.typeOfService(SocketOptsImpl.java:249)
at sun.nio.ch.OptionAdaptor.setTrafficClass(OptionAdaptor.java:158)
at sun.nio.ch.SocketAdaptor.setTrafficClass(SocketAdaptor.java:330)
at 
org.apache.tomcat.util.net.SocketProperties.setProperties(SocketProperties.java:171)
at 
org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:967)
at 
org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1183)
at java.lang.Thread.run(Thread.java:613)

I also use the native library:

Jun 13, 2007 10:46:30 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [false], accept filters [false], 
random [true].

Incidentally, does APR not support sendfile on OSX? 

Here are my connector definitions:





Any ideas?

Thanks
Peter



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to populate userPrincipal in request object

2007-06-13 Thread shahab

Hi:

I am trying to find out how to poulate the userPrincipal from
HttpServletRequest.

I have the following code to retrieve the principal - 
HttpServletRequest request = ServletActionContext.getRequest();
Principalprincipal = request.getUserPrincipal(); // get a Principal object

My qn is to how to set the userPrincipal.

thanx



shahab wrote:
> 
> Hi:
> 
> Would you please let me know how can I set the userPrincipal in request
> Object. 
> I am setting the Principal and roles in Subject (2 Principal object
> according to JAAS implementation).
> 
> When i run the code in debugger, I see the Subject in "reuqest" null, also
> userPrincipal is null. Also, instead of role map in "request", its
> updating security map.
> 
> Thanx
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-populate-userPrincipal-in-request-object-tf3914736.html#a11105770
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: how to populate userPrincipal in request object

2007-06-13 Thread Mark Claassen
I am not sure what your exact situation here is, but the user certificate
stuff is only available if Tomcat requests it.  And Tomcat only does this if
Tomcat is using certificate based SSL authentication.  I don't believe this
will work if an Apache webserver is handling the SSL negotiation.

Mark
 
-Original Message-
From: shahab [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 13, 2007 9:42 AM
To: users@tomcat.apache.org
Subject: how to populate userPrincipal in request object


Hi:

Would you please let me know how can I set the userPrincipal in request
Object. 
I am setting the Principal and roles in Subject (2 Principal object
according to JAAS implementation).

When i run the code in debugger, I see the Subject in "reuqest" null, also
userPrincipal is null. Also, instead of role map in "request", its updating
security map.

Thanx
--
View this message in context:
http://www.nabble.com/how-to-populate-userPrincipal-in-request-object-tf3914
736.html#a11099625
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Comet: Unsufficiently synchronized recycling decisions

2007-06-13 Thread Filip Hanik - Dev Lists

Reich, Matthias wrote:

 Hello,

I did not get any response on my post from 2 weeks ago.

Even if non-recycling of request/response objects happens only
sporadically and only in webapps where asynchronous responses may happen
before the event processing has finished, it is definitively a bug.

Should I report it as a bug to receive any reaction?
  
a bug would help only if it has an example app, or enough info to help 
us truly understand the issue.
personally, I haven't had enough time to look through it to truly 
understand it, cause I believe the fix would probably be easier than the 
one described below


Filip


Regards,
Matthias

  

-Original Message-
From: Reich, Matthias 
Sent: Wednesday, May 30, 2007 2:04 PM

To: 'Tomcat Users List'
Subject: Comet: Unsufficiently synchronized recycling decisions

Hi,

as mentioned in my contribution to topic 'Web application 
receives request parameters sent to another application on 
Tomcat 6', I sometimes get non-recycled Request objects in a 
BEGIN event. 

A non-recycled request object appeared in a BEGIN event if 
the previous request processed by the same request processor 
was answered asynchronously directly after the BEGIN event.


In such a situation my Servlet sometimes did not get an END 
event, i.e. the CoyoteAdapter was not triggered again and 
therefore could not recycle the Request object.
Nevertheless, the request processor was recycled, i.e. 
readded to the processor pool.


As the processor was recycled, the cometEvent.close() must 
have happened *after* CoyoteAdapter had made the decision not 
to recycle Request/Response, but *before* Http11AprProtocol 
had made the decision to recycle the processor.


To verify this, I modified the methods 
Http11AprProcessor.event and Http11AprProcessor.process.


I replaced every occurrence of:

  recycle();

within these methods with the following lines:

  org.apache.catalina.connector.Request req = 
(org.apache.catalina.connector.Request) request.getNote(1);
  org.apache.catalina.connector.Response res = 
(org.apache.catalina.connector.Response) response.getNote(1);

  req.recycle( );
  res.recycle( );
  recycle();

I know that this is a hack and must be solved in a better way 
(and also for the NIOConnector), but with these modifications 
I enforced a single decision point for recycling of 
Request/Response *and* the processor.


When running Tomcat with these modifications, my Servlet no 
longer received non-recycled Request objects.



Regards,
Matthias




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 6, SQL Server 2005 JDBC Realm not working

2007-06-13 Thread Richard Sayre

I have a web app that connects to my SQL Server 2005 Database with no
trouble using this code:

 Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
   con =
DriverManager.getConnection("jdbc:sqlserver://server-2006;databaseName=v362;user=user;password=dbase");

My application runs fine and I can see data from the database.

Now when I try to set up a Realm to do Database authentication I get an error:



Exception:

13-Jun-2007 3:56:00 PM org.apache.catalina.realm.JDBCRealm authenticate
SEVERE: Exception performing authentication
java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:691)
at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:346)
at 
org.apache.catalina.authenticator.BasicAuthenticator.authenticate(BasicAuthenticator.java:181)
at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

The strange thing is, if I set up a DSN under Windows and use the Sun
ODBC driver the authentication realm works:




Does any one have this type of authentication working with MS SQL
Server 2005 JDBC driver under Tomcat 6?

Thank you,

Rich

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Key store password via console

2007-06-13 Thread David Wall

Moritz wrote:
But still I think it's never a good idea to write a password in plain 
text in any file. If the password is stored in plain text and 
something goes wrong an attacker could be able to steal my private key 
and use it. And this would be really bad.
Obviously, this depends on your web site's "hacker desirability), but if 
they can read your server.xml, they can likely hijack your entire web 
app and install their exploit into your existing pages since the SSL 
encryption is in the clear for the webapp itself and thus they can see 
whatever data was entered by users.  So, if you cannot secure your 
server.xml, then your entire web app is vulnerable to attacks EVEN IF 
they couldn't get the password to your private key. 

Stealing your SSL cert private key is probably worth less and harder to 
exploit than simply changing your login page or the like to capture user 
credentials (of course, such changes can be discovered using tools like 
snort).  A stolen set of SSL cert keys is harder to exploit and hide.




Therefore I'm looking for a possibility to pass the password via the 
console.
This has been discussed many times before.  I'm sure if you write code 
that allows this to work, some will want to use it, too.  It's open 
source after all...  And you can always put httpd in front since it's 
openssl implementation allows for cert password prompts.


David

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Key store password via console

2007-06-13 Thread Moritz
I agree with you that only those userids that actually need to access 
the server.xml file should be able to read it.


But still I think it's never a good idea to write a password in plain 
text in any file. If the password is stored in plain text and something 
goes wrong an attacker could be able to steal my private key and use it. 
And this would be really bad.


Therefore I'm looking for a possibility to pass the password via the 
console.


Moritz


Caldarale, Charles R wrote:
From: Moritz [mailto:[EMAIL PROTECTED] 
Subject: Key store password via console


I have defined a TLS connector, but I don't want to
write the password for my key store in plain text into
the server.xml file.


Are you saying that your server.xml file is open to anyone?  If so,
you've got bigger problems than hiding your keystore password.  Just
insure that server.xml is accessible only to those userids that actually
need to access it.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Stop deployOnStartup for only one webapp

2007-06-13 Thread Joseph Valerio
Hi Tomcat Users,

We have a "little" application called Sakai that uses a custom class
loader, much cross context communication and a bunch of other stuff that
is non-standard.  Since it is such a beast we are ModJK load balancing 6
tomcat machines.  One of which is an administrative machine that serves
three purposes: DAV, Quartz job scheduler for data loads, and a backup
application server if one in the cluster goes down.  Since we don't want
the other machines running the Quartz jobs (processor/memory intensive)
we don't rsync the scheduler webapp to the other machines.  This works,
but has a drawback.  Is there a way to configure a specific webapp to
NOT deployOnStartup if the Host deployOnStartup=true?  This would allow
us to have the webapp "available" on another machine if our admin server
goes down.

Thanks in advance,

- Joe

-- 

Joseph Valerio

Yale University
Technology and Planning
Information Technology Services

175 Whiteny Ave
New Haven, CT 06511
203.432.1196
[EMAIL PROTECTED] 


RE: Key store password via console

2007-06-13 Thread Caldarale, Charles R
> From: Moritz [mailto:[EMAIL PROTECTED] 
> Subject: Key store password via console
> 
> I have defined a TLS connector, but I don't want to
> write the password for my key store in plain text into
> the server.xml file.

Are you saying that your server.xml file is open to anyone?  If so,
you've got bigger problems than hiding your keystore password.  Just
insure that server.xml is accessible only to those userids that actually
need to access it.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Key store password via console

2007-06-13 Thread Moritz

Hi,

I have defined a TLS connector, but I don't want to write the password 
for my key store in plain text into the server.xml file. Is it possible 
to enter the password via the console during startup? Or is there any 
other workaround?


Thanks!
Moritz

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Help with tomcat 5.0.28 loadbalancing

2007-06-13 Thread Caldarale, Charles R
> From: Dwayne A. Ghant [mailto:[EMAIL PROTECTED] 
> Subject: Re: Help with tomcat 5.0.28 loadbalancing
> 
> When I say weird I mean that I changed both instances of the " homes(1&2)>/webapps/ROOT/index.jsp" to read:
> 
> Since I have changed both of them the old "index.jsp" file 
> keep coming up as default.

The ROOT/index.jsp file is precompiled and actually being loaded from
ROOT/WEB-INF/lib/catalina-root.jar, as can be seen by looking in
ROOT/WEB-INF/web.xml servlet mappings.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Stess Test Software

2007-06-13 Thread Carlos Avilan

i used badboy to create scripts and then used jmeter 2.2 from jakarta to run
it...

2007/6/13, Will Holmes <[EMAIL PROTECTED]>:


Could anyone recommend some good stress test software for Tomcat.

Thanks in advance!

Will Holmes
Programmer Analyst
Fremont Insurance Company
Ph: 231-924-0302 Ext. 145
E-Mail: [EMAIL PROTECTED]





--
Carlos Avilan
cel.04141043561/0416 718 9715


RE: Directory listings on a per-context level

2007-06-13 Thread Caldarale, Charles R
> From: lightbulb432 [mailto:[EMAIL PROTECTED] 
> Subject: Directory listings on a per-context level
> 
> I've set listings to true on TOMCAT_BASE/conf/web.xml's 
> DefaultServlet, but that allows directories to be seen 
> for all contexts. Is there a way to set directory
> listings for certain contexts but not others?

You can copy the DefaultServlet configuration to the WEB-INF/web.xml of
each webapp that's different from your desired default and override the
default in each such webapp.

 - 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 start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Directory listings on a per-context level

2007-06-13 Thread lightbulb432

I've set listings to true on TOMCAT_BASE/conf/web.xml's DefaultServlet, but
that allows directories to be seen for all contexts. Is there a way to set
directory listings for certain contexts but not others?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Directory-listings-on-a-per-context-level-tf3915251.html#a11101399
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Help with tomcat 5.0.28 loadbalancing

2007-06-13 Thread Dwayne A. Ghant

Thanks Felix

That seemed to be the problem. Who can resist typo's !!! lol

When I say weird I mean that I changed both instances of the "homes(1&2)>/webapps/ROOT/index.jsp"

to read:

"Tomcat A"
=



<%= request.getSession().getId() %>
Tomcat A



"Tomcat B"
=



<%= request.getSession().getId() %>
Tomcat B




Since I have changed both of them the old "index.jsp" file keep coming 
up as default.
The file that says "If you're seeing this page via a web browser, it 
means you've setup Tomcat successfully. Congratulations!"


I know that it's something simple, but sometimes when looking at this 
thing 3 days

straight I can go a little senile.


Thank you for your time.

Felix Schumacher wrote:

Am Di, 12.06.2007, 20:32, schrieb Dwayne A. Ghant:
  

Almost got it loadbalancing almost wokring need minor help
finishing off. Things have chang since I havn't did this in about
3 years. I keep getting error messages in my "mod_jk.log" file below
every time apache initializes. The connector seems to acting strange!!


...
  

worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=tomcat5_0_28A, tomcat5_0_28B


...
  

[Tue Jun 12 14:21:51 2007] [5226:30880] [warn]
jk_map_read_property::jk_map.c (432): The attribute
'worker.loadbalancer.balanced_workers' is deprecated - please check the
documentation for the correct replacement.


...
The log message tells you to rename the attribute balanced_workers to
something different - which you should look up in the documentation.
(Hint: It is balance_workers instead of balanced_workers)

And what do you mean by "acting strange"?
Have you set the jvmRoute attribute in the Server->Engine configuration of
the both tomcats?

Bye
 Felix



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  



--
Dwayne A. Ghant
Application Developer
Temple University
215.204.3467
[EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Stess Test Software

2007-06-13 Thread Martin Gainty

Will-

You can also use unittestsgen which will automatically create the Junit 
tests based on the supplied folder

http://wttools.sourceforge.net/unittestsgen/
It doesnt cover look and feel and or UI issues but covers the errors of NPE 
for Parameters sent in on stack etc..


M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Rob Kirkbride" <[EMAIL PROTECTED]>

To: "Tomcat Users List" 
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, June 13, 2007 9:08 AM
Subject: Re: Stess Test Software



Hi Will,

If you're talking about load testing - we use grinder with lots of 
success. Writing scripts for this turned out to be a lot more cost 
effective than paying a company to load test.


Rob

Will Holmes wrote:
Could anyone recommend some good stress test software for Tomcat.  Thanks 
in advance!

 Will Holmes
Programmer Analyst
Fremont Insurance Company
Ph: 231-924-0302 Ext. 145
E-Mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



how to populate userPrincipal in request object

2007-06-13 Thread shahab

Hi:

Would you please let me know how can I set the userPrincipal in request
Object. 
I am setting the Principal and roles in Subject (2 Principal object
according to JAAS implementation).

When i run the code in debugger, I see the Subject in "reuqest" null, also
userPrincipal is null. Also, instead of role map in "request", its updating
security map.

Thanx
-- 
View this message in context: 
http://www.nabble.com/how-to-populate-userPrincipal-in-request-object-tf3914736.html#a11099625
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Stess Test Software

2007-06-13 Thread David Delbecq
JMeter

En l'instant précis du 13/06/07 15:05, Will Holmes s'exprimait en ces
termes:
> Could anyone recommend some good stress test software for Tomcat.  
>  
> Thanks in advance!
>  
> Will Holmes
> Programmer Analyst
> Fremont Insurance Company
> Ph: 231-924-0302 Ext. 145
> E-Mail: [EMAIL PROTECTED]
>  
>
>   


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with XSL stylesheet not being applied when XML served through Tomcat

2007-06-13 Thread Markus Schönhaber
Robert Koberg wrote:

> I don't know about konqueror, but Safari supports it. Safari does not
> have an interface to apply transformations with JS, however. And Opera
> does not support the document function. Though I tend not to like using
> a PI in the source XML to trigger the transform (can't cache the
> processor object, tying the style to the source, etc...), it is a widely
> supported and easy way to go. If konqueror can't do it, it is probably
> the only 'modern' browser that doesn't.

Well, client-sided XSLT may widely supported, and, in fact, it may even
be just my konqueror that doesn't do it due to some misconfiguration (I
don't care enough to try and find out for sure).
Nevertheless, if done on the server side, there is no need to spend a
single thought about how good or bad pontential clients might support
XSLT. They simply have to render the result - which alone can give one
enough to think about if it shall look identical on different browsers.
That's why IMO XSLT belongs in most cases to the server side.
Of course, everyone has to decide for himself and consider his own
requirements.

Regards
  mks

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat 5.5 stdout

2007-06-13 Thread Gregor Schneider

hi illja,

On 6/13/07, Ilja S. <[EMAIL PROTECTED]> wrote:

Thanks a lot for quick reply!
To conclude:
1. stdout can NOT be redirected to multiple files and can be only in one
file (usually catalina.out)


that's right.
the only workaround is to use jsvc
(http://tomcat.apache.org/tomcat-5.0-doc/setup.html).
with this you can run tomcat either as a service in windows or as a
demon in unix / linux, and you can redirect stdout / stderr to a file
specified in the start-script.
however, it will still be ONE file each for stout / stderr, meaning
you cannot destinguish between the output of different web-apps


2. All uncaught exceptions / System.out from ALL applications are going
to this one file. And we can not do anything about this.

Right?


right

Therefore.

Use a logger and make ensure clean programming of your applications
avoiding System.out / err. Also handle exceptions using the logger
(Logger.err ("Your warning", exception).

Cheers

Gregor
--
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Stess Test Software

2007-06-13 Thread Rob Kirkbride

Hi Will,

If you're talking about load testing - we use grinder with lots of 
success. Writing scripts for this turned out to be a lot more cost 
effective than paying a company to load test.


Rob

Will Holmes wrote:
Could anyone recommend some good stress test software for Tomcat.  
 
Thanks in advance!
 
Will Holmes

Programmer Analyst
Fremont Insurance Company
Ph: 231-924-0302 Ext. 145
E-Mail: [EMAIL PROTECTED]
 

  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Stess Test Software

2007-06-13 Thread Will Holmes
Could anyone recommend some good stress test software for Tomcat.  
 
Thanks in advance!
 
Will Holmes
Programmer Analyst
Fremont Insurance Company
Ph: 231-924-0302 Ext. 145
E-Mail: [EMAIL PROTECTED]
 


Re: role of threads - profiling?

2007-06-13 Thread David Delbecq
En l'instant précis du 13/06/07 14:35, paul womack s'exprimait en ces
termes:
> I'm just trying to do some simple profiling
> on an app running under tomcat 4.
>
> I've enabled profiling using:
> JAVA_OPTS="-Xrunhprof:cpu=samples,depth=40,thread=y"; export JAVA_OPTS
> and am successfully getting a java.hprof.txt file
> when tomcat is stopped. (after a 70 second
> run, with a perl script hammering away
> via http)
>
> On analysing the file with jperfanal
> http://jperfanal.sourceforge.net/JPerfAnal_manual.html
>
> I was intially completely confused.
>
> Then I realised than tomcat
> is (to say the least) multi-threaded,
> and went to use the tool's thread analyses.
>
> In terms of recorded "ticks", the most important
> thread is "main", with 9666 ticks, closely
The main thread is the startup tomcat thread. It does various stuff
like, i think, responding to shutdown hook, and, most important,
starting up your application. It has lots of ticks because the startup
of your tomcat is what took you the most time. You should hammer your
applicaiton during more than 70 second to have a correct behaviour of
cpu usage. initialization stuff from main takes a bit of time (from a
few seconds for empty tomcat to 1 or 2 minutes with big applications)
but occurs only once per life of jvm.

> followed by:
>
> TP-processor4 (9470 ticks)
>
I think they handle various connections of tomcat before dispatching
them to http-thread, modjk thread or alike. But not sure.
> After this I get a list of
> http10722-processor threads, with ticks
> running down from 4580 -> 487
>
> all other threads have very few "ticks".
>
> On examining function profiles for these threads,
> it is clear that the http threads are actually "my application"
> doing useful (IMHO) work.
yes, it's the work of application responding to request + time spend by
tomcat to parse request and direct it to correct webapplication
>
> Can anyone outline to me what the main() and TP-processor
> threads are doing?
>
> I'd be happy to be pointed at relevant doc, but I've searched
> and read stuff for the last hour without really moving
> forward in my understanding.
>
>BugBear
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat 5.5 stdout

2007-06-13 Thread Ilja S.

Thanks a lot for quick reply!
To conclude:
1. stdout can NOT be redirected to multiple files and can be only in one 
file (usually catalina.out)
2. All uncaught exceptions / System.out from ALL applications are going 
to this one file. And we can not do anything about this.


Right?

*
Best Regards
Ilja


Gregor Schneider wrote:

One option is to use log4j (http://logging.apache.org/log4j).
you can specify loggers for each application writing to pre-defined 
locations.


however, you will also have to maintain some disciplin, since log4j or
the java-logging-api are not able to redirect stdout. That means: Do
not use System.out / System.err but use your preferred logger instead.

Unfortunately, some central applications (like commons.pool f.e.) do
not care about any loggers but just dump their output to System.out.

You could specify in $catalina_home/commons/classes/log4j.xml a logger
based on the classnames that produces the output, however, if those
central components just use System.out/err instead of logging, you
will have to live with this.

Anyways, moving your applications to log4j / [enter your preferred
logging-api here] is a great step into the right direction, esp. if
you want to destinguish between error-weight of the message and the
source where this message came from.

Cheers

Gregor



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



role of threads - profiling?

2007-06-13 Thread paul womack

I'm just trying to do some simple profiling
on an app running under tomcat 4.

I've enabled profiling using:
JAVA_OPTS="-Xrunhprof:cpu=samples,depth=40,thread=y"; export JAVA_OPTS
and am successfully getting a java.hprof.txt file
when tomcat is stopped. (after a 70 second
run, with a perl script hammering away
via http)

On analysing the file with jperfanal
http://jperfanal.sourceforge.net/JPerfAnal_manual.html

I was intially completely confused.

Then I realised than tomcat
is (to say the least) multi-threaded,
and went to use the tool's thread analyses.

In terms of recorded "ticks", the most important
thread is "main", with 9666 ticks, closely
followed by:

TP-processor4 (9470 ticks)

After this I get a list of
http10722-processor threads, with ticks
running down from 4580 -> 487

all other threads have very few "ticks".

On examining function profiles for these threads,
it is clear that the http threads are actually "my application"
doing useful (IMHO) work.

Can anyone outline to me what the main() and TP-processor
threads are doing?

I'd be happy to be pointed at relevant doc, but I've searched
and read stuff for the last hour without really moving
forward in my understanding.

   BugBear


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JSVC with JDK 6 on Intel Xenon x86_64

2007-06-13 Thread ben short

Hi,

I'm trying to compile jsvc on a RedHat 4 ES box. I have installed JDK
6 and typing java -version at the shell prompt tells me its installed
OK.
I then compile jsvc with that jdk and it completes ok.
When I try and run the following startup script I get the following
debug output.


#!/bin/bash
# chkconfig: 2345 101  05
# description: Apache Tomcat 6

JAVA_HOME='/usr/lib/jvm/java-1.6.0-sun'
CATALINA_HOME='/usr/local/tomcat/tomcat6'

CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar
CLASSPATH=${CLASSPATH}:$CATALINA_HOME/bin/commons-daemon.jar
CLASSPATH=${CLASSPATH}:$JAVA_HOME/lib/tools.jar
echo $CLASSPATH

JAVA_OPTS='-Xms1024m -Xmx3072m -server'
JAVA_DEBUG_OPTS=" -Xdebug -Xnoagent -Djava.compiler=NONE
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"

# Uncomment the next line to enable java debuging
#JAVA_OPTS=${JAVA_OPTS} ${JAVA_DEBUG_OPTS}
echo $JAVA_OPTS


TOMCAT_USER=daemon

TMPDIR=/var/tmp


RC=0

case "$1" in

 start)

  $CATALINA_HOME/bin/jsvc   \
-debug \
-user $TOMCAT_USER \
-home $JAVA_HOME   \
-jvm server \
-Dcatalina.home=$CATALINA_HOME \
-Xmx256m \
-Djava.io.tmpdir=$TMPDIR \
-Djava.awt.headless=true \
-outfile $CATALINA_HOME/logs/catalina.out \
-errfile $CATALINA_HOME/logs/catalina.err \
-cp $CLASSPATH  \
org.apache.catalina.startup.Bootstrap

   RC=$?

   [ $RC = 0 ] && touch /var/lock/subsys/tomcat
   ;;

 stop)

   PID=`cat /var/run/jsvc.pid`
   kill $PID

  RC=$?

   [ $RC = 0 ] && rm -f /var/lock/subsys/tomcat /var/run/jsvc.pid
   ;;

 *)
   echo "Usage: $0 {start|stop}"
   exit 1

esac
exit $RC


13/06/2007 13:28:41 10653 jsvc debug: +-- DUMPING PARSED COMMAND LINE
ARGUMENTS --
13/06/2007 13:28:41 10653 jsvc debug: | Detach:  True
13/06/2007 13:28:41 10653 jsvc debug: | Show Version:No
13/06/2007 13:28:41 10653 jsvc debug: | Show Help:   No
13/06/2007 13:28:41 10653 jsvc debug: | Check Only:  Disabled
13/06/2007 13:28:41 10653 jsvc debug: | Stop:False
13/06/2007 13:28:41 10653 jsvc debug: | Wait:0
13/06/2007 13:28:41 10653 jsvc debug: | Run as service:  No
13/06/2007 13:28:41 10653 jsvc debug: | Install service: No
13/06/2007 13:28:41 10653 jsvc debug: | Remove service:  No
13/06/2007 13:28:41 10653 jsvc debug: | JVM Name:"server"
13/06/2007 13:28:41 10653 jsvc debug: | Java Home:
"/usr/lib/jvm/java-1.6.0-sun"
13/06/2007 13:28:41 10653 jsvc debug: | PID File:"/var/run/jsvc.pid"
13/06/2007 13:28:41 10653 jsvc debug: | User Name:   "daemon"
13/06/2007 13:28:41 10653 jsvc debug: | Extra Options:   5
13/06/2007 13:28:41 10653 jsvc debug: |
"-Dcatalina.home=/usr/local/tomcat/tomcat6"
13/06/2007 13:28:41 10653 jsvc debug: |   "-Xmx256m"
13/06/2007 13:28:41 10653 jsvc debug: |   "-Djava.io.tmpdir=/var/tmp"
13/06/2007 13:28:41 10653 jsvc debug: |   "-Djava.awt.headless=true"
13/06/2007 13:28:41 10653 jsvc debug: |
"-Djava.class.path=/usr/local/tomcat/tomcat6/bin/bootstrap.jar:/usr/local/tomcat/tomcat6/bin/commons-daemon.jar:/usr/lib/jvm/java-1.6.0-sun/lib/tools.jar"
13/06/2007 13:28:41 10653 jsvc debug: | Class Invoked:
"org.apache.catalina.startup.Bootstrap"
13/06/2007 13:28:41 10653 jsvc debug: | Class Arguments: 0
13/06/2007 13:28:41 10653 jsvc debug:
+---
13/06/2007 13:28:41 10654 jsvc debug: user changed to 'daemon'
13/06/2007 13:28:41 10653 jsvc debug: User 'daemon' validated
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate Java Home
in /usr/lib/jvm/java-1.6.0-sun
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
configuration file /usr/lib/jvm/java-1.6.0-sun/jre/lib/jvm.cfg
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
configuration file /usr/lib/jvm/java-1.6.0-sun/lib/jvm.cfg
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
configuration file /usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/jvm.cfg
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM
configuration file /usr/lib/jvm/java-1.6.0-sun/lib/amd64/jvm.cfg
13/06/2007 13:28:41 10653 jsvc debug: VM configuration file not found
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/classic/libjvm.so
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/client/libjvm.so
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java-1.6.0-sun/jre/lib/amd64/libjvm.so
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java-1.6.0-sun/lib/amd64/classic/libjvm.so
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java-1.6.0-sun/lib/amd64/client/libjvm.so
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java-1.6.0-sun/lib/amd64/libjvm.so
13/06/2007 13:28:41 10653 jsvc debug: Attempting to locate VM library
/usr/lib/jvm/java-1.6.0-sun/jre/bin/amd64/classic/libjvm.so
13/06/

Re: Problem with XSL stylesheet not being applied when XML served through Tomcat

2007-06-13 Thread Robert Koberg
On Wed, 2007-06-13 at 13:00 +0200, Markus Schönhaber wrote:
> 
> Another comment targeted @ the OP: IMO XSL transformations should be
> done on the server side, not on the client side. Doing it on the client
> side may be OK if you have a very specific user base and you can be sure
> that their clients support XSLT. If you target a more general audience,
> you'll propably exclude some potential users because their clients won't
> apply the stylesheet. For example, my konqueror doesn't - and since
> AFAIR Safari is based on the same foundation as konqueror, it propably
> won't either.

I don't know about konqueror, but Safari supports it. Safari does not
have an interface to apply transformations with JS, however. And Opera
does not support the document function. Though I tend not to like using
a PI in the source XML to trigger the transform (can't cache the
processor object, tying the style to the source, etc...), it is a widely
supported and easy way to go. If konqueror can't do it, it is probably
the only 'modern' browser that doesn't.

best,
-Rob


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat 5.5 stdout

2007-06-13 Thread Gregor Schneider

One option is to use log4j (http://logging.apache.org/log4j).
you can specify loggers for each application writing to pre-defined locations.

however, you will also have to maintain some disciplin, since log4j or
the java-logging-api are not able to redirect stdout. That means: Do
not use System.out / System.err but use your preferred logger instead.

Unfortunately, some central applications (like commons.pool f.e.) do
not care about any loggers but just dump their output to System.out.

You could specify in $catalina_home/commons/classes/log4j.xml a logger
based on the classnames that produces the output, however, if those
central components just use System.out/err instead of logging, you
will have to live with this.

Anyways, moving your applications to log4j / [enter your preferred
logging-api here] is a great step into the right direction, esp. if
you want to destinguish between error-weight of the message and the
source where this message came from.

Cheers

Gregor
--
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



tomcat 5.5 stdout

2007-06-13 Thread Ilja S.

Hi
It seems there is a lot of confusion around new tomcat 5.5 internal 
logging. I also have a question:
Is there a way to separate stdout (which is all by default written to 
one file catalina.out) to be in files by virtual hosts / context. i.e. 
each application could have its own file where stack trace / uncaught 
exceptions / System.out written? Using either JULI or Log4j logging?
If there are many applications running and all writing exceptions to one 
 file this might become a nightmare to debug. (Yes yes I know that each 
application should use Log4j or similar, but it is not always like that 
+ those uncaught exceptions you know...)

Thanks in advance.
--
*
Best Regards
Ilja


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with XSL stylesheet not being applied when XML served through Tomcat

2007-06-13 Thread Markus Schönhaber
Owen Rees wrote:

> --On Wednesday, June 13, 2007 11:27:45 AM +0200 Markus Schönhaber
> wrote:
> 
>> I don't think this has anything to do with Tomcat. It rather seems
>> to me that Firefox loads and applies the XSL if the URL referencing
>> it points to the same server(?) / base URL (?) the XML file comes
>> from. Drop the XSL into the Tomcat webapp and modify the XML source
>> (or our code generating it) to reference it from there. Then it
>> will propably be applied. If you find out whether this is a
>> documented feature of Firefox or simply a bug, please let me know.
> 
> 
> 
> 
> At the end of the "Why isn't my stylesheet applied?" section it says:
>  "Mozilla won't load XSLT stylesheets from a different domain for
> security reasons."

Thanks for the pointer, Owen!

Another comment targeted @ the OP: IMO XSL transformations should be
done on the server side, not on the client side. Doing it on the client
side may be OK if you have a very specific user base and you can be sure
that their clients support XSLT. If you target a more general audience,
you'll propably exclude some potential users because their clients won't
apply the stylesheet. For example, my konqueror doesn't - and since
AFAIR Safari is based on the same foundation as konqueror, it propably
won't either.

Regards
  mks


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: global/separate classloader for each web-app

2007-06-13 Thread Hamster

On 12/06/07, David Delbecq <[EMAIL PROTECTED]> wrote:
[..]

Stupid suggestion:

Hehe, stupid approach requires stupid solutions ;]


What about one of those approach

1) revise war build process to force inclusion of libs

2) have a server lifecyclelistener  that, before loading of a webapp,
copy the concerned classes to the WEB-INF/lib ?

Copy seems easier than play with classloader...

Thank you David for this suggestion it is worth to check and consider.

--
GMail::Hamster
http://music-codex.com/
http://hamsterready.blogspot.com/

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Server CPU utilization goes upto 400%

2007-06-13 Thread Andre Prasetya

i think its more to application problem instead of tomcat problem. Is there
any application hosted inside tomcat that get infinite loop or use a kind of
loop checking something that utilize the thread fully ? try solving that
with the application developer

On 6/13/07, Sumit Gaikaiwari <[EMAIL PROTECTED]> wrote:



Hello,



We are using tomcat 5.0.25 on Red Hat Enterprise Linux server. There two
applications in webapps. We are facing an issue from around 3-4 months
where the CPU utilization by java process (tomcat) goes quite high:
around 400% in every 4-5 days. The application gets very slow and tomcat
needs to be restarted for normal operation. The output of top command is
as below-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# top

Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie

Cpu(s): 25.1% us,  0.1% sy,  0.0% ni, 74.5% id,  0.2% wa,  0.0% hi,
0.0% si

Mem:   4086472k total,  2487676k used,  1598796k free,   217464k buffers

Swap:  6094824k total,0k used,  6094824k free,  1811576k cached



  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND

1038 root  16   0  545m 244m  61m S  101  6.1   1156:22 java

1 root  16   0  2556  552  472 S0  0.0   0:01.17 init

2 root  RT   0 000 S0  0.0   0:00.31 migration/0





Here is the status of active threads-

Thread Status-



[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# ps -Le -o
pid,user,s,lwp,pcpu,args | awk '$3 != "S" { print }'

1038 root R  1093 19.8 /usr/local/j2sdk1.4.2_12/bin/java -Xmx256m
-Xms128m -Djava.awt.headless=true -Dsun.awt.font.advancecache=off
-Djava.endorsed.dirs=/usr/local/jakarta-tomcat-5.0.25/common/endorsed
-classpath
/usr/local/j2sdk1.4.2_12/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.25/
bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.25/bin/commons-logging-a
pi.jar -Dcatalina.base=/usr/local/jakarta-tomcat-5.0.25
-Dcatalina.home=/usr/local/jakarta-tomcat-5.0.25
-Djava.io.tmpdir=/usr/local/jakarta-tomcat-5.0.25/temp
org.apache.catalina.startup.Bootstrap start

20544 root R 20544  0.0 ps -Le -o pid,user,s,lwp,pcpu,args



This was status at certain instant of time. After 5 hours from this
instant, the utilization reached to 400% and also there were many
threads which were using almost 150% of CPU time.



The system configuration is -



[EMAIL PROTECTED] ~]# wget --quiet -O - --user admin --password nimda
http://localhost:8080/manager/serverinfo

OK - Server info

Tomcat Version: Apache Tomcat/5.0.25

OS Name: Linux

OS Version: 2.6.9-42.0.2.ELsmp

OS Architecture: i386

JVM Version: 1.4.2_12-b03

JVM Vendor: Sun Microsystems Inc.



Please can any one tell me possible cause for this issue? This issue has
become very critical and needs to be fixed out soon.



Regards,

Sumit Gaikaiwari



-**Nihilent***

" *** All information contained in this communication is confidential,
proprietary, privileged and is intended for the addressees only. If you have
received this E-mail in error please notify mail administrator by telephone
on +91-20-39846100 or E-mail the sender by replying to this message, and
then delete this E-mail and other copies of it from your computer system.
Any unauthorized dissemination, publication, transfer or use of the contents
of this communication, with or without modifications is punishable under the
relevant law.

Nihilent has scanned this mail with current virus checking technologies.
However, Nihilent makes no representations or warranties to the effect that
this communication is virus-free.

Nihilent reserves the right to monitor all E-mail communications
through  its Corporate Network. *** "

*-





--
-Andre-

People see things the way they are and say "why ?" I see things that never
were and say "Why not ?"


Re: Tomcat Server CPU utilization goes upto 400%

2007-06-13 Thread Tim Funk
This is an old version so you might be see'ing gc issues. (but that is a 
wild guess).


There isn't enough detail to debug, but when the situation arises - do 
the following - get thread dumps a look for "odd stuff"

1) kill -3 tomcat when tomcat is running OK - so you have a base line
2) Then when things are going bad kill -3 to get a stack trace of all 
the threads and look for what is running and "out of the ordinary" - 
typically you might need 2 or 3 dumps for a better comparision
3) When things get really slow - do a final stack trace (via kill -3) 
before you restart tomcat. We luck this trace will confirm any theories 
you saw in step 2.


Good luck.

-Tim

Sumit Gaikaiwari wrote:

Hello,

 


We are using tomcat 5.0.25 on Red Hat Enterprise Linux server. There two
applications in webapps. We are facing an issue from around 3-4 months
where the CPU utilization by java process (tomcat) goes quite high:
around 400% in every 4-5 days. The application gets very slow and tomcat
needs to be restarted for normal operation. The output of top command is
as below-

 


[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# top

Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie

Cpu(s): 25.1% us,  0.1% sy,  0.0% ni, 74.5% id,  0.2% wa,  0.0% hi,
0.0% si

Mem:   4086472k total,  2487676k used,  1598796k free,   217464k buffers

Swap:  6094824k total,0k used,  6094824k free,  1811576k cached

 


  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND

 1038 root  16   0  545m 244m  61m S  101  6.1   1156:22 java

1 root  16   0  2556  552  472 S0  0.0   0:01.17 init

2 root  RT   0 000 S0  0.0   0:00.31 migration/0

 

 


Here is the status of active threads-

Thread Status-

 


[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# ps -Le -o
pid,user,s,lwp,pcpu,args | awk '$3 != "S" { print }'

 1038 root R  1093 19.8 /usr/local/j2sdk1.4.2_12/bin/java -Xmx256m
-Xms128m -Djava.awt.headless=true -Dsun.awt.font.advancecache=off
-Djava.endorsed.dirs=/usr/local/jakarta-tomcat-5.0.25/common/endorsed
-classpath
/usr/local/j2sdk1.4.2_12/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.25/
bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.25/bin/commons-logging-a
pi.jar -Dcatalina.base=/usr/local/jakarta-tomcat-5.0.25
-Dcatalina.home=/usr/local/jakarta-tomcat-5.0.25
-Djava.io.tmpdir=/usr/local/jakarta-tomcat-5.0.25/temp
org.apache.catalina.startup.Bootstrap start

20544 root R 20544  0.0 ps -Le -o pid,user,s,lwp,pcpu,args

 


This was status at certain instant of time. After 5 hours from this
instant, the utilization reached to 400% and also there were many
threads which were using almost 150% of CPU time.

 


The system configuration is -

 


[EMAIL PROTECTED] ~]# wget --quiet -O - --user admin --password nimda
http://localhost:8080/manager/serverinfo

OK - Server info

Tomcat Version: Apache Tomcat/5.0.25

OS Name: Linux

OS Version: 2.6.9-42.0.2.ELsmp

OS Architecture: i386

JVM Version: 1.4.2_12-b03

JVM Vendor: Sun Microsystems Inc.

 


Please can any one tell me possible cause for this issue? This issue has
become very critical and needs to be fixed out soon.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with XSL stylesheet not being applied when XML served through Tomcat

2007-06-13 Thread Owen Rees

--On Wednesday, June 13, 2007 11:27:45 AM +0200 Markus Schönhaber wrote:


I don't think this has anything to do with Tomcat. It rather seems to me
that Firefox loads and applies the XSL if the URL referencing it points
to the same server(?) / base URL (?) the XML file comes from.
Drop the XSL into the Tomcat webapp and modify the XML source (or our
code generating it) to reference it from there. Then it will propably be
applied.
If you find out whether this is a documented feature of Firefox or
simply a bug, please let me know.




At the end of the "Why isn't my stylesheet applied?" section it says: 
"Mozilla won't load XSLT stylesheets from a different domain for security 
reasons."


--
Owen Rees; speaking personally, and not on behalf of HP.

Hewlett-Packard Limited.   Registered No: 690597 England
Registered Office:  Cain Road, Bracknell, Berks RG12 1HN

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: hi,problem when shutdown tomcat!

2007-06-13 Thread Peter

i found that.
thanks a lot





On 6/13/07, Jon Wingfield <[EMAIL PROTECTED]> wrote:


The trace is probably in the catalina.out log file (at least that's
where it goes for us running tc5.0.30)

Peter wrote:
> hi all;
> I just found out that in linux
> under the /proc generate a fold 26337
> does it the place which the information stores?
> any idea?
> thanks
>
> On 6/13/07, Peter <[EMAIL PROTECTED]> wrote:
>>
>> hi all;
>> i try to use SIGQUIT but can not see the stack trace.
>>
>> [EMAIL PROTECTED] root]# ps -ef|grep tomcat
>> root 26337 1 5 09:45 pts/0 00:00:11
>> /usr/java/jre1.5.0_08/bin/java -Xms256m -Xmx512m -
>> Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -
>> Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -
>> Djava.endorsed.dirs=/opt/tomcat/common/endorsed -classpath
>> :/opt/tomcat/bin/bootstrap.ja
>> root 26427 26172 0 09:49 pts/0 00:00:00 grep tomcat
>>
>> [EMAIL PROTECTED] root]# kill -SIGQUIT 26337
>> [EMAIL PROTECTED] root]# kill -3 26337
>> [EMAIL PROTECTED] root]#
>>
>> does anyone has idea why?
>> some artical said that if JVM set -Xrs,it will ignore the OS signal
>> like
>> SIGQUIT
>> Does anyone know how can i see the stack trace in this situation?
>> i use Tomcat 5.5.20 in linux , java, 1.5.0_10
>>
>> thanks
>>
>>
>>
>>
>>
>> On 6/12/07, Jon Wingfield <[EMAIL PROTECTED]> wrote:
>> >
>> > Good question. I don't know. The last time I used JBuilder was way
>> back
>> > in 2000.
>> > The Borland site suggests an OptimizeIt profiler is present in
>> JBuilder
>> > for the Developer and Enterprise editions:
>> > http://info.borland.com/techpubs/jbuilder/
>> >
>> > Jon
>> >
>> > Peter wrote:
>> > > thank you for ideas
>> > >
>> > > i current using JBuider2006, what profiler can used in JBuider2006?
>> > >
>> > > thanks
>> > > peter
>> > >
>> > > On 6/12/07, Jon Wingfield <[EMAIL PROTECTED]> wrote:
>> > >>
>> > >> Chuck answered a similar query recently:
>> > >> http://marc.info/?l=tomcat-user&m=118113828210257&w=2
>> > >>
>> > >> Your servlets are serving long-running requests (or are in
infinite
>> > >> loops, dead-locked etc) when you are trying to shutdown tomcat.
>> > >> The first thing I'd do in this situation is SIGQUIT tomcat to get
a
>> > >> stackdump of the running threads.
>> > >> With that you can usually determine the changes you need to do to
>> > your
>> > >> servlets, if required.
>> > >> If the stackdump isn't a help I'd attach a profiler to see where
>> your
>> > >> servlets are spending the time. I like the one bundled with
>> netbeans.
>> > >> I'm sure others on the list have their own favourites.
>> > >>
>> > >> Jon
>> > >>
>> > >> Peter wrote:
>> > >> > hi all;
>> > >> > when i shutdown tomcat, i found following message in the
>> > catalina.out;
>> > >> >
>> > >> >
>> > >> > 2007-6-12 18:18:44 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > * Waiting for 6 instance(s) to be deallocated*
>> > >> > 2007-6-12 18:18:45 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > *Waiting for 6 instance(s) to be deallocated
>> > >> > *2007-6-12 18:18:46 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > *Waiting for 6 instance(s) to be deallocated
>> > >> > *2007-6-12 18:18:46 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > *Waiting for 333 instance(s) to be deallocated*
>> > >> > 2007-6-12 18:18:47 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > *Waiting for 333 instance(s) to be deallocated*
>> > >> > 2007-6-12 18:18:48 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > * Waiting for 333 instance(s) to be deallocated*
>> > >> >
>> > >> > anyone has a idea about the about messages, does it means that
>> > there
>> > >> > is dead
>> > >> > lock in the program?
>> > >> > or some connection are not closed?
>> > >> >
>> > >> > thank you for ideas!
>> > >> > peter
>> > >> >
>> > >>
>> > >>
>> > >>
>> > >>
>> -
>> > >> To start a new topic, e-mail: users@tomcat.apache.org
>> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > >> For additional commands, e-mail: [EMAIL PROTECTED]
>> > >>
>> > >>
>> > >
>> >
>> >
>> >
>> > -
>> > To start a new topic, e-mail: users@tomcat.apache.org
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Help with tomcat 5.0.28 loadbalancing

2007-06-13 Thread Felix Schumacher
Am Di, 12.06.2007, 20:32, schrieb Dwayne A. Ghant:
> Almost got it loadbalancing almost wokring need minor help
> finishing off. Things have chang since I havn't did this in about
> 3 years. I keep getting error messages in my "mod_jk.log" file below
> every time apache initializes. The connector seems to acting strange!!
...
> worker.loadbalancer.type=lb
> worker.loadbalancer.balanced_workers=tomcat5_0_28A, tomcat5_0_28B
...
> [Tue Jun 12 14:21:51 2007] [5226:30880] [warn]
> jk_map_read_property::jk_map.c (432): The attribute
> 'worker.loadbalancer.balanced_workers' is deprecated - please check the
> documentation for the correct replacement.
...
The log message tells you to rename the attribute balanced_workers to
something different - which you should look up in the documentation.
(Hint: It is balance_workers instead of balanced_workers)

And what do you mean by "acting strange"?
Have you set the jvmRoute attribute in the Server->Engine configuration of
the both tomcats?

Bye
 Felix



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with XSL stylesheet not being applied when XML served through Tomcat

2007-06-13 Thread Markus Schönhaber
Garey wrote:

> http://library11.berkeley.edu/~gmills/binds_result.xml 
> 
> 
> http://library11.berkeley.edu:8080/...inds_result.xml 
> 
> 
> 
> In Firefox 2, the first URL results in the XSL stylesheet referenced in 
> the XML document being applied correctly. The second URL does not. The 
> difference is that the first URL is being served by Apache httpd 1.3.X, 
> and the second by Tomcat 6.0.

I don't think this has anything to do with Tomcat. It rather seems to me
that Firefox loads and applies the XSL if the URL referencing it points
to the same server(?) / base URL (?) the XML file comes from.
Drop the XSL into the Tomcat webapp and modify the XML source (or our
code generating it) to reference it from there. Then it will propably be
applied.
If you find out whether this is a documented feature of Firefox or
simply a bug, please let me know.

Regards
  mks

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Comet: Unsufficiently synchronized recycling decisions

2007-06-13 Thread Reich, Matthias
 Hello,

I did not get any response on my post from 2 weeks ago.

Even if non-recycling of request/response objects happens only
sporadically and only in webapps where asynchronous responses may happen
before the event processing has finished, it is definitively a bug.

Should I report it as a bug to receive any reaction?

Regards,
Matthias

> -Original Message-
> From: Reich, Matthias 
> Sent: Wednesday, May 30, 2007 2:04 PM
> To: 'Tomcat Users List'
> Subject: Comet: Unsufficiently synchronized recycling decisions
> 
> Hi,
> 
> as mentioned in my contribution to topic 'Web application 
> receives request parameters sent to another application on 
> Tomcat 6', I sometimes get non-recycled Request objects in a 
> BEGIN event. 
> 
> A non-recycled request object appeared in a BEGIN event if 
> the previous request processed by the same request processor 
> was answered asynchronously directly after the BEGIN event.
> 
> In such a situation my Servlet sometimes did not get an END 
> event, i.e. the CoyoteAdapter was not triggered again and 
> therefore could not recycle the Request object.
> Nevertheless, the request processor was recycled, i.e. 
> readded to the processor pool.
> 
> As the processor was recycled, the cometEvent.close() must 
> have happened *after* CoyoteAdapter had made the decision not 
> to recycle Request/Response, but *before* Http11AprProtocol 
> had made the decision to recycle the processor.
> 
> To verify this, I modified the methods 
> Http11AprProcessor.event and Http11AprProcessor.process.
> 
> I replaced every occurrence of:
> 
>   recycle();
> 
> within these methods with the following lines:
> 
>   org.apache.catalina.connector.Request req = 
> (org.apache.catalina.connector.Request) request.getNote(1);
>   org.apache.catalina.connector.Response res = 
> (org.apache.catalina.connector.Response) response.getNote(1);
>   req.recycle( );
>   res.recycle( );
>   recycle();
> 
> I know that this is a hack and must be solved in a better way 
> (and also for the NIOConnector), but with these modifications 
> I enforced a single decision point for recycling of 
> Request/Response *and* the processor.
> 
> When running Tomcat with these modifications, my Servlet no 
> longer received non-recycled Request objects.
> 
> 
> Regards,
> Matthias
> 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Base null error is it with tomcat ?

2007-06-13 Thread sandipp

can anybody help me in above?

sandip


sandipp wrote:
> 
> 
> Hi,
> 
> I am using tomcat apache-tomcat-5.5.17,Exadel,JDK 1.5.I am depoying my
> application(war file) to external tomcat by running my ant script.
> I am getting following error when I try to login to my application.
> 
> 
> where loginFormBean is my bean name.
> 
> javax.servlet.ServletException: Base is null: loginFormBean
>   javax.faces.webapp.FacesServlet.service(FacesServlet.java:202)
> 
> org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
> 
> 
> root cause 
> 
> javax.faces.el.PropertyNotFoundException: Base is null: loginFormBean
> 
> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:455)
>   
> org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingImpl.java:169)
> 
> com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:111)
>   javax.faces.component.UIInput.getConvertedValue(UIInput.java:713)
>   javax.faces.component.UIInput.validate(UIInput.java:638)
>   javax.faces.component.UIInput.executeValidate(UIInput.java:849)
>   javax.faces.component.UIInput.processValidators(UIInput.java:412)
>   javax.faces.component.UIForm.processValidators(UIForm.java:170)
> 
> javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:912)
>   javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:342)
> 
> org.apache.myfaces.lifecycle.LifecycleImpl.processValidations(LifecycleImpl.java:240)
>   
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
>   javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
> 
> org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122
> 
> 
> On google I found something related to contextlistener from this link
> 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5034433
> 
> which says remove everything from apache-tomcat-5.5.17\work directory.I
> removed everything but still I am getting above error ?
> 
> 
> 
> Thanks
> Sandip
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Base-null-error-is-it-with-tomcat---tf3901121.html#a11095732
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: hi,problem when shutdown tomcat!

2007-06-13 Thread Jon Wingfield
The trace is probably in the catalina.out log file (at least that's
where it goes for us running tc5.0.30)

Peter wrote:
> hi all;
> I just found out that in linux
> under the /proc generate a fold 26337
> does it the place which the information stores?
> any idea?
> thanks
>
> On 6/13/07, Peter <[EMAIL PROTECTED]> wrote:
>>
>> hi all;
>> i try to use SIGQUIT but can not see the stack trace.
>>
>> [EMAIL PROTECTED] root]# ps -ef|grep tomcat
>> root 26337 1 5 09:45 pts/0 00:00:11
>> /usr/java/jre1.5.0_08/bin/java -Xms256m -Xmx512m -
>> Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -
>> Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -
>> Djava.endorsed.dirs=/opt/tomcat/common/endorsed -classpath
>> :/opt/tomcat/bin/bootstrap.ja
>> root 26427 26172 0 09:49 pts/0 00:00:00 grep tomcat
>>
>> [EMAIL PROTECTED] root]# kill -SIGQUIT 26337
>> [EMAIL PROTECTED] root]# kill -3 26337
>> [EMAIL PROTECTED] root]#
>>
>> does anyone has idea why?
>> some artical said that if JVM set -Xrs,it will ignore the OS signal
>> like
>> SIGQUIT
>> Does anyone know how can i see the stack trace in this situation?
>> i use Tomcat 5.5.20 in linux , java, 1.5.0_10
>>
>> thanks
>>
>>
>>
>>
>>
>> On 6/12/07, Jon Wingfield <[EMAIL PROTECTED]> wrote:
>> >
>> > Good question. I don't know. The last time I used JBuilder was way
>> back
>> > in 2000.
>> > The Borland site suggests an OptimizeIt profiler is present in
>> JBuilder
>> > for the Developer and Enterprise editions:
>> > http://info.borland.com/techpubs/jbuilder/
>> >
>> > Jon
>> >
>> > Peter wrote:
>> > > thank you for ideas
>> > >
>> > > i current using JBuider2006, what profiler can used in JBuider2006?
>> > >
>> > > thanks
>> > > peter
>> > >
>> > > On 6/12/07, Jon Wingfield <[EMAIL PROTECTED]> wrote:
>> > >>
>> > >> Chuck answered a similar query recently:
>> > >> http://marc.info/?l=tomcat-user&m=118113828210257&w=2
>> > >>
>> > >> Your servlets are serving long-running requests (or are in infinite
>> > >> loops, dead-locked etc) when you are trying to shutdown tomcat.
>> > >> The first thing I'd do in this situation is SIGQUIT tomcat to get a
>> > >> stackdump of the running threads.
>> > >> With that you can usually determine the changes you need to do to
>> > your
>> > >> servlets, if required.
>> > >> If the stackdump isn't a help I'd attach a profiler to see where
>> your
>> > >> servlets are spending the time. I like the one bundled with
>> netbeans.
>> > >> I'm sure others on the list have their own favourites.
>> > >>
>> > >> Jon
>> > >>
>> > >> Peter wrote:
>> > >> > hi all;
>> > >> > when i shutdown tomcat, i found following message in the
>> > catalina.out;
>> > >> >
>> > >> >
>> > >> > 2007-6-12 18:18:44 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > * Waiting for 6 instance(s) to be deallocated*
>> > >> > 2007-6-12 18:18:45 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > *Waiting for 6 instance(s) to be deallocated
>> > >> > *2007-6-12 18:18:46 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > *Waiting for 6 instance(s) to be deallocated
>> > >> > *2007-6-12 18:18:46 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > *Waiting for 333 instance(s) to be deallocated*
>> > >> > 2007-6-12 18:18:47 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > *Waiting for 333 instance(s) to be deallocated*
>> > >> > 2007-6-12 18:18:48 org.apache.catalina.core.StandardWrapper
>> unload
>> > >> > * Waiting for 333 instance(s) to be deallocated*
>> > >> >
>> > >> > anyone has a idea about the about messages, does it means that
>> > there
>> > >> > is dead
>> > >> > lock in the program?
>> > >> > or some connection are not closed?
>> > >> >
>> > >> > thank you for ideas!
>> > >> > peter
>> > >> >
>> > >>
>> > >>
>> > >>
>> > >>
>> -
>> > >> To start a new topic, e-mail: users@tomcat.apache.org
>> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > >> For additional commands, e-mail: [EMAIL PROTECTED]
>> > >>
>> > >>
>> > >
>> >
>> >
>> >
>> > -
>> > To start a new topic, e-mail: users@tomcat.apache.org
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to get Tomcat to send proper charset?

2007-06-13 Thread Andrew Chapman
Eva,

This will work. I think the problem in the response.setContentType() is as
simple as a typo. An extra quote seems to have crept in, so:

response.setContentType("text/html; charset="UTF-8")

SHOULD BE

response.setContentType("text/html; charset=UTF-8")

Andy

-Original Message-
From: Allen,Eva [mailto:[EMAIL PROTECTED] 
Sent: 13 June 2007 04:36
To: Tomcat Users List
Subject: How to get Tomcat to send proper charset?

We just recently switched our platform from tomcat 4.124 to Tomcat
5.5.23 and now languages Japanese, Chinese (traditional) and Chinese
(simplified) are not displaying properly.   Here's a little background.

We use servlets to build HTML code to be output (please no comments on
how bad an idea this is; it's legacy code, we must support it).  What
we'd done up until now is determine the language to be used from the
login page, save it in the session and use it to determine what
character set should be output.  The character set was explicitly stated
in a meta header on the output web page like so



Page Title

 
or



Page Title


That is no longer working.  It was suggested that tomcat was paying
attention to the HTTP Content-Type header to determine what character
set to display so I modified the code a little bit to use

response.setContentType("text/html; charset="UTF-8")
or 
response.setContentType("text/html; charset="iso-8859-1")

depending on which was appropriate.

But even though that response header is explicitly set in the code,
somehow, somewhere it's changed again, because I've determined that the
content type response header looks like this:

 Content-Type: text/html;charset=ISO-8859-1

What's going on?  Why is Tomcat ignoring what we're telling it?  How can
we get Tomcat to send the correct response header so that our Japanese
and Chinese readers can see something other than gibberish?
-- 
Eva Allen
Consulting Software Engineer, OCLC, Inc.
6565 Kilgour Pl., Dublin, OH  43017
614.764.6009 | [EMAIL PROTECTED]
Views contained herein are my own; they do not necessarily reflect those
of my employer



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with XSL stylesheet not being applied when XML served through Tomcat

2007-06-13 Thread Richard Kaye
Interesting, and I don't know the answer. Doesn't sound
like it's an issue with the mimetype of the main document.

One small point is that you load your stylesheet with
 
but the server provides it as "application/xml".
AFAIK "text/xsl" was never registered and so you might try
"text/xml" or "application/xml" instead.  If this doesn't 
work you could even try application/xslt+xml, or try 
tinkering with the mimetype of the stylesheet as served 
up by your Apache/1.3.33 that serves the XSL.

But I don't see why it should work in one case and not in the
other. (But that is what I get when I try it in epiphany.)

Richard



On Tue, 2007-06-12 at 16:43 -0700, Garey wrote:
> Here are two URLs
> 
> http://library11.berkeley.edu/~gmills/binds_result.xml 
> 
> 
> http://library11.berkeley.edu:8080/...inds_result.xml 
> 
> 
> 
> In Firefox 2, the first URL results in the XSL stylesheet referenced in 
> the XML document being applied correctly. The second URL does not. The 
> difference is that the first URL is being served by Apache httpd 1.3.X, 
> and the second by Tomcat 6.0.
> 
> This document was generated dynamically by the app at noidbind. When I 
> generate the document, I set the mimetype of the document to 'text/xml' 
> and that also fails to work.
> 
> All of these work in IE.
> 
> Can anyone tell me what I have to do to fix this, and get the stylesheet 
> applied when the document is served by Tomcat?
> 
> Thanks;
> 
> Garey Mills
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Getting nuts with Tomcat 5.5 and log4j

2007-06-13 Thread Georg Sauer-Limbach

Hi Gregor,

I am not sure about the definite solution, but as you
got no other answers, try this:

Drop an additional log4j.jar in the webapps lib folder.
Only this, IMHO, makes the webapp load another instance
of log4j so it can be configured independently.

The log4j.xml would then be searched for in WEB-INF/classes
as well.

Any other experiences with multiple log4j instances in
Tomcat AND the webapps?

Georg

Gregor Schneider wrote:

Hi guys,

I've setup Tomcat on my Debian Box so that all loging goes to
$CATALINA_HOME/logs/tomcat.log

I've placed the files log4j.(xml,dtd) int
$CATALINA_HOME/common/classes, and it runs like charm.

Now, I've added another logger which is supposed to log the output of
our apps only. That logger should be in place as a default logger for
all web-apps. The benefit is, that no web-app has to provide it's own
log4j.xml.

This is a snipped of the log4j.xml from $CATALINA_HOME/common/classes where

- the root-logger logs everything coming from Tomcat Engine

- CompassLogger logs everything coming from our applications:

 
 
   
   

...
 

 
 
   
   

...
 

 
 
   
   

...
 

 
 
   
   

...
 

 
 
   
   

...
 

 
 
   
   

...
 

 
   
   
   
   
 

 
   
   
   
   
 
...


Well, this runs like charm.

However, now I'm gaving another web-app which is supposed to have it's
own log-file and should not use CompassLogger but create it's own
logger.

I've created the following file log4j.xml 8again a snippet since it's
quite some code) and put it into
$CATALINA_HOME/webapps/MyWebApp/WEB-INF/classes (together with
log4j.dtd):


 
   
   
   
...
 

 
 
   
   
   
...
 

 
 
   
   
   
...
 

 
   
   
   
   
 

Within my Servlet, I'm having the following peace of code to
initialize the logger:

   public void init(ServletConfig aConfig) throws ServletException {
   super.init(aConfig);
   DOMConfigurator.configure("log4j.xml");
   ssoLogger = Logger.getLogger("SSOLogger");

However, when the servlet is started, I'm getting the following
Exception in catalina.out *sic*:

log4j:ERROR Could not parse file [log4j.xml].
java.io.FileNotFoundException:
/home/tomcat/packages/apache-tomcat-5.5.20/logs/log4j.xml (No such
file or directory)

I've read the log4j-docs, read all the Tomcat-docs about Tomcat &
log4j (which are not too helpful, I'm afraid), browsed through the
"complete log4j-manual - the one you'll have to buy), but nothing
could answer my questions:

1. Is it possible create a default logger with a
log4j.xml-configuration in $CATALINA_HOME/common/classes PLUS create
some application-specific loggers with a log4j.xml-configuration in
$CATALINA_HOME/webapps/MyWebApp/WEB-INF/classes?

2. If so, is it correct that I have need to define the root-logger
only in my default-logger-config (common/classes)?

3. Why is everybody writing that I have to drop my log4j.xml into
$CATALINA_HOME/webapps/MyWebApp/WEB-INF-classes, however, log4j is
searching for a file $CATALINA_HOME/ogs/log4j.xml ?

I know it's quite some log4j-stuff, and this is a Tomcat-mailinglist,
however, I guess this is a real-life-example referring to Tomcat AND
log4j, so hopefully somebody here can shed some light.

Any suggestions welcome!

Gregor



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Server CPU utilization goes upto 400%

2007-06-13 Thread Sumit Gaikaiwari

Hello,

 

We are using tomcat 5.0.25 on Red Hat Enterprise Linux server. There two
applications in webapps. We are facing an issue from around 3-4 months
where the CPU utilization by java process (tomcat) goes quite high:
around 400% in every 4-5 days. The application gets very slow and tomcat
needs to be restarted for normal operation. The output of top command is
as below-

 

[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# top

Tasks:  78 total,   1 running,  77 sleeping,   0 stopped,   0 zombie

Cpu(s): 25.1% us,  0.1% sy,  0.0% ni, 74.5% id,  0.2% wa,  0.0% hi,
0.0% si

Mem:   4086472k total,  2487676k used,  1598796k free,   217464k buffers

Swap:  6094824k total,0k used,  6094824k free,  1811576k cached

 

  PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND

 1038 root  16   0  545m 244m  61m S  101  6.1   1156:22 java

1 root  16   0  2556  552  472 S0  0.0   0:01.17 init

2 root  RT   0 000 S0  0.0   0:00.31 migration/0

 

 

Here is the status of active threads-

Thread Status-

 

[EMAIL PROTECTED] jakarta-tomcat-5.0.25]# ps -Le -o
pid,user,s,lwp,pcpu,args | awk '$3 != "S" { print }'

 1038 root R  1093 19.8 /usr/local/j2sdk1.4.2_12/bin/java -Xmx256m
-Xms128m -Djava.awt.headless=true -Dsun.awt.font.advancecache=off
-Djava.endorsed.dirs=/usr/local/jakarta-tomcat-5.0.25/common/endorsed
-classpath
/usr/local/j2sdk1.4.2_12/lib/tools.jar:/usr/local/jakarta-tomcat-5.0.25/
bin/bootstrap.jar:/usr/local/jakarta-tomcat-5.0.25/bin/commons-logging-a
pi.jar -Dcatalina.base=/usr/local/jakarta-tomcat-5.0.25
-Dcatalina.home=/usr/local/jakarta-tomcat-5.0.25
-Djava.io.tmpdir=/usr/local/jakarta-tomcat-5.0.25/temp
org.apache.catalina.startup.Bootstrap start

20544 root R 20544  0.0 ps -Le -o pid,user,s,lwp,pcpu,args

 

This was status at certain instant of time. After 5 hours from this
instant, the utilization reached to 400% and also there were many
threads which were using almost 150% of CPU time.

 

The system configuration is -

 

[EMAIL PROTECTED] ~]# wget --quiet -O - --user admin --password nimda
http://localhost:8080/manager/serverinfo

OK - Server info

Tomcat Version: Apache Tomcat/5.0.25

OS Name: Linux

OS Version: 2.6.9-42.0.2.ELsmp

OS Architecture: i386

JVM Version: 1.4.2_12-b03

JVM Vendor: Sun Microsystems Inc.

 

Please can any one tell me possible cause for this issue? This issue has
become very critical and needs to be fixed out soon.

 

Regards,

Sumit Gaikaiwari



-**Nihilent***

" *** All information contained in this communication is confidential, 
proprietary, privileged and is intended for the addressees only. If you have 
received this E-mail in error please notify mail administrator by telephone on 
+91-20-39846100 or E-mail the sender by replying to this message, and then 
delete this E-mail and other copies of it from your computer system. Any 
unauthorized dissemination, publication, transfer or use of the contents of 
this communication, with or without modifications is punishable under the 
relevant law. 

Nihilent has scanned this mail with current virus checking technologies. 
However, Nihilent makes no representations or warranties to the effect that 
this communication is virus-free. 

Nihilent reserves the right to monitor all E-mail communications through  its 
Corporate Network. *** "

*-