Re: unable to read complete POST body via tomcat connector

2008-05-04 Thread Mark Thomas

[EMAIL PROTECTED] wrote:

Hello All,

I'm trying to POST a relatively small amount of content (22K) and find
that when the request comes via apache/mod_jk, I can only read part of
the body.  The same request to standalone tomcat (HTTP connector) works
file.  I'm reading the POST body with code like:

BufferedReader reader = request.getReader();
String inputLine;
while ((inputLine = reader.readLine()) != null) {
   sb.append(inputLine);
}

Can anyone suggest what might be wrong?


Tomcat version? mod_jk version? httpd version? jvm version?
Which part of the body can you read? How much data can you read? Is it 
always the same or does it vary by request?


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]



Re: JkSetEnv and Servlet Filters

2008-05-04 Thread Rainer Jung

Hi Keith,

Keith Ealanta schrieb:
Can anyone advise me how to access the attributes set in an http request 
using JkSetEnv?


I just tried it again, it works for me.

Specifically I'm using JkSetEnv on Apache2.0 to set a number of 
attributes in the request.
I have captured the mod_jk packets (on port 8009) and they contain the 
items I've set in the attributes section as req_attribute type (code 0x0A)
When I access the ServletRequest object I cannot find this data 
anywhere. I've downloaded a number of ServletRequest display filters and 
none of them show the data either.


I simply retrieve any attribute via
  request.getAttribute(nameOfTheAttribute)
from the ServletRequest.

Are these attributes only useful for setting specific values the system 
understands, is there some other way for me to access these values from 
the ServletRequest object in Tomcat, or alternately is it possible there 
is some error in mod_jk or Tomcat such that the data is never extracted 
(if it even should be).


It works for me. Which versions of mod_jk and Tomcat are you using?
How does your JK config look like (yes, I know you already wrote you can 
see the attribute set in the debug log, but let's make sure)?


There have been no changes to that code recently. I'm using TC 5.5.26 in 
my test.


I'm guessing I'm just looking for it in all the wrong places, so I'm 
hoping someone can point me in the right direction.


How do you retrieve the env var on the Tomcat side?


Regards,
Keith Ealanta


Regards,

Rainer

-
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: Web Service on Tomcat on Solaris

2008-05-04 Thread Rainer Jung

Hi,

Hansen, P (Palle) schrieb:

Hi All

I'm fairly new to Tomact etc, but I've developed a Web Service in
Eclipse, and it works great there

I created the War Files and deployed them to Tomcat 5.5 running on
Windows and everything looks Great

I then installed Tomcat on Unix Solaris 8 And deployed the war files
there.

This is where the problem starts.

The jsp pages are displayed ok, but as soon as I hit the button that
will invoke the java class all I get is

exception: java.net.ConnectException: Connection refused


Where s the code running, that gets the exception? Is this some client 
side code, or code that runs within Tomcat? What's the exception stack?


Where does this code want to connect to (name or IP address, port) and 
how does it get this information (configuration etc.)?



The same class works on Tomcat running on windows

I've put some debug lines in the class file, and in fact there is a
debug line at the very beginning and that don't even get executed, so
I don't think any of the method is being executed

Any help would be appreciated

Thanks

Palle Hansen


Regards,

Rainer

-
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 6.0.16 and web server 2.0.59

2008-05-04 Thread Rainer Jung

Hi Anurag,

Mehrotra, Anurag schrieb:

I have been trying to connect tomcat 6.0.16 (using JVM 1.5.0_15) on windows
32 bit platform to connect to apache web server httpd 2.0.59 with mod_jk.

I have defined the following entries in my worker.properties:
workers.tomcat_home
workers.java_home
ps


Those three entries above are not used. You can savely delete them.



I loaded the mod_jk.so  as follows: LoadModulejk_module
modules/mod_jk.so

>


I defined all the mod_jk related directives in my httpd.conf

# Where to find workers.properties
JkWorkersFile 


You need to add a value, namely the path to the worker.properties (the 
name you used above) or workers.properties (plural, that's how it is 
usually named).



# Where to put jk shared memory
JkShmFile 


Delete or use a file argument


# Where to put jk logs
JkLogFile 


Delete or use a file argument


# Set the jk log level [debug/error/info]
JkLogLeveldebug

# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "


If you are not sure you want that, delete it.


# Send servlet for context /examples to worker named worker1
JkMount  /* worker1


If you are working with virtual hosts in httpd, you need to put the 
JkMount into the virtual host elements.


Furthermore you didn't define a worker named worker1 in your 
worker.properties above, so using it will not work.




In httpd.conf I have a section for 


which contains what?


When the app server and web server are started a fresh "mod_jk.conf" is
generated under TOMCAT_HOME/conf/auto - this file has the listing for my
application and other tomcat apps as follows:
JkMount /app1 ajp13
JkMount /app1/* ajp13

JkMount /host-manager ajp13
JkMount /host-manager/* ajp13

JkMount /docs ajp13
JkMount /docs/* ajp13

JkMount /manager ajp13
JkMount /manager/* ajp13


This is an auto-generated configuration file example. If you add a jk 
listener to your tomcat, it will spit out such an example config file 
for mod_jk. Tomcat will not use it itself. The file is meant as a 
starting point for the jk specific part of your httpd configuration.




But when I try to access my application as http://localhost/app1
  all I get in mod_jk.log is 


I would expect you get a lot more messages with debug log level.


[Fri May 02 11:08:02 2008] [5588:944] [debug] mod_jk.c (2740): Initialized
mod_jk/1.2.26
[Fri May 02 11:24:01 2008] [5588:4972] [debug] mod_jk.c (3033): missing uri
map for localhost:/app1
[Fri May 02 11:24:01 2008] [5588:4972] [debug] mod_jk.c (3190): missing uri
map for localhost:/app1


- Add the correct path and file name to JkWorkersFile
- Move JkMount into the virtual hosts
- Add a correct definition for worker1 to your worker.properties


I am unable to even access the tomcat manager application as
http://localhost/manager/html  


- See above



Need some pointers or help here!


HTH

Rainer

-
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: Where to find mod_jk ?

2008-05-04 Thread Rainer Jung

Mark Thomas schrieb:

karthikn wrote:

Hi

Can some body on form tell me where can i find ?

 >> Load Balacing "mod_jk"  for  Apache2.2 http server to Tomcat 
5.5.23 connectors.

OS = Win 2000 ,UNIX 11 pa

I could not find one on  apache  mirror sites  ...


http://tomcat.apache.org/download-connectors.cgi

Mark


... -> "Binary Releases"  -> win32 (for 32 Bit Windows)

There is no binary provided for HP-UX. You'll need to compile such a 
binary yourself.


Regards,

Rainer

-
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 URL double decoding problem

2008-05-04 Thread Rainer Jung

Hi Avi,

Avi Avi schrieb:

My question is regarding mod_jk/tomcat integration.
I am using Apache 2.0.54 and mod_jk 1.2.26.

When I request the following url to my application, I get an HTTP 500
response (internal server error).
http://www.foo.com/bar?a=param_with_%25

But if I send the request to jboss directly (port 8080), the above url
works.
So, I am pretty sure that this is a double decoding issue due to %25.

I have tried this with all 3 jkOptions (ForwardURIProxy,
ForwardURICompatUnparsed, ForwardURIEscaped, ForwardURICompat)
and nothing seems to work.

Am I missing something here ? Any help/tips will be greatly appreciated.


There no obvious problem about %25. When I try to send it, my mod_jk log 
contains (debug log level) something like:


ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
02202D 61 67 65 3D 30 00 A0 08 00 01 30 00 05 00 10  -
-age=0.0

A0 08: Content length following
00 01 30 00: content length is "0"
05: Query string following
00 10: length of query string is 16

ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
023061 3D 70 61 72 61 6D 5F 77 69 74 68 5F 25 32 35  -
a=param_with_%25

16 Bytes with query string "a=param_with_%25"

ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
024000 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00  -


followed by a terminating "00" and "ff" (request terminator).

ajp_send_request::jk_ajp_common.c (1489): (ajp13) request body to send 0 
- request body to resend 0


Can you also see your request string including the "%25" in such a way 
in the debug log?




Thanks
Avi


Can you see, where error 500 comes from (Tomcat or httpd)?

What does your tomcat access log contain, if you enable it in 
server.xml? Does it show the correct request line?


How does you URL realy look like (is %25 really in the query string and 
is it really the last part of it)?


Please use the default settings for JkOptions (no option at all) for 
testing.


Regards,

Rainer

-
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: unable to read complete POST body via tomcat connector

2008-05-04 Thread Rainer Jung

Mark Thomas schrieb:

[EMAIL PROTECTED] wrote:

Hello All,

I'm trying to POST a relatively small amount of content (22K) and find
that when the request comes via apache/mod_jk, I can only read part of
the body.  The same request to standalone tomcat (HTTP connector) works
file.  I'm reading the POST body with code like:

BufferedReader reader = request.getReader();
String inputLine;
while ((inputLine = reader.readLine()) != null) {
   sb.append(inputLine);
}

Can anyone suggest what might be wrong?


Tomcat version? mod_jk version? httpd version? jvm version?
Which part of the body can you read? How much data can you read? Is it 
always the same or does it vary by request?


Mark


... and if you are using 5.5.26 or 6.0.16 and always get around 8KB, you 
might be hitting Bugzilla 44494 
(https://issues.apache.org/bugzilla/show_bug.cgi?id=44494).


Rainer

-
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: unable to read complete POST body via tomcat connector

2008-05-04 Thread Rainer Jung

Ben Stringer schrieb:

On Sun, 2008-05-04 at 00:41 -0600, [EMAIL PROTECTED] wrote:

Hello All,

I'm trying to POST a relatively small amount of content (22K) and find
that when the request comes via apache/mod_jk, I can only read part of
the body.  The same request to standalone tomcat (HTTP connector) works
file.  I'm reading the POST body with code like:

BufferedReader reader = request.getReader();
String inputLine;
while ((inputLine = reader.readLine()) != null) {
   sb.append(inputLine);
}

Can anyone suggest what might be wrong?


Is there SSL anywhere in your setup?

Can't see why this would not be working - you may want to try tweaking
the max_packet_size in workers.properties and packetSize on the Tomcat
connector, details here:

http://tomcat.apache.org/connectors-doc/reference/workers.html

Cheers, Ben


... those two settings do not need any tweaking for POST bodies.

Rainer

-
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 set timeout for request?

2008-05-04 Thread Gres

For example - some problem with DB, endless loop and so on can produce
situation, that response is stuck in some steps. how can i set to tomcat
some "try again later" page shown in this situations? thank you.
-- 
View this message in context: 
http://www.nabble.com/How-set-timeout-for-request--tp17045552p17045552.html
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: Uploading Files Larger than 2GB

2008-05-04 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

hoffmandirt wrote:
| I tried with IE6, IE7, and Firefox 2.0.0.14 and no luck with any of them.

What is the error you get when you upload, or do you not get an error
(check the logs)?

Do you get any portion of the file? If so, is it always the same size chunk?

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

iEYEARECAAYFAkgdrRkACgkQ9CaO5/Lv0PANmwCgkx548FAZ6KmkwXrtIID/J68M
q/YAnRSUaUaHt6QViP2RqgCceR6BG/WQ
=C2oa
-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: Uploading Files Larger than 2GB

2008-05-04 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

hoffmandirt wrote:
| I tried with IE6, IE7, and Firefox 2.0.0.14 and no luck with any of them.

One more thing: what JVM are you using? I seem to recall some problems
with IBM's 32-bit JVM running on a 64-bit OS having problems with large
file sizes.

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

iEYEARECAAYFAkgdrVsACgkQ9CaO5/Lv0PBjkgCghKgVUiGgjQ7/Jf6IjOZJggOS
X3YAoItXUtqr8HaMEpkx/d3kNgFXIu1v
=7nLp
-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: CPU usage quirk with multiple tomcat instances

2008-05-04 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Da,

Lists wrote:
|> My guess (and that's all it is) is that you have eliminated much of the
|> context-switching overhead that two instances would have compared to one.
|
| Ah I see.  I guess i can look at that with mpstat and look at things like
| thread migrations etc.  Important because if we install more CPU's i guess
| that may mitigate the context switching overhead.  Or maybe we can gain
| performance by tying zones to one or two cpu's.

Is there any advantage to running multiple JVMs on a single machine? Why
not just give your single JVM a big chunk of memory and let it do its thing?

| Opteron 254 vs 252.  So 0.2ghz less but afaik no other difference.  Not
| enough of a difference to account for the additional cpu.  so this box
uses
| 80% cpu vs 30% on the other one for the same load.

Do you mean "same webapp load"? Obviously, that addition load is coming
from /somewhere/. What about other services running on the same machine?

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

iEYEARECAAYFAkgdrqkACgkQ9CaO5/Lv0PCgqACfRxKediPbJyxkYpcBA0z1Qslt
5M8An1t6VYvyOh3+tMThcXqIZcHQFGVc
=y2AR
-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: authenticated but not authorized -- blank page

2008-05-04 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lloyd,

DIGLLOYD INC wrote:
|   
| guest1
| guest2
|   

Not sure if Tomcat actually cares, but this is an invalid configuration.
Look at the DTD or Schema (whichever one you are using) again.

- -chris

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

iEYEARECAAYFAkgdsvkACgkQ9CaO5/Lv0PA11gCfY+qjBS8Ps/+Oo6euBrtH2XYX
WG8AmwQua1rRdHt8XZ9R59bUvYprX9MG
=zP74
-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: JkSetEnv and Servlet Filters

2008-05-04 Thread Keith Ealanta

Rainer Jung wrote:

Hi Keith,

Keith Ealanta schrieb:
Can anyone advise me how to access the attributes set in an http 
request using JkSetEnv?


I just tried it again, it works for me.

Specifically I'm using JkSetEnv on Apache2.0 to set a number of 
attributes in the request.
I have captured the mod_jk packets (on port 8009) and they contain 
the items I've set in the attributes section as req_attribute type 
(code 0x0A)
When I access the ServletRequest object I cannot find this data 
anywhere. I've downloaded a number of ServletRequest display filters 
and none of them show the data either.


I simply retrieve any attribute via
  request.getAttribute(nameOfTheAttribute)
from the ServletRequest.

Are these attributes only useful for setting specific values the 
system understands, is there some other way for me to access these 
values from the ServletRequest object in Tomcat, or alternately is it 
possible there is some error in mod_jk or Tomcat such that the data 
is never extracted (if it even should be).


It works for me. Which versions of mod_jk and Tomcat are you using?

Mod_jk: 1:1.2.18-3
Apache2: Apache/2.0.54

/opt/tomcat/bin/version.sh
Server version: Apache Tomcat/5.5.17
Server built:   Apr 14 2006 02:08:29
Server number:  5.5.17.0
OS Name:Linux
OS Version: 2.6.18-4-xen-vserver-amd64
Architecture:   i386
JVM Version:1.6.0_03-b05
JVM Vendor: Sun Microsystems Inc.

How does your JK config look like (yes, I know you already wrote you 
can see the attribute set in the debug log, but let's make sure)?

Extract from file /etc/apache2/conf.d/player.conf
# JK
JkEnvVar AUTH_TYPE ""
JkEnvVar REMOTE_USER ""
JkEnvVar SINA_CUSTOMER ""
JkEnvVar SINA_EA ""
JkEnvVar SINA_USER_GROUP_NAME ""
JkWorkersFile   /etc/libapache2-mod-jk/workers.properties.mycms-scorm
JkLogFile   /var/log/apache2/mod_jk.log
JkLogLevel  info
JkMount /my_player* icodeon

# this is a hack to redirect this


   AuthName SINA
   AuthType Basic
   Auth_SINAuser on
   Auth_SINAextras off
   Auth_SINAexpire on
   Auth_SINAproxys 1.1.1.1/255.255.255.255
   ErrorDocument 401 /utils/auth/admin/
   ErrorDocument 503 /utils/error/resolver/
   SINA_Load_Max 100
   ErrorDocument 416 /utils/load/admin/
JkMount icodeon
   
   order deny,allow
   allow from all
   require valid-user
   





file: /etc/libapache2-mod-jk/workers.properties.mycms-scorm
# Define some properties
 workers.apache_log=/var/log/tomcat
#  worker.list=scorm,olat,icodeon
 worker.list=icodeon
 ps=/

# Set properties for worker1 (ajp13)
 worker.icodeon.type=ajp13
# FIXME use host name "scorm"?
# worker.icodeon.host=scorm
 worker.icodeon.host=debian
 worker.icodeon.port=8009
 worker.icodeon.connection_pool_size=10
 worker.icodeon.connection_pool_timeout=600
 worker.icodeon.socket_keepalive=1
 worker.icodeon.socket_timeout=60
#  worker.icodeon.mount=/my_player*



There have been no changes to that code recently. I'm using TC 5.5.26 
in my test.


Hmm, I'm guessing I may need to find more recent versions (probably 
back-ports)
I'm guessing I'm just looking for it in all the wrong places, so I'm 
hoping someone can point me in the right direction.


How do you retrieve the env var on the Tomcat side?
public void doFilter(ServletRequest servletRequest, ServletResponse 
servletResponse, FilterChain filterChain) throws IOException, 
ServletException {

   log.debug("\nAttributes ... begin.\n");
   Enumeration attributeNames = servletRequest.getAttributeNames();
   while(attributeNames.hasMoreElements()) {
 String attributeName = (String) attributeNames.nextElement();
 log.debug(attributeName + " " + 
servletRequest.getAttribute(attributeName));

   }
   log.debug("\nAttributes ... end.\n");
etc.
}

Thanks for looking at this.
I'm now suspecting I need a more recent version of Tomcat.
Just in case though, your test code was run as a filter?  I've been 
wondering if the filter saw something different from what the servlet sees?


Regards,
Keith


-
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 URL double decoding problem

2008-05-04 Thread Avi Avi
Rainer,

Thanks a lot for the response.

I see similar results as yours in mod_jk.log. So it seems mod_jk is doing
the right thing and passing %25 unescaped.

The error is on the application side while reading the query param. Here is
the snippet:

2008-05-04 10:00:47,684 ERROR [orb.servlet.api] tracker doPost():
Exception=java.lang.IllegalArgumentException: URLDecoder: Illegal hex
characters in escape (%) pattern - For input string: "zz" :URLDecoder:
Illegal hex characters in escape (%) pattern - For input string: "zz"

Here is the request:
http://www.foo.com/bar?a=param_with_%25zz
(I put "zz" at the end to make sure that it wasn't something due to being
the last char.)

What is throwing me off is that the request works fine on port 8080. All I
am doing is calling request.getParameter().
I am not sure if it changes anything but I am using Jboss and not Tomcat.

Thanks again
Avi

On Sun, May 4, 2008 at 4:58 AM, Rainer Jung <[EMAIL PROTECTED]> wrote:

> Hi Avi,
>
> Avi Avi schrieb:
>
>  My question is regarding mod_jk/tomcat integration.
> > I am using Apache 2.0.54 and mod_jk 1.2.26.
> >
> > When I request the following url to my application, I get an HTTP 500
> > response (internal server error).
> > http://www.foo.com/bar?a=param_with_%25
> >
> > But if I send the request to jboss directly (port 8080), the above url
> > works.
> > So, I am pretty sure that this is a double decoding issue due to %25.
> >
> > I have tried this with all 3 jkOptions (ForwardURIProxy,
> > ForwardURICompatUnparsed, ForwardURIEscaped, ForwardURICompat)
> > and nothing seems to work.
> >
> > Am I missing something here ? Any help/tips will be greatly appreciated.
> >
>
> There no obvious problem about %25. When I try to send it, my mod_jk log
> contains (debug log level) something like:
>
> ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
> 02202D 61 67 65 3D 30 00 A0 08 00 01 30 00 05 00 10  -
> -age=0.0
>
> A0 08: Content length following
> 00 01 30 00: content length is "0"
> 05: Query string following
> 00 10: length of query string is 16
>
> ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
> 023061 3D 70 61 72 61 6D 5F 77 69 74 68 5F 25 32 35  -
> a=param_with_%25
>
> 16 Bytes with query string "a=param_with_%25"
>
> ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
> 024000 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00  -
> 
>
> followed by a terminating "00" and "ff" (request terminator).
>
> ajp_send_request::jk_ajp_common.c (1489): (ajp13) request body to send 0 -
> request body to resend 0
>
> Can you also see your request string including the "%25" in such a way in
> the debug log?
>
>
> > Thanks
> > Avi
> >
>
> Can you see, where error 500 comes from (Tomcat or httpd)?
>
> What does your tomcat access log contain, if you enable it in server.xml?
> Does it show the correct request line?
>
> How does you URL realy look like (is %25 really in the query string and is
> it really the last part of it)?
>
> Please use the default settings for JkOptions (no option at all) for
> testing.
>
> Regards,
>
> Rainer
>
> -
> 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 reload web app from java program?

2008-05-04 Thread milos
Hello,

> If you wanted to go that route, might as well call wget or curl to hit
> the manager webapp with a reload command.


It is then possible to send appropriate http request from java class to
manager webapp, isn't it?
But is there any API to reload the context from the app itself? I suppose
I need exactly the same API call as manager app does to reload the
context!


Regards, Milos

>The OP is trying to reload
> one webapp, not the entire tomcat.
>
> --David
>
> David Kerber wrote:
>> David Smith wrote:
>>> Don't think so.  The next best things are a) using the manager webapp
>>> to reload or b) design the webapp to reload local config information
>>> itself.  The only down side to (b) is it can't work on resources
>>> defined in tomcat configs like database pools.
>> Couldn't you call an external batch file that stopped and then
>> restarted Tomcat?  Like calling a windows .cmd file that issued NET
>> STOP and NET START commands?  That's not exactly the application
>> itself doing the restart, but it's probably close enough for most
>> purposes.
>>
>> D
>>
>>>
>>> --David
>>>
>>> [EMAIL PROTECTED] wrote:
 Hello,
 is there any way to reload deployed application from the application
 itself?
 I suppose there must be an API to do that.

 Thanks in advance,
 Milos Kovacevic
>>
>>
>> -
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>
>
> --
> David Smith
> Network Operations Supervisor
> Department of Entomology
> Cornell University
> 2132 Comstock Hall
> Ithaca, NY 14853
> Phone: (607) 255-9571
> Fax: (607) 255-0940
>
>
> -
> 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 reload web app from java program?

2008-05-04 Thread David Smith
But to use the api that the manager app uses, your webapp needs to have 
privileged="true" set in the context first.  Second, look at the source 
for the manager webapp for exactly what it does.  And lastly, notice the 
manager webapp can't reload itself -- I suspect there's a reason for 
that.  

I'm not sure a webapp being reloaded can request the manager reload it 
as the manager does it during the request and doesn't send a response 
until the reload is complete.  If you have code that can't unload 
because it's actively being executed, it might block the reload.


--David

[EMAIL PROTECTED] wrote:

Hello,

  

If you wanted to go that route, might as well call wget or curl to hit
the manager webapp with a reload command.




It is then possible to send appropriate http request from java class to
manager webapp, isn't it?
But is there any API to reload the context from the app itself? I suppose
I need exactly the same API call as manager app does to reload the
context!


Regards, Milos

  

The OP is trying to reload
one webapp, not the entire tomcat.

--David

David Kerber wrote:


David Smith wrote:
  

Don't think so.  The next best things are a) using the manager webapp
to reload or b) design the webapp to reload local config information
itself.  The only down side to (b) is it can't work on resources
defined in tomcat configs like database pools.


Couldn't you call an external batch file that stopped and then
restarted Tomcat?  Like calling a windows .cmd file that issued NET
STOP and NET START commands?  That's not exactly the application
itself doing the restart, but it's probably close enough for most
purposes.

D

  

--David

[EMAIL PROTECTED] wrote:


Hello,
is there any way to reload deployed application from the application
itself?
I suppose there must be an API to do that.

Thanks in advance,
Milos Kovacevic
  

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

  

--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


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

  



--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


-
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 reload web app from java program?

2008-05-04 Thread Mark Thomas

David Smith wrote:
But to use the api that the manager app uses, your webapp needs to have 
privileged="true" set in the context first.  Second, look at the source 
for the manager webapp for exactly what it does.  And lastly, notice the 
manager webapp can't reload itself -- I suspect there's a reason for that. 
I'm not sure a webapp being reloaded can request the manager reload it 
as the manager does it during the request and doesn't send a response 
until the reload is complete.  If you have code that can't unload 
because it's actively being executed, it might block the reload.


If you have autoDeploy set to true on the host, one quick and dirty hack 
around this would be to touch the web.xml file. It has the advantage of 
de-coupling the reload of the webapp from the request you use to trigger 
it. On the down side, it requires you to be using unpacked web apps and the 
reload won't be instant.


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]



Re: How to reload web app from java program?

2008-05-04 Thread Costin Manolache
Did you try using JMX ? Unless you use security manager, this should give
you access to many internals.


Costin

On Sun, May 4, 2008 at 7:59 AM, David Smith <[EMAIL PROTECTED]> wrote:

> But to use the api that the manager app uses, your webapp needs to have
> privileged="true" set in the context first.  Second, look at the source for
> the manager webapp for exactly what it does.  And lastly, notice the manager
> webapp can't reload itself -- I suspect there's a reason for that.
> I'm not sure a webapp being reloaded can request the manager reload it as
> the manager does it during the request and doesn't send a response until the
> reload is complete.  If you have code that can't unload because it's
> actively being executed, it might block the reload.
>
>
> --David
>
> [EMAIL PROTECTED] wrote:
>
> > Hello,
> >
> >
> >
> > > If you wanted to go that route, might as well call wget or curl to hit
> > > the manager webapp with a reload command.
> > >
> > >
> >
> >
> > It is then possible to send appropriate http request from java class to
> > manager webapp, isn't it?
> > But is there any API to reload the context from the app itself? I
> > suppose
> > I need exactly the same API call as manager app does to reload the
> > context!
> >
> >
> > Regards, Milos
> >
> >
> >
> > > The OP is trying to reload
> > > one webapp, not the entire tomcat.
> > >
> > > --David
> > >
> > > David Kerber wrote:
> > >
> > >
> > > > David Smith wrote:
> > > >
> > > >
> > > > > Don't think so.  The next best things are a) using the manager
> > > > > webapp
> > > > > to reload or b) design the webapp to reload local config
> > > > > information
> > > > > itself.  The only down side to (b) is it can't work on resources
> > > > > defined in tomcat configs like database pools.
> > > > >
> > > > >
> > > > Couldn't you call an external batch file that stopped and then
> > > > restarted Tomcat?  Like calling a windows .cmd file that issued NET
> > > > STOP and NET START commands?  That's not exactly the application
> > > > itself doing the restart, but it's probably close enough for most
> > > > purposes.
> > > >
> > > > D
> > > >
> > > >
> > > >
> > > > > --David
> > > > >
> > > > > [EMAIL PROTECTED] wrote:
> > > > >
> > > > >
> > > > > > Hello,
> > > > > > is there any way to reload deployed application from the
> > > > > > application
> > > > > > itself?
> > > > > > I suppose there must be an API to do that.
> > > > > >
> > > > > > Thanks in advance,
> > > > > > Milos Kovacevic
> > > > > >
> > > > > >
> > > > >
> > > > -
> > > > To start a new topic, e-mail: users@tomcat.apache.org
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > --
> > > David Smith
> > > Network Operations Supervisor
> > > Department of Entomology
> > > Cornell University
> > > 2132 Comstock Hall
> > > Ithaca, NY 14853
> > > Phone: (607) 255-9571
> > > Fax: (607) 255-0940
> > >
> > >
> > > -
> > > 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]
> >
> >
> >
>
>
> --
> David Smith
> Network Operations Supervisor
> Department of Entomology
> Cornell University
> 2132 Comstock Hall
> Ithaca, NY 14853
> Phone: (607) 255-9571
> Fax: (607) 255-0940
>
>
> -
> 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: JkSetEnv and Servlet Filters

2008-05-04 Thread Rainer Jung

Keith Ealanta schrieb:

Rainer Jung wrote:

Hi Keith,

Keith Ealanta schrieb:
Can anyone advise me how to access the attributes set in an http 
request using JkSetEnv?


I just tried it again, it works for me.

Specifically I'm using JkSetEnv on Apache2.0 to set a number of 
attributes in the request.
I have captured the mod_jk packets (on port 8009) and they contain 
the items I've set in the attributes section as req_attribute type 
(code 0x0A)
When I access the ServletRequest object I cannot find this data 
anywhere. I've downloaded a number of ServletRequest display filters 
and none of them show the data either.


I simply retrieve any attribute via
  request.getAttribute(nameOfTheAttribute)
from the ServletRequest.

Are these attributes only useful for setting specific values the 
system understands, is there some other way for me to access these 
values from the ServletRequest object in Tomcat, or alternately is it 
possible there is some error in mod_jk or Tomcat such that the data 
is never extracted (if it even should be).


It works for me. Which versions of mod_jk and Tomcat are you using?

Mod_jk: 1:1.2.18-3


Aha, although I'm not currently aware of any specific bug related to 
JkEnvVar, you should update mod_jk. We are currently at 1.2.26, which 
runs fine.



Apache2: Apache/2.0.54

/opt/tomcat/bin/version.sh
Server version: Apache Tomcat/5.5.17
Server built:   Apr 14 2006 02:08:29
Server number:  5.5.17.0
OS Name:Linux
OS Version: 2.6.18-4-xen-vserver-amd64
Architecture:   i386
JVM Version:1.6.0_03-b05
JVM Vendor: Sun Microsystems Inc.

How does your JK config look like (yes, I know you already wrote you 
can see the attribute set in the debug log, but let's make sure)?

Extract from file /etc/apache2/conf.d/player.conf
# JK
JkEnvVar AUTH_TYPE ""
JkEnvVar REMOTE_USER ""
JkEnvVar SINA_CUSTOMER ""
JkEnvVar SINA_EA ""
JkEnvVar SINA_USER_GROUP_NAME ""
JkWorkersFile   /etc/libapache2-mod-jk/workers.properties.mycms-scorm
JkLogFile   /var/log/apache2/mod_jk.log
JkLogLevel  info


With "debug" you could see in the jk log file, if your JkEnvVars 
actually get forwarded. This is for version 1.2.26:


ajp_connection_tcp_send_message::jk_ajp_common.c (933):
01e02D 61 67 65 3D 30 00 A0 08 00 01 30 00 0A 00 03  -
-age=0.0

A0 08: Conten-Length is following
00 01: Length of Content-Length string is 1
30 00 (first byte in next line): value of Content Length is "0"
0A: request attribute follows
00 03: Name of request attribute has length 33

ajp_connection_tcp_send_message::jk_ajp_common.c (933):
01f066 6F 6F 00 00 03 62 61 72 00 FF 00 00 00 00 00  -
foo...bar...

66 ... 6F 00: Name of request attribute is "foo"
00 03: value of request attribute has length 3
62 ... 72 00: value of request attribute is "bar"
FF: terminates the request

ajp_send_request::jk_ajp_common.c (1395):
(ajp13) request body to send 0 - request body to resend 0


JkMount /my_player* icodeon


With version 1.2.26 you need to include your JkMount in the Virtual 
Hosts. JkEnvVars are merged between the global server and any vhost.



# this is a hack to redirect this


   AuthName SINA
   AuthType Basic
   Auth_SINAuser on
   Auth_SINAextras off
   Auth_SINAexpire on
   Auth_SINAproxys 1.1.1.1/255.255.255.255
   ErrorDocument 401 /utils/auth/admin/
   ErrorDocument 503 /utils/error/resolver/
   SINA_Load_Max 100
   ErrorDocument 416 /utils/load/admin/
JkMount icodeon


JkMount and vhost see above.


   
   order deny,allow
   allow from all
   require valid-user
   





file: /etc/libapache2-mod-jk/workers.properties.mycms-scorm
# Define some properties
 workers.apache_log=/var/log/tomcat
#  worker.list=scorm,olat,icodeon
 worker.list=icodeon
 ps=/

# Set properties for worker1 (ajp13)
 worker.icodeon.type=ajp13
# FIXME use host name "scorm"?
# worker.icodeon.host=scorm
 worker.icodeon.host=debian
 worker.icodeon.port=8009
 worker.icodeon.connection_pool_size=10


Usually you want to get connection_pool_size determined automatically 
for Apache (default)



 worker.icodeon.connection_pool_timeout=600
 worker.icodeon.socket_keepalive=1
 worker.icodeon.socket_timeout=60
#  worker.icodeon.mount=/my_player*



There have been no changes to that code recently. I'm using TC 5.5.26 
in my test.


Hmm, I'm guessing I may need to find more recent versions (probably 
back-ports)


Try updating mod_jk first. Then look at the debug log for a single 
request and check, if you can see the attribute forwarding there.


I'm guessing I'm just looking for it in all the wrong places, so I'm 
hoping someone can point me in the right direction.


How do you retrieve the env var on the Tomcat side?
public void doFilter(ServletRequest servletRequest, ServletResponse 
servletResponse, FilterChain filterChain) throws IOException, 
ServletException {

   log.debug("\nAttributes ... begin.\n");
   Enumeration attributeNames

Re: mod_jk URL double decoding problem

2008-05-04 Thread Rainer Jung

Avi Avi schrieb:

Rainer,

Thanks a lot for the response.

I see similar results as yours in mod_jk.log. So it seems mod_jk is doing
the right thing and passing %25 unescaped.

The error is on the application side while reading the query param. Here is
the snippet:

2008-05-04 10:00:47,684 ERROR [orb.servlet.api] tracker doPost():
Exception=java.lang.IllegalArgumentException: URLDecoder: Illegal hex
characters in escape (%) pattern - For input string: "zz" :URLDecoder:
Illegal hex characters in escape (%) pattern - For input string: "zz"

Here is the request:
http://www.foo.com/bar?a=param_with_%25zz
(I put "zz" at the end to make sure that it wasn't something due to being
the last char.)

What is throwing me off is that the request works fine on port 8080. All I
am doing is calling request.getParameter().


If I do the same for the above request (forwarded via mod_jk), I get 
"param_with_%zz" as a result.


So it might be a JBoss issue, especially if you can still see the %25zz 
in the mod_jk packet dump.



I am not sure if it changes anything but I am using Jboss and not Tomcat.

Thanks again
Avi


Regards,

Rainer


On Sun, May 4, 2008 at 4:58 AM, Rainer Jung <[EMAIL PROTECTED]> wrote:


Hi Avi,

Avi Avi schrieb:

 My question is regarding mod_jk/tomcat integration.

I am using Apache 2.0.54 and mod_jk 1.2.26.

When I request the following url to my application, I get an HTTP 500
response (internal server error).
http://www.foo.com/bar?a=param_with_%25

But if I send the request to jboss directly (port 8080), the above url
works.
So, I am pretty sure that this is a double decoding issue due to %25.

I have tried this with all 3 jkOptions (ForwardURIProxy,
ForwardURICompatUnparsed, ForwardURIEscaped, ForwardURICompat)
and nothing seems to work.

Am I missing something here ? Any help/tips will be greatly appreciated.


There no obvious problem about %25. When I try to send it, my mod_jk log
contains (debug log level) something like:

ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
02202D 61 67 65 3D 30 00 A0 08 00 01 30 00 05 00 10  -
-age=0.0

A0 08: Content length following
00 01 30 00: content length is "0"
05: Query string following
00 10: length of query string is 16

ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
023061 3D 70 61 72 61 6D 5F 77 69 74 68 5F 25 32 35  -
a=param_with_%25

16 Bytes with query string "a=param_with_%25"

ajp_connection_tcp_send_message::jk_ajp_common.c (1011):
024000 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00  -


followed by a terminating "00" and "ff" (request terminator).

ajp_send_request::jk_ajp_common.c (1489): (ajp13) request body to send 0 -
request body to resend 0

Can you also see your request string including the "%25" in such a way in
the debug log?



Thanks
Avi


Can you see, where error 500 comes from (Tomcat or httpd)?

What does your tomcat access log contain, if you enable it in server.xml?
Does it show the correct request line?

How does you URL realy look like (is %25 really in the query string and is
it really the last part of it)?

Please use the default settings for JkOptions (no option at all) for
testing.

Regards,

Rainer


-
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: authenticated but not authorized -- blank page

2008-05-04 Thread DIGLLOYD INC

I'm using:

http://java.sun.com/xml/ns/javaee";
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd 
"

   version="2.5">

I don't read schemas well.  Perhaps if you would be so kind as to  
explain why it's wrong?  Is it because there is more than one name> specified eg it needs to be:



   guest1


guest2



This is what I see in the schema:

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd


  

  A role-name-key is specified to allow the references
  from the security-role-refs.

  
  
  



Lloyd


On May 4, 2008, at 5:58 AM, Christopher Schultz wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lloyd,

DIGLLOYD INC wrote:
|   
| guest1
| guest2
|   

Not sure if Tomcat actually cares, but this is an invalid  
configuration.

Look at the DTD or Schema (whichever one you are using) again.

- -chris

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

iEYEARECAAYFAkgdsvkACgkQ9CaO5/Lv0PA11gCfY+qjBS8Ps/+Oo6euBrtH2XYX
WG8AmwQua1rRdHt8XZ9R59bUvYprX9MG
=zP74
-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]



Lloyd Chambers
http://diglloyd.com

[Mac OS X 10.5.2 Intel, Tomcat 6.0.16]





-
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 reload web app from java program?

2008-05-04 Thread milos
> David Smith wrote:
>> But to use the api that the manager app uses, your webapp needs to have
>> privileged="true" set in the context first.  Second, look at the source
>> for the manager webapp for exactly what it does.  And lastly, notice the
>> manager webapp can't reload itself -- I suspect there's a reason for
>> that.
>> I'm not sure a webapp being reloaded can request the manager reload it
>> as the manager does it during the request and doesn't send a response
>> until the reload is complete.  If you have code that can't unload
>> because it's actively being executed, it might block the reload.
>
> If you have autoDeploy set to true on the host, one quick and dirty hack
> around this would be to touch the web.xml file. It has the advantage of
> de-coupling the reload of the webapp from the request you use to trigger
> it. On the down side, it requires you to be using unpacked web apps and
> the
> reload won't be instant.
>
> Mark

Thanks Mark,
I also came to this idea but I wanted to check if there is a cleaner way
(using some API) to do this. Concerning my specific web app, there is no
problem related to packing/unpacking and even the delay between touching
web.xml and reloading is not important (if that happens at least after few
minutes).

Milos

>
> -
> 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 problem on a multiple CPU system

2008-05-04 Thread Gilbert, Antoine
Hi

 

I have a 2x quad core (8 cpu units) server.

 

If I start a java program and this one is launching (at the same time) 8
thread doing some CPU intensive jobs, all the CPU are used at 100%, and
that's what I'm expecting..

 

But, if I am using tomcat, and I call a servlet 8 times to process these
8 jobs, it take longer to execute these same 8 jobs and all the CPU are
not used at 100%, it's more like 30%...

 

Any idea about this problem or behavior ? I'm using Tomcat 5.5.17,
windows, JDK 1.6

 

Antoine



tomcat's log files naming and rotation.

2008-05-04 Thread uprooter

Hi.
I'm using tomcat-6.0.16 on a linux server.
I don't want tomcat to insert the date in the log file names, this is very
uncomfortable for me.
And I don't want tomcat to do the log rotation. I'll do it myself with
logrotate
I'm using the default logging facility.
How can I achieve that?

Many Thanks.
-- 
View this message in context: 
http://www.nabble.com/tomcat%27s-log-files-naming-and-rotation.-tp17050926p17050926.html
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: Tomcat problem on a multiple CPU system

2008-05-04 Thread Alan Chaney

Hi Antoine

The thing to remember is that this is a system which has (at least) four 
main parts:


1. Tomcat
2. The operating system
3. A network connection
4. Your application

(and potentially)

5. A database (but you didn't mention that)

Here are some questions.

1. How do you make the connection to the servlet. Does the browser run 
on the same machine as the application?


2. Does you application create network traffic? If so, how many bytes 
are transferred to the browser? Each servlet thread will have to wait 
until the application has transferred all the data out.


3. What kind of disk activity does your application generate? Is it 
different when the app is running from the servlet?


Probably somewhere your servlet threads are sleeping waiting for a 
resource. You could do a thread dump to see what is happening (I don't 
use Windows so I can't remember how you do that with the Win setup)


In the end, you'll need to profile the system to work out where the 
bottlenecks are. You'll need to use network analysers and probably Java 
profilers to track down what's happening such as when packets are 
received, when the replies are generated and maybe profile what your 
app. is doing.


HTH

Alan Chaney




Gilbert, Antoine wrote:

Hi

 


I have a 2x quad core (8 cpu units) server.

 


If I start a java program and this one is launching (at the same time) 8
thread doing some CPU intensive jobs, all the CPU are used at 100%, and
that's what I'm expecting..

 


But, if I am using tomcat, and I call a servlet 8 times to process these
8 jobs, it take longer to execute these same 8 jobs and all the CPU are
not used at 100%, it's more like 30%...

 


Any idea about this problem or behavior ? I'm using Tomcat 5.5.17,
windows, JDK 1.6

 


Antoine



!DSPAM:481e1bf27941527717022!



-
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 problem on a multiple CPU system

2008-05-04 Thread Yuval Perlov

Perhaps you have some contention between the threads or intensive IO.


Can you elaborate a little about the servlet job? Time it takes, kind  
of processing it does, etc.


Yuval Perlov
R-U-ON


On May 4, 2008, at 11:21 PM, Gilbert, Antoine wrote:

Hi



I have a 2x quad core (8 cpu units) server.



If I start a java program and this one is launching (at the same time) 8
thread doing some CPU intensive jobs, all the CPU are used at 100%, and
that's what I'm expecting..



But, if I am using tomcat, and I call a servlet 8 times to process these
8 jobs, it take longer to execute these same 8 jobs and all the CPU are
not used at 100%, it's more like 30%...



Any idea about this problem or behavior ? I'm using Tomcat 5.5.17,
windows, JDK 1.6



Antoine



-
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: unable to read complete POST body via tomcat connector

2008-05-04 Thread John . C . Cartwright

Thanks for your reply Mark and sorry I didn't include more specifics the
first time.

Tomcat version 5.5.15
mod_jk 1.2.8
Apache 2.0.46
mod_jk-ap20-1.2.8
Java 1.5.0_06

Small files read completely, large files read different amounts
depending of the file.  I can't find  pattern in how much gets read -
examples:
POST body contained 630973 characters
read 313177 characters from POST body

POST body contained 21827 characters
read 13611 characters from POST body

POST body contained 67794 characters
read 37640 characters from POST body

--john

- Original Message -
From: Mark Thomas <[EMAIL PROTECTED]>
Date: Sunday, May 4, 2008 2:17 am
Subject: Re: unable to read complete POST body via tomcat connector

> [EMAIL PROTECTED] wrote:
> > Hello All,
> > 
> > I'm trying to POST a relatively small amount of content (22K) and 
> find> that when the request comes via apache/mod_jk, I can only 
> read part of
> > the body.  The same request to standalone tomcat (HTTP connector) 
> works> file.  I'm reading the POST body with code like:
> > 
> > BufferedReader reader = request.getReader();
> > String inputLine;
> > while ((inputLine = reader.readLine()) != null) {
> >sb.append(inputLine);
> > }
> > 
> > Can anyone suggest what might be wrong?
> 
> Tomcat version? mod_jk version? httpd version? jvm version?
> Which part of the body can you read? How much data can you read? Is 
> it 
> always the same or does it vary by request?
> 
> 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]
> 
> 

-
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: unable to read complete POST body via tomcat connector

2008-05-04 Thread John . C . Cartwright
Thanks for your reply Ben. No, there's no SSL involved.

--john


- Original Message -
From: Ben Stringer <[EMAIL PROTECTED]>
Date: Sunday, May 4, 2008 0:50 am
Subject: Re: unable to read complete POST body via tomcat connector

> On Sun, 2008-05-04 at 00:41 -0600, [EMAIL PROTECTED] wrote:
> > Hello All,
> > 
> > I'm trying to POST a relatively small amount of content (22K) and 
> find> that when the request comes via apache/mod_jk, I can only 
> read part of
> > the body.  The same request to standalone tomcat (HTTP connector) 
> works> file.  I'm reading the POST body with code like:
> > 
> > BufferedReader reader = request.getReader();
> > String inputLine;
> > while ((inputLine = reader.readLine()) != null) {
> >sb.append(inputLine);
> > }
> > 
> > Can anyone suggest what might be wrong?
> 
> Is there SSL anywhere in your setup?
> 
> Can't see why this would not be working - you may want to try tweaking
> the max_packet_size in workers.properties and packetSize on the Tomcat
> connector, details here:
> 
> http://tomcat.apache.org/connectors-doc/reference/workers.html
> 
> Cheers, Ben
> 
> 
> 
> 
> -
> 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 problem on a multiple CPU system

2008-05-04 Thread Gilbert, Antoine
Well, each process is a image rendering process.

But my point is, if I launch 8 threads directly in a JVM outside of
tomcat, it run faster and use 100% of the 8 CPU...

If I make a Servlet (or a JSP) who will start a process each time I call
it (I call it 8 times). 

So, the big question is, why It's fast directly on the JVM and it's slow
on Tomcat ? Why with Tomcat It's not possible to use 100% of all the 8
CPU ? There is no data transfer between client and server, in both case
the images are rendered on the disk.

I just made this rendering test to expose the fact that I'm unable to
make my tomcat use efficiently all my CPU.

So the big question, why these 8 processes run betters than these 8
process within Tomcat ?



-Original Message-
From: Alan Chaney [mailto:[EMAIL PROTECTED] 
Sent: 4 mai 2008 17:33
To: Tomcat Users List
Subject: Re: Tomcat problem on a multiple CPU system

Hi Antoine

The thing to remember is that this is a system which has (at least) four

main parts:

1. Tomcat
2. The operating system
3. A network connection
4. Your application

(and potentially)

5. A database (but you didn't mention that)

Here are some questions.

1. How do you make the connection to the servlet. Does the browser run 
on the same machine as the application?

2. Does you application create network traffic? If so, how many bytes 
are transferred to the browser? Each servlet thread will have to wait 
until the application has transferred all the data out.

3. What kind of disk activity does your application generate? Is it 
different when the app is running from the servlet?

Probably somewhere your servlet threads are sleeping waiting for a 
resource. You could do a thread dump to see what is happening (I don't 
use Windows so I can't remember how you do that with the Win setup)

In the end, you'll need to profile the system to work out where the 
bottlenecks are. You'll need to use network analysers and probably Java 
profilers to track down what's happening such as when packets are 
received, when the replies are generated and maybe profile what your 
app. is doing.

HTH

Alan Chaney




Gilbert, Antoine wrote:
> Hi
> 
>  
> 
> I have a 2x quad core (8 cpu units) server.
> 
>  
> 
> If I start a java program and this one is launching (at the same time)
8
> thread doing some CPU intensive jobs, all the CPU are used at 100%,
and
> that's what I'm expecting..
> 
>  
> 
> But, if I am using tomcat, and I call a servlet 8 times to process
these
> 8 jobs, it take longer to execute these same 8 jobs and all the CPU
are
> not used at 100%, it's more like 30%...
> 
>  
> 
> Any idea about this problem or behavior ? I'm using Tomcat 5.5.17,
> windows, JDK 1.6
> 
>  
> 
> Antoine
> 
> 
> 
> !DSPAM:481e1bf27941527717022!
> 

-
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 problem on a multiple CPU system

2008-05-04 Thread Gilbert, Antoine
My english is not very good, I'll try to explain again

For example, my test outside of Tomcat

  for(int i=0;i<8;i++){
  Thread t = new Thread(new Runner());
  t.setDaemon(true);
  t.start();
if(i==7)
  t.join();
  }

My Runner class do some image rendering test...

If I run this directly using Java.exe all is fine, 100% of the 8 CPU are
used and it run fast..

If I create a JSP and put the Runner code in it, I open 8 browser
windows to launch 8 process via Tomcat, it run slow and it's using like
30% of all CPU...

My rendering process read a small geometry file on disk and render it in
an Image Buffer, it's not IO intense, just pure CPU processing, no
database connection, no network usage, and anyway, whatever this process
do, I can run 8 of them using Java.exe and make them using the 8 CPU,
but with Tomcat this is not working very well...

Antoine


-Original Message-
From: Gilbert, Antoine 
Sent: 4 mai 2008 20:20
To: Tomcat Users List
Subject: RE: Tomcat problem on a multiple CPU system

Well, each process is a image rendering process.

But my point is, if I launch 8 threads directly in a JVM outside of
tomcat, it run faster and use 100% of the 8 CPU...

If I make a Servlet (or a JSP) who will start a process each time I call
it (I call it 8 times). 

So, the big question is, why It's fast directly on the JVM and it's slow
on Tomcat ? Why with Tomcat It's not possible to use 100% of all the 8
CPU ? There is no data transfer between client and server, in both case
the images are rendered on the disk.

I just made this rendering test to expose the fact that I'm unable to
make my tomcat use efficiently all my CPU.

So the big question, why these 8 processes run betters than these 8
process within Tomcat ?



-Original Message-
From: Alan Chaney [mailto:[EMAIL PROTECTED] 
Sent: 4 mai 2008 17:33
To: Tomcat Users List
Subject: Re: Tomcat problem on a multiple CPU system

Hi Antoine

The thing to remember is that this is a system which has (at least) four

main parts:

1. Tomcat
2. The operating system
3. A network connection
4. Your application

(and potentially)

5. A database (but you didn't mention that)

Here are some questions.

1. How do you make the connection to the servlet. Does the browser run 
on the same machine as the application?

2. Does you application create network traffic? If so, how many bytes 
are transferred to the browser? Each servlet thread will have to wait 
until the application has transferred all the data out.

3. What kind of disk activity does your application generate? Is it 
different when the app is running from the servlet?

Probably somewhere your servlet threads are sleeping waiting for a 
resource. You could do a thread dump to see what is happening (I don't 
use Windows so I can't remember how you do that with the Win setup)

In the end, you'll need to profile the system to work out where the 
bottlenecks are. You'll need to use network analysers and probably Java 
profilers to track down what's happening such as when packets are 
received, when the replies are generated and maybe profile what your 
app. is doing.

HTH

Alan Chaney




Gilbert, Antoine wrote:
> Hi
> 
>  
> 
> I have a 2x quad core (8 cpu units) server.
> 
>  
> 
> If I start a java program and this one is launching (at the same time)
8
> thread doing some CPU intensive jobs, all the CPU are used at 100%,
and
> that's what I'm expecting..
> 
>  
> 
> But, if I am using tomcat, and I call a servlet 8 times to process
these
> 8 jobs, it take longer to execute these same 8 jobs and all the CPU
are
> not used at 100%, it's more like 30%...
> 
>  
> 
> Any idea about this problem or behavior ? I'm using Tomcat 5.5.17,
> windows, JDK 1.6
> 
>  
> 
> Antoine
> 
> 
> 
> !DSPAM:481e1bf27941527717022!
> 

-
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: JkSetEnv and Servlet Filters

2008-05-04 Thread Keith Ealanta

Rainer Jung wrote:

Keith Ealanta schrieb:
public void doFilter(ServletRequest servletRequest, ServletResponse 
servletResponse, FilterChain filterChain) throws IOException, 
ServletException {

   log.debug("\nAttributes ... begin.\n");
   Enumeration attributeNames = servletRequest.getAttributeNames();
   while(attributeNames.hasMoreElements()) {
 String attributeName = (String) attributeNames.nextElement();
 log.debug(attributeName + " " + 
servletRequest.getAttribute(attributeName));

   }
   log.debug("\nAttributes ... end.\n");
etc.
}


Aha! This unfortunately doesn't work. The attributes coming in via the 
AJP protocol can be retrieved via request.getAttribute(), but are not 
(!) shown in getAttributeNames().

Bingo.
Thank-you.  That fixed it.
Do you know if this is for some good and clever reason?  If it is we 
should probably note this limitation in the doco.  If it's not, then 
should I raise it as a bug on tomcat?


Regards (and further thanks)

Keith



-
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 problem on a multiple CPU system

2008-05-04 Thread David Smith
Can you describe how you open the 8 browser windows and what browser you 
are using?  I ask because those 8 browser windows may be coming from one 
process and using at most 2 connections, hence the slower processing.  
Firefox normally only has one process no matter how you open the new 
windows.  IE can be 8 separate processes if you launch each separately 
from Explorer (ie the Start button or desktop shortcut) and not use the 
new window menu option or ctrl-n.


--David

Gilbert, Antoine wrote:

Well, each process is a image rendering process.

But my point is, if I launch 8 threads directly in a JVM outside of
tomcat, it run faster and use 100% of the 8 CPU...

If I make a Servlet (or a JSP) who will start a process each time I call
it (I call it 8 times). 


So, the big question is, why It's fast directly on the JVM and it's slow
on Tomcat ? Why with Tomcat It's not possible to use 100% of all the 8
CPU ? There is no data transfer between client and server, in both case
the images are rendered on the disk.

I just made this rendering test to expose the fact that I'm unable to
make my tomcat use efficiently all my CPU.

So the big question, why these 8 processes run betters than these 8
process within Tomcat ?



-Original Message-
From: Alan Chaney [mailto:[EMAIL PROTECTED] 
Sent: 4 mai 2008 17:33

To: Tomcat Users List
Subject: Re: Tomcat problem on a multiple CPU system

Hi Antoine

The thing to remember is that this is a system which has (at least) four

main parts:

1. Tomcat
2. The operating system
3. A network connection
4. Your application

(and potentially)

5. A database (but you didn't mention that)

Here are some questions.

1. How do you make the connection to the servlet. Does the browser run 
on the same machine as the application?


2. Does you application create network traffic? If so, how many bytes 
are transferred to the browser? Each servlet thread will have to wait 
until the application has transferred all the data out.


3. What kind of disk activity does your application generate? Is it 
different when the app is running from the servlet?


Probably somewhere your servlet threads are sleeping waiting for a 
resource. You could do a thread dump to see what is happening (I don't 
use Windows so I can't remember how you do that with the Win setup)


In the end, you'll need to profile the system to work out where the 
bottlenecks are. You'll need to use network analysers and probably Java 
profilers to track down what's happening such as when packets are 
received, when the replies are generated and maybe profile what your 
app. is doing.


HTH

Alan Chaney




Gilbert, Antoine wrote:
  

Hi

 


I have a 2x quad core (8 cpu units) server.

 


If I start a java program and this one is launching (at the same time)


8
  

thread doing some CPU intensive jobs, all the CPU are used at 100%,


and
  

that's what I'm expecting..

 


But, if I am using tomcat, and I call a servlet 8 times to process


these
  

8 jobs, it take longer to execute these same 8 jobs and all the CPU


are
  

not used at 100%, it's more like 30%...

 


Any idea about this problem or behavior ? I'm using Tomcat 5.5.17,
windows, JDK 1.6

 


Antoine



!DSPAM:481e1bf27941527717022!




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

  



--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940


-
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 reload web app from java program?

2008-05-04 Thread Costin Manolache
On Sun, May 4, 2008 at 1:09 PM, <[EMAIL PROTECTED]> wrote:

> > David Smith wrote:
> >> But to use the api that the manager app uses, your webapp needs to have
> >> privileged="true" set in the context first.  Second, look at the source
> >> for the manager webapp for exactly what it does.  And lastly, notice
> the
> >> manager webapp can't reload itself -- I suspect there's a reason for
> >> that.
> >> I'm not sure a webapp being reloaded can request the manager reload it
> >> as the manager does it during the request and doesn't send a response
> >> until the reload is complete.  If you have code that can't unload
> >> because it's actively being executed, it might block the reload.
> >
> > If you have autoDeploy set to true on the host, one quick and dirty hack
> > around this would be to touch the web.xml file. It has the advantage of
> > de-coupling the reload of the webapp from the request you use to trigger
> > it. On the down side, it requires you to be using unpacked web apps and
> > the
> > reload won't be instant.
> >
> > Mark
>
> Thanks Mark,
> I also came to this idea but I wanted to check if there is a cleaner way
> (using some API) to do this. Concerning my specific web app, there is no
> problem related to packing/unpacking and even the delay between touching
> web.xml and reloading is not important (if that happens at least after few
> minutes).
>

The API is JMX - you need to get the mbean server ( findMBeanServer() ),
then invoke 'reload'
on your webapp. The object name as specified by JSR77 ( I think) looks like:

default:j2eeType=WebModule,name=//localhost/examples,J2EEApplication=none,J2EEServer=none


Costin



> Milos
>
> >
> > -
> > 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: JkSetEnv and Servlet Filters

2008-05-04 Thread Rainer Jung

Keith Ealanta wrote:

Rainer Jung wrote:

Keith Ealanta schrieb:
public void doFilter(ServletRequest servletRequest, ServletResponse 
servletResponse, FilterChain filterChain) throws IOException, 
ServletException {

   log.debug("\nAttributes ... begin.\n");
   Enumeration attributeNames = servletRequest.getAttributeNames();
   while(attributeNames.hasMoreElements()) {
 String attributeName = (String) attributeNames.nextElement();
 log.debug(attributeName + " " + 
servletRequest.getAttribute(attributeName));

   }
   log.debug("\nAttributes ... end.\n");
etc.
}


Aha! This unfortunately doesn't work. The attributes coming in via the 
AJP protocol can be retrieved via request.getAttribute(), but are not 
(!) shown in getAttributeNames().

Bingo.
Thank-you.  That fixed it.
Do you know if this is for some good and clever reason?  If it is we 
should probably note this limitation in the doco.  If it's not, then 
should I raise it as a bug on tomcat?


I'll add a note to the JkSetEnvVar docs, but you should raise a TC bug 
in bugzilla, so we can discuss. At least for me it is violating the 
spec. I assume there's no clever reason for it, but the handling of the 
request attributes in the AJP case is somewhat delicate.



Regards (and further thanks)

Keith


Regards,

Rainer

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