Re: standardize the URL

2010-04-21 Thread banto



Gregor Schneider wrote:
> 
> On Tue, Apr 20, 2010 at 12:54 PM, banto  wrote:
>>
>> Hi,
>>
>> i know this can be a silly question but i have the following issue:
>>
>> i want to call my web app with a standard URL as
>> http://host:port/myString
>>
> 
> how does the url look like when you call your webb-app currently?
> 
> how would you like the url to look like?
> 
> rgds
> 
> gregor
> -- 
> just because you're paranoid, don't mean they're not after you...
> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
> gpgp-key available
> @ http://pgpkeys.pca.dfn.de:11371
> @ http://pgp.mit.edu:11371/
> skype:rc46fi
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 


I explain better my problem,

my webapp is in the folder:

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\istanceVar

and i call it with

http://localhost:8080/instanceVar/instance

what i would like to do (also for others webapps) is to call it/them as

http://localhost:8080/instance
http://localhost:8080/webapp_2
http://localhost:8080/webapp_3
...

or better

http://localhost/instance
http://localhost/webapp_2
http://localhost/webapp_3
...

how can i get the 2 modes?

i hope it is clearer now

thanks.
-- 
View this message in context: 
http://old.nabble.com/standardize-the-URL-tp28287836p28324762.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: a servlet-related Java question

2010-04-21 Thread Bill Barker



"Christopher Schultz"  wrote in message 
news:4bcf5f41.6060...@christopherschultz.net...

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 4/21/2010 3:46 PM, André Warnier wrote:

Mark Thomas wrote:

On 21/04/2010 20:24, André Warnier wrote:

Mark Thomas wrote:
...


I'd just use JAD and decompile it.


Thanks.  But although my intentions are not obnoxious nor illegal nor
anything of the kind, I would not want to even come under suspicion of
reverse-engineering.  So is there something that just lists the 
standard

calls/methods used in it ?


No. You can see the methods it exposes, but not the methods it uses.
Time to add some  debug code to your wrapper to see what is being 
called?



Mmmm. :-(
How do I do that, assuming I do not know in advance which methods it
calls ?
Do I need to define all the methods of HttpServletRequest in my wrapper,
just to make them trace their call ?
Or does there exist some more dummy-user-friendly methodology ?


It's pretty inaccessible for novice Java programmers, but you could use
the "proxy" API which is jsut about the coolest thing available in Java 
IMO.


This is how you do the wrapping of the request:

import java.lang.reflect.Proxy;
import java.lang.reflect.InvocationHandler;

public class RequestMethodCallLogger
 implements InvocationHandler, Filter
{
 public void doFilter(...) {
   HttpServletRequest wrappedRequest
= Proxy.newProxyInstance(HttpServletRequest.class.getClassLoader(),
 new Class[] { HttpServletRequest.class },
 this);

   chain.doFilter(wrappedRequest, response);
 }

 public Object invoke(Object proxy, Method method, Object[] args)
 {
   // Log to your favorite logger here

   return method.invoke(proxy, args);
 }
}

Basically, the Proxy class allows you to intercept the calls to
interface methods. The implementation of the "invoke" method is just a
pass-through to the "real" method after logging (an exercise left for
the reader).

This can be optimized a bit if you need to use it long-term, but the
above is about as compact as it gets.



If it does a forward or include done the line, this won't work with any 
remotely recent version of Tomcat.  These versions enforce the spec 
requirement that the Request has to be a subclass of HttpServletWrapper 
wrapping the original request, or the original request.



I'd still recommend the use of jad, honestly.

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

iEYEARECAAYFAkvPX0EACgkQ9CaO5/Lv0PCKVQCdG5SMXiySnsFEowVF7/44KM8s
b7kAoIAGSzxOIWmKt4+z6ATkqslTl5uW
=ykwF
-END PGP SIGNATURE-  




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



Re: [Tomcat 7-RC1] JNDI Startup Issue

2010-04-21 Thread Konstantin Kolinko
2010/4/22 alvins :
>
> Any thoughts on this?
>

I would like to see the Tomcat part of the exception that you are observing.
That is, at what point in application lifecycle the initialization is performed.

If you can attach a sample application to
https://issues.apache.org/bugzilla/show_bug.cgi?id=49132
that would be nice. It would be a bit easier if it would be a simple one.

Best regards,
Konstantin Kolinko

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



Re: Can't login to Tomcat manager pages

2010-04-21 Thread Konstantin Kolinko
2010/4/21 Luís de Sousa :
> Dear all,
>
> Tomcat 6.0.20 on Ubuntu 9.10. I can't login to the manager pages
> (http://localhost:8080/manager/html). I set a new user and a few roles
> in the /etc/tomcat6/tomcat-users.xml file, restarted Tomcat but can't
> possibly login.
>

> /etc/tomcat6/tomcat-users.xml

I do not have Ubuntu to reproduce it, but it is possible that that
file is not the one that is actually used.  The file that is used in
the default configuration is ${catalina.base}/conf/tomcat-users.xml
-- you can see how "org.apache.catalina.UserDatabase" resource is
declared in server.xml.

The contents of the file looks OK for me, and you said that you did
not forget to restart Tomcat.  Maybe there are some error messages in
the logs?

Best regards,
Konstantin Kolinko

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



Re: virtual host configuration

2010-04-21 Thread Konstantin Kolinko
2010/4/22 daulat khan :
> Hi,
>
> I am planning to setup virtual hosting in apache-tomcat integrated
> setup. Please share useful links or docs which will help me in
> accomplishing this.
>
> also  using,
>
> httpd v2.2.14
> tomcat v6.0.20
> tomcat connector v1.2.28
>

http://localhost:8080/docs/virtual-hosting-howto.html

Best regards,
Konstantin Kolinko

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



virtual host configuration

2010-04-21 Thread daulat khan
Hi,

I am planning to setup virtual hosting in apache-tomcat integrated
setup. Please share useful links or docs which will help me in
accomplishing this.



also  using,

httpd v2.2.14
tomcat v6.0.20
tomcat connector v1.2.28


Thanks,
Daulatkhan

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



Re: [Tomcat 7-RC1] JNDI Startup Issue

2010-04-21 Thread alvins

Any thoughts on this?


alvins wrote:
> 
> 
> markt-2 wrote:
>> 
>> Define "during startup". What exactly are you doing?
>> 
> ...
> 

-- 
View this message in context: 
http://old.nabble.com/-Tomcat-7-RC1--JNDI-Startup-Issue-tp28279732p28322682.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



JAXB 2 and JAXB 1 in the WEB-INF/lib folder

2010-04-21 Thread Alex

Hi there,

I'm running a tomcat 6, spring, apache cxf webservice, know it is a must to
add one third party library to my webapp to fulfill an order.

I have jaxb-impl-2.1.12.jar for apache cxf in WEB-INF/lib folder and the 
new

library which contains the JAXB 1.0 runtime.

JAXB 2 ist used by apache cxf for dynamic clients (i need them).

So is there a possibility to run the webapps with both libraries?

Best regards Alex

Caused by: java.lang.LinkageError:
You are trying to run JAXB 2.0 runtime but you have old JAXB 1.0 runtime 
earlier in the classpath.

Please remove the JAXB 1.0 runtime for 2.0 runtime to work correctly.

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



[SECURITY] CVE-2010-1157: Apache Tomcat information disclosure vulnerability

2010-04-21 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

CVE-2010-1157: Apache Tomcat information disclosure vulnerability

Severity: Low

Vendor: The Apache Software Foundation

Versions Affected:
- - Tomcat 6.0.0 to 6.0.26
- - Tomcat 5.5.0 to 5.5.29
Note: The unsupported Tomcat 3.x, 4.x and 5.0.x versions may also be
affected.

Description:
The "WWW-Authenticate" header for BASIC and DIGEST authentication
includes a realm name. If a  element is specified for the
application in web.xml it will be used. However, a  is not
specified then Tomcat will generate one using the code snippet:
request.getServerName() + ":" + request.getServerPort()
In some circumstances this can expose the local hostname or IP address
of the machine running Tomcat.

Example:
GET /application/j_security_check HTTP/1.0


HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
WWW-Authenticate: Basic realm="tomcat01:8080"
Content-Type: text/html;charset=utf-8
Content-Length: 954
Date: Thu, 31 Dec 2009 12:18:11 GMT
Connection: close

Mitigation:
Administrators of web applications that use BASIC or DIGEST
authentication are recommended to set an appropriate realm name in the
web application's web.xml file.
Alternatively, the following patches may be used to change the default
realm to "Authentication required" (without the quotes):
- - Tomcat 6.0.x: http://svn.apache.org/viewvc?view=rev&rev=936540
- - Tomcat 5.5.x: http://svn.apache.org/viewvc?view=rev&rev=936541
These patches will be included in the next releases of Tomcat 5.5.x and
Tomcat 6.0.x. No release date has been set for the next Tomcat 5.5.x and
Tomcat 6.0.x releases.

Credit:
This issue was discovered by Deniz Cevik.

References:
http://tomcat.apache.org/security.html
http://tomcat.apache.org/security-6.html
http://tomcat.apache.org/security-5.html

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

iQIcBAEBAgAGBQJLz3o5AAoJEBDAHFovYFnn7NgP/jyjnqK98FfruhzL0eB/b748
7EYP8k//kbmq8SIYyDkHkmlGfDNE+epxLudgSLbwg8QJdNG50JHwjTzAcclPCyu6
jx3NuJVKxn8KloD3rmxhrIItLG/yQ50JP3tnNO3xC4pS4j8dzdrTS2lFPXxcna6e
o9rMUwPLTEsLvNhd93sUIpdXuLhG9TP7dOeAD737ybvmRcz612igGyyT3hVUeGsK
TvJ+uzZTLJi+Wz0UMRdseqsgp1OW2DeMyao67bPaUrbX9EfLA+yUfXV6TRByT4C5
S5BB3mTz8WBgWkscCmKB0mqmtiPfv7PxlRDfMyPAkFhezPAnL5UD4fSZ3Aes8rTO
IF6CM/lWXm+eMECVwuIh7RdiPJtpe/1ZTQ2EtAQ/JZOIoDX2sKNF92opGeNiZPp9
P78tfksI23tLNJeDcJmL1a2L1yP8pcvAnd6AhYwZPc+LoZBKOsqEMMDU9CmbT3LY
2Fyn8h5yV9Fql9TR9J87aB9BDcQ5vqtdJ17qO20ur54SockI/oNi45tpDf76sJQB
0iOVY1MDu9J4c3xvtmWrdsAZF8VFDhW8nXdKOATh2cVQg/P4aELW2eyGUbiL5hLZ
EWgiZRQWm815MqEwikbztMON4OipensBx1wNuKvj2VKs3VK8tkSuXigViOCTYo+c
mm73gFAt6VWTF5sbfTuA
=mtgX
-END PGP SIGNATURE-



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



Re: a servlet-related Java question

2010-04-21 Thread André Warnier

Mark, Chris and Kris, thanks.
You have all impressed the hell out of me.
You have also lost me.. at a guess about 50 lines ago.
But I get the idea, and it is nice to learn that such things exist.
I also believe this may be helpful to someone else some day looking for 
a solution to a case much more complicated than mine.
As for me, I think I will use the little grey cells and some additional 
circumstancial knowledge to try to figure out what the supplier /may/ 
have logically changed to that servlet, to restrict the number of 
methods to implement and log in my filter, to a reasonable "try first" 
list.  If that fails, I'll have a go at your proxy method, which looks 
really cool.
(Kind of reminds me of the Perl AUTOLOAD method, which does basically 
the same thing.)




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



RE: Logging Anomaly

2010-04-21 Thread George Sexton
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Wednesday, April 21, 2010 2:31 PM
> To: Tomcat Users List
> Subject: Re: Logging Anomaly
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> George,
> 
> On 4/20/2010 7:20 PM, George Sexton wrote:
> > I'm using the access log valve and I noticed that in the logs the
> > uncompressed file size is logged for requests.
> 
> I would consider this to be a bug, though Tomcat may be mimicking
> Apache
> httpd behavior.

I know from experience that Apache httpd does report the compressed size.

> 
> On the other hand, the AccessLogValve is probably executed without any
> knowledge of the compression in use, and might not be able to actually
> detect it without a lot of work. While this might technically be a bug,
> it may not be something anyone is willing to fix.

Well, the first step is to get agreement that it's a problem :). After that's 
done, look to see how difficult it is to fix.

I know the best way to get a problem fixed is to fix it yourself and submit the 
patch. A patch that I did made it into 5.5.29. When I get a chance, I want to 
try making startup multi-threaded. I'm running over 300 hosts per server and 
startup times are getting big. When I'm trying to do that I'll look at the 
logging. Maybe it will be easy...



> 
> - -chris

George Sexton
MH Software, Inc.
303 438-9585
www.mhsoftware.com



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



Re: a servlet-related Java question

2010-04-21 Thread Kris Schneider
On Wed, Apr 21, 2010 at 4:25 PM, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> André,
>
> On 4/21/2010 3:46 PM, André Warnier wrote:
>> Mark Thomas wrote:
>>> On 21/04/2010 20:24, André Warnier wrote:
 Mark Thomas wrote:
 ...

> I'd just use JAD and decompile it.
>
 Thanks.  But although my intentions are not obnoxious nor illegal nor
 anything of the kind, I would not want to even come under suspicion of
 reverse-engineering.  So is there something that just lists the standard
 calls/methods used in it ?
>>>
>>> No. You can see the methods it exposes, but not the methods it uses.
>>> Time to add some  debug code to your wrapper to see what is being called?
>>>
>> Mmmm. :-(
>> How do I do that, assuming I do not know in advance which methods it
>> calls ?
>> Do I need to define all the methods of HttpServletRequest in my wrapper,
>> just to make them trace their call ?
>> Or does there exist some more dummy-user-friendly methodology ?
>
> It's pretty inaccessible for novice Java programmers, but you could use
> the "proxy" API which is jsut about the coolest thing available in Java IMO.
>
> This is how you do the wrapping of the request:

Not to potentially muddy the waters, but I think your
InvocationHandler is invoking the method on the wrong object - it
shouldn't invoke it on the proxy but on the original request. So,
something like this:

public void doFilter(final ServletRequest request, ServletResponse
response, FilterChain chain) throws IOException, ServletException {

InvocationHandler handler = new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[]
args) throws Throwable {
// log some stuff
return method.invoke(request, args);
}
};

HttpServletRequest proxyRequest =
(HttpServletRequest)Proxy.newProxyInstance(HttpServletRequest.class.getClassLoader(),
new Class[] { HttpServletRequest.class }, handler);

chain.doFilter(proxyRequest, response);
}

> import java.lang.reflect.Proxy;
> import java.lang.reflect.InvocationHandler;
>
> public class RequestMethodCallLogger
>  implements InvocationHandler, Filter
> {
>  public void doFilter(...) {
>    HttpServletRequest wrappedRequest
>     = Proxy.newProxyInstance(HttpServletRequest.class.getClassLoader(),
>                              new Class[] { HttpServletRequest.class },
>                              this);
>
>    chain.doFilter(wrappedRequest, response);
>  }
>
>  public Object invoke(Object proxy, Method method, Object[] args)
>  {
>    // Log to your favorite logger here
>
>    return method.invoke(proxy, args);
>  }
> }
>
> Basically, the Proxy class allows you to intercept the calls to
> interface methods. The implementation of the "invoke" method is just a
> pass-through to the "real" method after logging (an exercise left for
> the reader).
>
> This can be optimized a bit if you need to use it long-term, but the
> above is about as compact as it gets.
>
> I'd still recommend the use of jad, honestly.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkvPX0EACgkQ9CaO5/Lv0PCKVQCdG5SMXiySnsFEowVF7/44KM8s
> b7kAoIAGSzxOIWmKt4+z6ATkqslTl5uW
> =ykwF
> -END PGP SIGNATURE-

-- 
Kris Schneider

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



Re: Installing auto updates for my webapp hosted on Tomcat

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Anand,

On 4/20/2010 7:26 PM, Anand HS wrote:
> 1. A simple agent ( can be a java program inside my web app itself ) senses
> there is an update.
> 2. when an update is available, it stops the tomcat server.

Step 1: Firmly grab the rug under your feet
Step 2: Pull quickly
Step 3: ???
Step 4: Profit

> 3. Applies the update ( similar to redeploy along with configuration file
> changes ) .
> 4. restarts the tomcat.

I agree with Pid: update the webapp, but don't restart Tomcat.
Restarting Tomcat might be difficult if the updating software is
actually running within Tomcat.

> I need advice from the community on other approaches as well as any support
> tomcat provides out of the box.

Tomcat will not help you at all, except for some of the utilities it may
provide to help you re-deploy a webapp (such as the deployer ant task,
or the manager app itself).

First, I would provide two apps to your customers: the first is the
actual webapp itself, and then provide a second app to check for
updates. There's no requirement that the updater be a webapp, nor that
it even be written in Java.

One of the first questions you need to ask yourself is what is involved
in an update? Typically, code updates can be done either with patches
(or, at least, new copies of only the files that have changed) or with a
completely new WAR file. Which do you prefer? The former will likely
result in quicker update times, but will be more difficult to implement.

What about data storage changes? Does your webapp know how to startup
and make whatever changes are necessary in order to ensure a sane
environment for itself? Many PHP-based webapps are like this (Bugzilla,
Wordpress, etc.) but I've never seen a Java webapp do it. Maybe I just
don't deal with too many webapps that I haven't written myself :) If
your webapp isn't this smart, you'll either have to make it smart, or
implement this data storage upgrade as part of your "updater" app.

Next, you have to think about how automated this should be: is it okay
to bounce a customer's Tomcat in the middle of the day? You might want
to have some options for scheduling these update checks and scheduling
the actual updates themselves.

Finally, once you've figured out how to update your data and your code,
it's trivial to build a new WAR file (or exploded WAR directory
structure) and have Tomcat redeploy it: you'll need to have the
"manager" app installed. The manager can be used to deploy, undeploy, or
redeploy any webapp using simple HTTP GET requests.

See the documentation for the manager app on the TC site for more
information.

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

iEYEARECAAYFAkvPYqEACgkQ9CaO5/Lv0PCoCgCfch6PnbF+KtE9/veFgoeIN+Ri
GU8An3HJjEmkAj+Kb3Ot/4LUMuftJraQ
=/4Ql
-END PGP SIGNATURE-

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



Re: Logging Anomaly

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

George,

On 4/20/2010 7:20 PM, George Sexton wrote:
> I'm using the access log valve and I noticed that in the logs the
> uncompressed file size is logged for requests.

I would consider this to be a bug, though Tomcat may be mimicking Apache
httpd behavior.

On the other hand, the AccessLogValve is probably executed without any
knowledge of the compression in use, and might not be able to actually
detect it without a lot of work. While this might technically be a bug,
it may not be something anyone is willing to fix.

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

iEYEARECAAYFAkvPYHAACgkQ9CaO5/Lv0PCZYACeMpFYGK+ztxZb7SHHo2e8qLrQ
HpAAn0X5nsaSYHUAzMR0wl0XhGiRbIZz
=md1c
-END PGP SIGNATURE-

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



Re: a servlet-related Java question

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 4/21/2010 3:46 PM, André Warnier wrote:
> Mark Thomas wrote:
>> On 21/04/2010 20:24, André Warnier wrote:
>>> Mark Thomas wrote:
>>> ...
>>>
 I'd just use JAD and decompile it.

>>> Thanks.  But although my intentions are not obnoxious nor illegal nor
>>> anything of the kind, I would not want to even come under suspicion of
>>> reverse-engineering.  So is there something that just lists the standard
>>> calls/methods used in it ?
>>
>> No. You can see the methods it exposes, but not the methods it uses.
>> Time to add some  debug code to your wrapper to see what is being called?
>>
> Mmmm. :-(
> How do I do that, assuming I do not know in advance which methods it
> calls ?
> Do I need to define all the methods of HttpServletRequest in my wrapper,
> just to make them trace their call ?
> Or does there exist some more dummy-user-friendly methodology ?

It's pretty inaccessible for novice Java programmers, but you could use
the "proxy" API which is jsut about the coolest thing available in Java IMO.

This is how you do the wrapping of the request:

import java.lang.reflect.Proxy;
import java.lang.reflect.InvocationHandler;

public class RequestMethodCallLogger
  implements InvocationHandler, Filter
{
  public void doFilter(...) {
HttpServletRequest wrappedRequest
 = Proxy.newProxyInstance(HttpServletRequest.class.getClassLoader(),
  new Class[] { HttpServletRequest.class },
  this);

chain.doFilter(wrappedRequest, response);
  }

  public Object invoke(Object proxy, Method method, Object[] args)
  {
// Log to your favorite logger here

return method.invoke(proxy, args);
  }
}

Basically, the Proxy class allows you to intercept the calls to
interface methods. The implementation of the "invoke" method is just a
pass-through to the "real" method after logging (an exercise left for
the reader).

This can be optimized a bit if you need to use it long-term, but the
above is about as compact as it gets.

I'd still recommend the use of jad, honestly.

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

iEYEARECAAYFAkvPX0EACgkQ9CaO5/Lv0PCKVQCdG5SMXiySnsFEowVF7/44KM8s
b7kAoIAGSzxOIWmKt4+z6ATkqslTl5uW
=ykwF
-END PGP SIGNATURE-

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



Re: OT: Refresh (f5) add(calendar.MONTH, adj) problem

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Søren,

On 4/21/2010 3:39 PM, Søren Blidorf wrote:
> I have a page that changes month by request.getParameter(”adj”).
> 
> How do I avoid add(calendar.MONTH, adj) when refresh(f5) is pressed

How about providing another parameter which indicates the original
value, and the adjustment is relative to that? Refresh wouldn't
interfere with that.

Or, better yet, put the actual value you want in the URL instead of an
adjustment.

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

iEYEARECAAYFAkvPXGYACgkQ9CaO5/Lv0PCV/ACgo09MTkA+2gcW9LleNzz0iQFA
jqAAn3WxVw3vQyctkkNNz8rToO+xyrSv
=kCEI
-END PGP SIGNATURE-

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



Re: a servlet-related Java question

2010-04-21 Thread Mark Thomas
On 21/04/2010 20:46, André Warnier wrote:
> Mark Thomas wrote:
>> On 21/04/2010 20:24, André Warnier wrote:
>>> Mark Thomas wrote:
>>> ...
>>>
 I'd just use JAD and decompile it.

>>> Thanks.  But although my intentions are not obnoxious nor illegal nor
>>> anything of the kind, I would not want to even come under suspicion of
>>> reverse-engineering.  So is there something that just lists the standard
>>> calls/methods used in it ?
>>
>> No. You can see the methods it exposes, but not the methods it uses.
>> Time to add some  debug code to your wrapper to see what is being called?
>>
> Mmmm. :-(
> How do I do that, assuming I do not know in advance which methods it
> calls ?
> Do I need to define all the methods of HttpServletRequest in my wrapper,
> just to make them trace their call ?
Yep.

> Or does there exist some more dummy-user-friendly methodology ?
You could play games with reflection but with IDE code generation just
writing the methods will be quicker.

Mark



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



Re: OT: Refresh (f5) add(calendar.MONTH, adj) problem

2010-04-21 Thread André Warnier

Søren Blidorf wrote:

I have a page that changes month by request.getParameter(”adj”).

 


How do I avoid add(calendar.MONTH, adj) when refresh(f5) is pressed

 


I know its off topic, but does anybody have an idear?

Your question is so unclear that it is not even evident if it is 
off-topic. Can you rephrase that ?


I guess that by "refresh(f5)" you mean that the user, in his browser, 
requests a refresh of the page, and that this causes a new request to 
the server ? If so, then what, on the server, does what to what calendar ?




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



Re: a servlet-related Java question

2010-04-21 Thread André Warnier

Mark Thomas wrote:

On 21/04/2010 20:24, André Warnier wrote:

Mark Thomas wrote:
...


I'd just use JAD and decompile it.


Thanks.  But although my intentions are not obnoxious nor illegal nor
anything of the kind, I would not want to even come under suspicion of
reverse-engineering.  So is there something that just lists the standard
calls/methods used in it ?


No. You can see the methods it exposes, but not the methods it uses.
Time to add some  debug code to your wrapper to see what is being called?


Mmmm. :-(
How do I do that, assuming I do not know in advance which methods it calls ?
Do I need to define all the methods of HttpServletRequest in my wrapper, 
just to make them trace their call ?

Or does there exist some more dummy-user-friendly methodology ?


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



OT: Refresh (f5) add(calendar.MONTH, adj) problem

2010-04-21 Thread Søren Blidorf
I have a page that changes month by request.getParameter(”adj”).

 

How do I avoid add(calendar.MONTH, adj) when refresh(f5) is pressed

 

I know its off topic, but does anybody have an idear?

 

Soren, DK



Re: a servlet-related Java question

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 4/21/2010 3:24 PM, André Warnier wrote:
> Mark Thomas wrote:
> ...
> 
>>
>> I'd just use JAD and decompile it.
>>
> Thanks.  But although my intentions are not obnoxious nor illegal nor
> anything of the kind, I would not want to even come under suspicion of
> reverse-engineering.  So is there something that just lists the standard
> calls/methods used in it ?

Jad can get your the (roughly) original Java source code for the whole
class. You have to figure out what the variable names really should be
(because they are lost during the compilation process and are replaced
by things like String s1, s2, s3, etc.) but you can get a general idea
of what the servlet is doing.

If you just want to see a list of method calls from a particular method,
you can use the standard Java tool "javap" with the "-c" switch which
will disassemble the class (per method, which is nice) and you can just
read the methods that get called.

Presumably, you already know the stack trace of where the error is
thrown, though.

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

iEYEARECAAYFAkvPU8cACgkQ9CaO5/Lv0PD+TgCgtSUqrj/Y04hnHFqaskN15M99
xh8An0LwFdNG3IT60no4lGpV+B0OKyXw
=ojNv
-END PGP SIGNATURE-

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



Re: a servlet-related Java question

2010-04-21 Thread Mark Thomas
On 21/04/2010 20:24, André Warnier wrote:
> Mark Thomas wrote:
> ...
> 
>>
>> I'd just use JAD and decompile it.
>>
> Thanks.  But although my intentions are not obnoxious nor illegal nor
> anything of the kind, I would not want to even come under suspicion of
> reverse-engineering.  So is there something that just lists the standard
> calls/methods used in it ?

No. You can see the methods it exposes, but not the methods it uses.
Time to add some  debug code to your wrapper to see what is being called?

Mark



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



Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 4/21/2010 3:20 PM, André Warnier wrote:
> Mircea LUTIC wrote:
>> Hello Chris,
>>
> I will save Chris one answer :
>>
>> 1. If the filter does not influence the decoding of the GET 
>> parameters why is it called on GET requests? 
> 
> Because the filter may want to, for example, modify or add request
> headers to the request (or response headers). Or it may want to change..
> the parameters, or rather the request's "query string" as a whole (the
> part of the URL after the "?").
> 
> I think what Chris meant, is that the filter does not influence the way
> in which a call like getParameters() works.  The standard
> getParameters() method takes the request URI (as it sees it by the time
> it runs) and parses its query_string part into a table of parameter
> names and values, according to fixed rules which you cannot change.

(Other than setting the URIEncoding attribute on the , of
course.)

> What your filter /could/ do, is to create a "request wrapper object"
> containing the original request.  This request wrapper would for example
> pass an already-modifed request URI to the getParameters() method.
> Or it could re-define the getParmeters() method, to return modified
> parameter values.

This may or may not work the way you expect it to work. I would
recommend lots of testing. :)

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

iEYEARECAAYFAkvPUwoACgkQ9CaO5/Lv0PC6rACeMcZv4wblmJPHT0ojLl54Mm0T
MsMAoKYTIIxlaEL8SV5TaVNGdjFk3Sun
=+uD5
-END PGP SIGNATURE-

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



Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mircea,

On 4/21/2010 2:46 PM, Mircea LUTIC wrote:
>   1. If the filter does not influence the decoding of the GET  parameters 
> why is it called on GET requests? 

Because you have mostly likely configured it to be invoked when a GET
request is processed. Tomcat doesn't have any idea what your filter
does: it just calls it whenever appropriate (where the definition of
"appropriate" is based upon your configuration in web.xml).

>   2. How about http : PUT, HEAD, etc?

It will be called for all HTTP methods unless you configure it to be
called otherwise.

>   3. I did what this page says: 
> http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q8

That's a good start, but it won't solve all your HTTP GET problems
because you simply cannot control what the client does with the
parameter encoding. It's always better to use HTTP POST when sending
non-US-ASCII-encoded text.

> What if I want to build a fully UTF-8 application that will be posted on a 
> web hosting provider where I have no access to server.xml (because this is a 
> common file)?

You'll have to either ask your ISP what URIEncoding they use (and hope
they use UTF-8) or use HTTP POST instead of HTTP GET.

>   4. I didn't sniff the wire - I only had a look at the  URL I send with 
> the javascript alert function.

Sniffing the wire would be a good thing to do: you'll see what the
encoding looks like on the way from the client to the server.

>   5. "Utf8encode" converts Unicode strings to strings of bytes in UTF-8 
> encoding
> (see here: http://www.webtoolkit.info/javascript-utf8.html).
>   6. "escape" (a standard script function) converts characters not 
> acceptable for http (like slashes) 
> to the %XX  notation. 
>   7. Combined escape(Utf8encode("larevoluție"))="larevolu%C8%9Bie"

Okay. Have you confirmed that the server is getting the encoded URL the
way you think it should be encoded?

>   8. POST is not really an acceptable solution because I don't know in 
> advance what the keys of the request will be ("Name" in 
> the example) neither how many they are & POST requires using a html .

Yes, on a web page, POST requires using a . What's wrong with
that? I'm not sure I understand what you mean when you say you don't
know in advance what the keys of the request will be.

> (what I do is build an  
> URL in javascript/emacscript from a structured object returned by 
> showModalDialog then alert(scriptBuiltUrl); 
> window.location=scriptBuiltUrl;
> ).

If you are using javascript to send the data to the server, I would
think that switching from GET to POST would be trivial.

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

iEYEARECAAYFAkvPUiAACgkQ9CaO5/Lv0PCzgACeO2s4vDa1XqpBV31qwsHIxdMU
uGgAnRHx64NOG/7RPky13Pq5ErwA+xiW
=Xc4I
-END PGP SIGNATURE-

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



Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mircea,

On 4/21/2010 2:46 PM, Mircea LUTIC wrote:
>   1. If the filter does not influence the decoding of the GET  parameters 
> why is it called on GET requests? 

Because you have mostly likely configured it to be invoked when a GET
request is processed. Tomcat doesn't have any idea what your filter
does: it just calls it whenever appropriate (where the definition of
"appropriate" is based upon your configuration in web.xml).

>   2. How about http : PUT, HEAD, etc?

It will be called for all HTTP methods unless you configure it to be
called otherwise.

>   3. I did what this page says: 
> http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q8

That's a good start, but it won't solve all your HTTP GET problems
because you simply cannot control what the client does with the
parameter encoding. It's always better to use HTTP POST when sending
non-US-ASCII-encoded text.

> What if I want to build a fully UTF-8 application that will be posted on a 
> web hosting provider where I have no access to server.xml (because this is a 
> common file)?

You'll have to either ask your ISP what URIEncoding they use (and hope
they use UTF-8) or use HTTP POST instead of HTTP GET.

>   4. I didn't sniff the wire - I only had a look at the  URL I send with 
> the javascript alert function.

Sniffing the wire would be a good thing to do: you'll see what the
encoding looks like on the way from the client to the server.

>   5. "Utf8encode" converts Unicode strings to strings of bytes in UTF-8 
> encoding
> (see here: http://www.webtoolkit.info/javascript-utf8.html).
>   6. "escape" (a standard script function) converts characters not 
> acceptable for http (like slashes) 
> to the %XX  notation. 

Okay. Have you confirmed that the server is getting the encoded URL the
way you think it should be encoded?

>   7. Combined escape(Utf8encode("larevoluție"))="larevolu%C8%9Bie"
>   8. POST is not really an acceptable solution because I don't know in 
> advance what the keys of the request will be ("Name" in 
> the example) neither how many they are & POST requires using a html .
> (what I do is build an  
> URL in javascript/emacscript from a structured object returned by 
> showModalDialog then alert(scriptBuiltUrl); 
> window.location=scriptBuiltUrl;
> ). Thank you for your help.
> Mircea
> 
> 
> 
> 
> 
> 
> From: Christopher Schultz 
> To: Tomcat Users List 
> Sent: Wed, 21 April, 2010 18:43:21
> Subject: Re: UTF-8 encoding in Tomcat 6.0
> 
> Mircea,
> 
> On 4/21/2010 6:56 AM, Mircea LUTIC wrote:
>> The filter does get called on my GET request.
> 
> Of course.
> 
>> In my understanding, a filter is the reccomended method of handling
>> UTF-8 for both GET & POST (as well as other methods like HEAD, PUT
>> etc.).
> 
> The filter cannot influence the way that GET parameters are decoded. The
> only way to change that is to set URIEncoding="UTF-8" on your
>  in server.xml.
> 
> Your best bet is to transfer all non-US-ASCII data in request /bodies/
> by using HTTP POST.
> 
> If HTTP POST is not acceptable, please let us know why and perhaps we
> can suggest some alternatives.
> 
> This looks a bit weird to me:
>>
>> window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))
> 
> What does the Utf8encode function do? What does the escape function do?
> 
> Have you tried snooping the HTTP conversation using a browser plug-in
> and/or a line sniffer like Wireshark? What does the data doing over the
> TCP/IP connection look like?
> 
> -chris

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



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

iEYEARECAAYFAkvPUkMACgkQ9CaO5/Lv0PDhHQCgjgtY7redg8MkBOAdw5krikRH
5DAAoKehO35ziv8nxOBtTQBJojpHComd
=Pl8T
-END PGP SIGNATURE-

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



Re: a servlet-related Java question

2010-04-21 Thread André Warnier

Mark Thomas wrote:
...



I'd just use JAD and decompile it.

Thanks.  But although my intentions are not obnoxious nor illegal nor 
anything of the kind, I would not want to even come under suspicion of 
reverse-engineering.  So is there something that just lists the standard 
calls/methods used in it ?


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



Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread André Warnier

Mircea LUTIC wrote:

Hello Chris,


I will save Chris one answer :


	1. If the filter does not influence the decoding of the GET  parameters why is it called on GET requests? 


Because the filter may want to, for example, modify or add request 
headers to the request (or response headers). Or it may want to change.. 
the parameters, or rather the request's "query string" as a whole (the 
part of the URL after the "?").


I think what Chris meant, is that the filter does not influence the way 
in which a call like getParameters() works.  The standard 
getParameters() method takes the request URI (as it sees it by the time 
it runs) and parses its query_string part into a table of parameter 
names and values, according to fixed rules which you cannot change.


What your filter /could/ do, is to create a "request wrapper object" 
containing the original request.  This request wrapper would for example 
pass an already-modifed request URI to the getParameters() method.
Or it could re-define the getParmeters() method, to return modified 
parameter values.


When an application then runs and calls getParameters(), it will get the 
result of the getParameters() of your wrapper object, instead of the 
getParameters() of the original object.
For example, the result would be already-"translated" parameter 
names/values.


(You have to do it this way, because the original HttpServletRequest 
object is immutable, it cannot be modified directly.)



2. How about http : PUT, HEAD, etc?


Same thing.
And same thing for the request body, if any.


There are some additional nuances and details to what I wrote above, but 
I hope that this already helps somewhat.


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



Re: a servlet-related Java question

2010-04-21 Thread Mark Thomas
On 21/04/2010 19:52, André Warnier wrote:
> Hi.
> A while ago, I wrote a servlet filter which has served me well since, to
> wrap a servlet for which I do not have nor can obtain the source code,
> and of which I only generally know what it does.
> Now it seems that with a new version of this servlet, the servlet itself
> crashes when wrapped by my filter, with a
> java.lang.StringIndexOutOfBoundsException.
> 
> My servlet filter, under certain conditions, creates a
> HttpRequestWrapper derived object, which it passes to the servlet
> instead of the original HttpServletRequest object.
> I have a suspicion that the ultimate reason for the servlet crash, is
> that it now calls a method which I have not re-defined in my wrapper,
> which method the previous servlet version did not call (and that it is
> not very defensive about the result it expects to get, but nothing I can
> do about that).
> 
> All this to ask the following : is there some generic java tool which
> allows to examine a compiled .class file, and determine which methods of
> HttpServletRequest it calls ?
> I do not need nor want to decompile the class, just to know what it calls.

I'd just use JAD and decompile it.

Mark



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



a servlet-related Java question

2010-04-21 Thread André Warnier

Hi.
A while ago, I wrote a servlet filter which has served me well since, to 
wrap a servlet for which I do not have nor can obtain the source code, 
and of which I only generally know what it does.
Now it seems that with a new version of this servlet, the servlet itself 
crashes when wrapped by my filter, with a 
java.lang.StringIndexOutOfBoundsException.


My servlet filter, under certain conditions, creates a 
HttpRequestWrapper derived object, which it passes to the servlet 
instead of the original HttpServletRequest object.
I have a suspicion that the ultimate reason for the servlet crash, is 
that it now calls a method which I have not re-defined in my wrapper, 
which method the previous servlet version did not call (and that it is 
not very defensive about the result it expects to get, but nothing I can 
do about that).


All this to ask the following : is there some generic java tool which 
allows to examine a compiled .class file, and determine which methods of 
HttpServletRequest it calls ?

I do not need nor want to decompile the class, just to know what it calls.

Thanks.


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



Re: 5.5.29 APR error messages?

2010-04-21 Thread Mark Thomas
On 21/04/2010 18:46, Jeffrey Janner wrote:
> Guys -
> 
> I just installed 5.5.29 on my 64-bit test box and really enjoyed the
> nice experience.
> 
> However, I had it start up from the default install, no changes and
> noticed the following 4 lines at the top of the catalina.log:
> 
> Apr 21, 2010 11:46:38 AM org.apache.catalina.core.AprLifecycleListener
> init
> 
> INFO: Cannot find message associated with key aprListener.tcnValid
> 
> Apr 21, 2010 11:46:38 AM org.apache.catalina.core.AprLifecycleListener
> init
> 
> INFO: Cannot find message associated with key aprListener.flags
> 
> Are they anything to worry about?  Everything else looked normal.

Minor bugs in porting a fix that just means you don't get the proper
message text. Will be fixed in the next release.

Mark



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



Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Mircea LUTIC
Hello Chris,


1. If the filter does not influence the decoding of the GET  parameters 
why is it called on GET requests? 
2. How about http : PUT, HEAD, etc?
3. I did what this page says: 
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q8
What if I want to build a fully UTF-8 application that will be posted on a web 
hosting provider where I have no access to server.xml (because this is a common 
file)?
4. I didn't sniff the wire - I only had a look at the  URL I send with 
the javascript alert function.

5. "Utf8encode" converts Unicode strings to strings of bytes in UTF-8 
encoding
(see here: http://www.webtoolkit.info/javascript-utf8.html). 
6. "escape" (a standard script function) converts characters not 
acceptable for http (like slashes) 
to the %XX  notation. 
7. Combined escape(Utf8encode("larevoluție"))="larevolu%C8%9Bie"
8. POST is not really an acceptable solution because I don't know in 
advance what the keys of the request will be ("Name" in 
the example) neither how many they are & POST requires using a html .
(what I do is build an  
URL in javascript/emacscript from a structured object returned by 
showModalDialog then alert(scriptBuiltUrl); 
window.location=scriptBuiltUrl;
). Thank you for your help.
Mircea






From: Christopher Schultz 
To: Tomcat Users List 
Sent: Wed, 21 April, 2010 18:43:21
Subject: Re: UTF-8 encoding in Tomcat 6.0

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mircea,

On 4/21/2010 6:56 AM, Mircea LUTIC wrote:
> The filter does get called on my GET request.

Of course.

> In my understanding, a filter is the reccomended method of handling
> UTF-8 for both GET & POST (as well as other methods like HEAD, PUT
> etc.).

The filter cannot influence the way that GET parameters are decoded. The
only way to change that is to set URIEncoding="UTF-8" on your
 in server.xml.

Your best bet is to transfer all non-US-ASCII data in request /bodies/
by using HTTP POST.

If HTTP POST is not acceptable, please let us know why and perhaps we
can suggest some alternatives.

This looks a bit weird to me:
>
> window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))

What does the Utf8encode function do? What does the escape function do?

Have you tried snooping the HTTP conversation using a browser plug-in
and/or a line sniffer like Wireshark? What does the data doing over the
TCP/IP connection look like?

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

iEYEARECAAYFAkvPHRkACgkQ9CaO5/Lv0PDVkgCgu3dZM9mFNYXDjOBATjvJ5MMP
sN4AniN4aNLVnqsiEL7EzkxzVm4wp83F
=MpSC
-END PGP SIGNATURE-

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

5.5.29 APR error messages?

2010-04-21 Thread Jeffrey Janner
Guys -

I just installed 5.5.29 on my 64-bit test box and really enjoyed the
nice experience.

However, I had it start up from the default install, no changes and
noticed the following 4 lines at the top of the catalina.log:

Apr 21, 2010 11:46:38 AM org.apache.catalina.core.AprLifecycleListener
init

INFO: Cannot find message associated with key aprListener.tcnValid

Apr 21, 2010 11:46:38 AM org.apache.catalina.core.AprLifecycleListener
init

INFO: Cannot find message associated with key aprListener.flags

Are they anything to worry about?  Everything else looked normal.

Jeff


***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


RE: Can't login to Tomcat manager pages

2010-04-21 Thread Propes, Barry L
I started having a similar problem yesterday and discovered that somehow my 
web.xml file had been deleted (not sure how), so I replaced it.

Make sure you have that in your manager folder in WEB-INF.

 

-Original Message-
From: Luís de Sousa [mailto:luis.a.de.so...@gmail.com] 
Sent: Wednesday, April 21, 2010 12:15 PM
To: users@tomcat.apache.org
Subject: Can't login to Tomcat manager pages

Dear all,

Tomcat 6.0.20 on Ubuntu 9.10. I can't login to the manager pages 
(http://localhost:8080/manager/html). I set a new user and a few roles in the 
/etc/tomcat6/tomcat-users.xml file, restarted Tomcat but can't possibly login.

I browsed through a number of threads with similar issues but couldn't solve it 
so far. Note that I uncommented the users section in the file, it is reproduced 
below.

Thanks for you time,

Luís

--





  
  
  
  



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


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



Can't login to Tomcat manager pages

2010-04-21 Thread Luís de Sousa
Dear all,

Tomcat 6.0.20 on Ubuntu 9.10. I can't login to the manager pages
(http://localhost:8080/manager/html). I set a new user and a few roles
in the /etc/tomcat6/tomcat-users.xml file, restarted Tomcat but can't
possibly login.

I browsed through a number of threads with similar issues but couldn't
solve it so far. Note that I uncommented the users section in the
file, it is reproduced below.

Thanks for you time,

Luís

--





  
  
  
  



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



Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mircea,

On 4/21/2010 6:56 AM, Mircea LUTIC wrote:
> The filter does get called on my GET request.

Of course.

> In my understanding, a filter is the reccomended method of handling
> UTF-8 for both GET & POST (as well as other methods like HEAD, PUT
> etc.).

The filter cannot influence the way that GET parameters are decoded. The
only way to change that is to set URIEncoding="UTF-8" on your
 in server.xml.

Your best bet is to transfer all non-US-ASCII data in request /bodies/
by using HTTP POST.

If HTTP POST is not acceptable, please let us know why and perhaps we
can suggest some alternatives.

This looks a bit weird to me:
>
> window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))

What does the Utf8encode function do? What does the escape function do?

Have you tried snooping the HTTP conversation using a browser plug-in
and/or a line sniffer like Wireshark? What does the data doing over the
TCP/IP connection look like?

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

iEYEARECAAYFAkvPHRkACgkQ9CaO5/Lv0PDVkgCgu3dZM9mFNYXDjOBATjvJ5MMP
sN4AniN4aNLVnqsiEL7EzkxzVm4wp83F
=MpSC
-END PGP SIGNATURE-

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



Re: tomcat 6.0.26 can't start server - - can't read server.xml

2010-04-21 Thread Peter Crowther
The + in that listing is saying that server.xml.orig has some extra
permissions that server.xml hasn't.

Windows permissions are not the same as Cygwin permissions.  Use Windows
tools to inspect the permissions on both files, and use Windows tools to fix
the permissions on server.xml.  Also, get used to using Windows tools to
create files ;-).

- Peter

On 21 April 2010 15:15, Christoph Kukulies  wrote:

> Has there something changed in the access rights of files tomcat is
> sensitive about under Windows XP or something? I'm using to move around some
> config files using cygwin tools like cp or mv. I have to idea why tomcat
> 6.0.26 suddenly says:
>
> [...]
> This suddenly happened after I mv'ed the original server.xml to
> server.xml.orig and copied back the saved server.xml into the conf
> directory.
>
> C:\Programme\Apache_Group\Tomcat_6.0\conf>ls -l
> insgesamt 96
> drwxrwx---+ 3 Administratoren SYSTEM 0 Apr 21 15:22 Catalina
> -rwx--+ 1 kukuKein9125 Mar  9 17:06 catalina.policy
> -rwx--+ 1 kukuKein3794 Mar  9 17:06 catalina.properties
> -rwx--+ 1 kukuKein1429 Mar  9 17:06 context.xml
> -rwx--+ 1 kukuKein3321 Mar  9 17:06 logging.properties
> -rwx--  1 kukuKein6971 Apr 21 16:03 server.xml
> -rwx--+ 1 kukuKein6764 Mar  9 17:06 server.xml.orig
> -rwx--+ 1 kukuKein1557 Mar  9 17:06 tomcat-users.xml
> -rwx--+ 1 kukuKein   52068 Mar  9 17:06 web.xml
>
> C:\Programme\Apache_Group\Tomcat_6.0\conf>
>
> Any ideas?
>
> --
> Christoph Kukulies
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread Kapil Godara
Hi Andre,

I did as suggested. Tomcat is running fine as service Tomcat1.

I have set CATALINA_HOME=C:\tomcat1 and CATALINA_BASE=C:\tomcat1
(I set the env var from Control Panel -> System Properties ->Advanced ->
Environment Variables -> System variables)

What is the next step for additional instance on different port?

thanks and regards
kapil

On Wed, Apr 21, 2010 at 6:09 PM, André Warnier  wrote:

> Kapil Godara wrote:
>
>> Hi
>>
>> I copied the entire folder Tomcat 6.0 at C:\Program Files\Apache Software
>> Foundation (where tomcat is installed) to Tomcat_instance2 .
>>
> ...
>
> Let's start again, from the beginning.
>
> This has been discussed many times on this forum, but I believe it is worth
> repeating it, because it is probably the source of the confusion.
>
> In the Tomcat website download page, there are several versions :
>
> - one is for Unix/Linux. That is a "complete" version, with all the files
> packed together in one .tar.gz file.  To install it, you unpack these files
> under one new directory for Tomcat, and it creates a set of subdirectories
> conf, bin, etc..
>
> But for Windows, there are *two* versions :
> - one is a "simple" version, named "installer", which is destined for the
> quick and simple installation of a single Tomcat under Windows, to run as a
> Windows Service. This is apparently the one you downloaded and installed.
> This version does not contain /all/ the same files as the one for Unix/Linux
> above, only a subset of them.
>
> - the other one is a "zip" version, which does contain all the same files
> as the Unix/Linux version, and even some additional ones.
> This version /also/ allows you to install Tomcat as a Windows Service, but
> this requires a bit more work.  It also provides all the files necessary to
> install a second instance of Tomcat and run it as a second Windows Service.
> This is the one you should download now.
>
> My recommendation is :
> - remove the first version of Tomcat that you downloaded and installed (the
> .exe version).
> - download the zip version
> - decide on a "main" and "second" directories where you will run your two
> instances of Tomcat.
> I suggest that you pick directory paths that are simple, without spaces in
> the name.  Like "c:\tomcat1" and "c:\tomcat2".  That will save you time and
> problems later.
> - unzip the downloaded Tomcat zip version in the first directory.
> Note for the future that this is now your "CATALINA_HOME" directory.
> - in the directory c:\tomcat1\bin, run the "service.bat" script, to install
> this Tomcat instance as the first Windows Service.  Give it the name
> "Tomcat1".
> For this Tomcat, the "CATALINA_BASE" is also "c:\tomcat1".
>
> When all the above is done and you have a running first Tomcat instance,
> then come back here for additional information on how to run an additional
> instance, using the same CATALINA_HOME, but a separate CATALINA_BASE.
>
>
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


tomcat 6.0.26 can't start server - - can't read server.xml

2010-04-21 Thread Christoph Kukulies
Has there something changed in the access rights of files tomcat is 
sensitive about under Windows XP or something? I'm using to move around 
some config files using cygwin tools like cp or mv. I have to idea why 
tomcat 6.0.26 suddenly says:


21.04.2010 15:54:39 org.apache.catalina.startup.Catalina load
WARNUNG: Can't load server.xml from 
C:\Programme\Apache_Group\Tomcat_6.0\conf\server.xml

21.04.2010 15:54:39 org.apache.catalina.startup.Catalina load
WARNUNG: Can't load server.xml from 
C:\Programme\Apache_Group\Tomcat_6.0\conf\server.xml

21.04.2010 15:54:39 org.apache.catalina.startup.Catalina start
SCHWERWIEGEND: Cannot start server. Server instance is not configured.
21.04.2010 15:59:09 org.apache.catalina.startup.Catalina load
WARNUNG: Can't load server.xml from 
C:\Programme\Apache_Group\Tomcat_6.0\conf\server.xml

21.04.2010 15:59:09 org.apache.catalina.startup.Catalina load
WARNUNG: Can't load server.xml from 
C:\Programme\Apache_Group\Tomcat_6.0\conf\server.xml

21.04.2010 15:59:09 org.apache.catalina.startup.Catalina start
SCHWERWIEGEND: Cannot start server. Server instance is not configured.


This suddenly happened after I mv'ed the original server.xml to 
server.xml.orig and copied back the saved server.xml into the conf 
directory.


C:\Programme\Apache_Group\Tomcat_6.0\conf>ls -l
insgesamt 96
drwxrwx---+ 3 Administratoren SYSTEM 0 Apr 21 15:22 Catalina
-rwx--+ 1 kukuKein9125 Mar  9 17:06 catalina.policy
-rwx--+ 1 kukuKein3794 Mar  9 17:06 catalina.properties
-rwx--+ 1 kukuKein1429 Mar  9 17:06 context.xml
-rwx--+ 1 kukuKein3321 Mar  9 17:06 logging.properties
-rwx--  1 kukuKein6971 Apr 21 16:03 server.xml
-rwx--+ 1 kukuKein6764 Mar  9 17:06 server.xml.orig
-rwx--+ 1 kukuKein1557 Mar  9 17:06 tomcat-users.xml
-rwx--+ 1 kukuKein   52068 Mar  9 17:06 web.xml

C:\Programme\Apache_Group\Tomcat_6.0\conf>

Any ideas?

--
Christoph Kukulies



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



RE: [ANN] Apache Tomcat 5.5.29 released

2010-04-21 Thread Jeffrey Janner
YEA!!!

Oh, and thanks.

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Wednesday, April 21, 2010 6:08 AM
To: anno...@apache.org; annou...@tomcat.apache.org; Tomcat Users List;
Tomcat Developers List
Subject: [ANN] Apache Tomcat 5.5.29 released

The Apache Tomcat Team announces the immediate availability of Apache
Tomcat 5.5.29 stable.

Apache Tomcat 5.5.29 incorporates numerous bug fixes and fixes for four
low severity security vulnerabilities.

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

Please refer to the Tomcat 5 security page for the list of security
fixes in this release:
http://tomcat.apache.org/security-5.html

Downloads:
http://tomcat.apache.org/download-55.cgi

Thank you,
The Apache Tomcat Team




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



***  NOTICE  *
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.


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



IIS ->Tomcat Configuration Question

2010-04-21 Thread Frank Zappa
Hello,

Our group is using IIS as a gateway server to Tomcat. 
(Unfortunately Apache can't be used for this project) 

Our system uses smart cards, so a pki certificate is passed from the browser to 
the gateway server. Does anyone know how to configure IIS to pass the 
user's certificate through IIS to Tomcat?

Thank you kindly!

Hans


  

Re: mod_jk reply_timeout and error state

2010-04-21 Thread Sean GAO
Hi Rainer,

Thanks for your informative and thoughtful reply.

Yes, we are definitely going with CMS. It's a product environment so
we have to be careful with whatever we plan to do. By tweaking
reply_timeout, be it hard or soft, we were actually circumventing the
problem rather than facing it. Which is lame, I know. Anyway, thank
you again for the help and insight.

Regards,
Sean


On Wed, Apr 21, 2010 at 6:27 PM, Rainer Jung  wrote:
> Hi Sean,
>
> On 20.04.2010 08:04, Sean GAO wrote:
>>
>> According to online documentation
>> (http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html):
>> 
>> Long Garbage Collection pauses on the backend do not make a good fit
>> with some timeouts. Try to optimise your Java memory and GC settings.
>> 
>>
>> So if JVM tuning doesn't help, what else could I do? Balancer worker's
>> method=Busyness setting may have some effect, but still this is
>> different. What do you think?
>
> There is no kind of soft reply timeout which would mean a long response time
> indicates we shouldn't send more requests to that Tomcat but should still
> wait for the outstanding responses.
>
> The best you can do is tweaking the timeouts and the GC. Modern CMS GC
> doesn't do stop-the-world, most of it runs concurrently. Yes, after some
> time you might run into an occasional stop-the-world because of
> fragmentation, but they will be much rarer than without CMS.
>
> If your GC stop times are about 30 seconds, then that is not good, but I
> wouldn't reduce a reply_timeout to something much smaller anyhows. You don't
> want to make the error detection very sensible, because then it is not
> unlikely that you end up making your system more unstable than without. You
> wan to detect serious problems and react on them but you shouldn't want to
> react quickly on any indication of possible problems.
>
> What might help you a bit is the ability to define reply_timeout depending
> on the URL of the request. So if you know there are e.g. some reporting URLs
> that you know will take longet than a minute, you could set a general
> reply_timeout to e.g. 30 seconds, and the timeout for the report URLs to
> e.g. 2 minutes.
>
> If you use reply_timeout, never forget to also add a max_reply_timeouts.
>
> Concerning your configuration below, please do als consult
>
> http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html
>
> Regards,
>
> Rainer
>
>> On Tue, Apr 20, 2010 at 12:48 PM, Sean GAO  wrote:
>>>
>>> Hi,
>>>
>>> We are running apache 2.2.4 and tomcat 5.5.28 with mod_jk 1.2.28. 3
>>> tomcat instances.
>>>
>>> Referring to
>>> http://tomcat.apache.org/connectors-doc/reference/workers.html
>>> , we came up with a workers.properties file like this:
>>>
>>> worker.list=balancer
>>> worker.maintain=30
>>> #tomcat01
>>> worker.tomcat01.port=18009
>>> worker.tomcat01.host=localhost
>>> worker.tomcat01.type=ajp13
>>> worker.tomcat01.lbfactor=120
>>> worker.tomcat01.retries=2
>>> worker.tomcat01.socket_timeout=30
>>> worker.tomcat01.reply_timeout=3
>>> worker.tomcat01.recover_time=300
>>> #tomcat02
>>> worker.tomcat02.port=28009
>>> worker.tomcat02.host=localhost
>>> worker.tomcat02.type=ajp13
>>> worker.tomcat02.lbfactor=100
>>> worker.tomcat02.retries=2
>>> worker.tomcat02.socket_timeout=30
>>> worker.tomcat02.reply_timeout=3
>>> worker.tomcat02.recover_time=300
>>> #tomcat03
>>> worker.tomcat03.port=38009
>>> worker.tomcat03.host=localhost
>>> worker.tomcat03.type=ajp13
>>> worker.tomcat03.lbfactor=0
>>> worker.tomcat03.retries=2
>>> #loadbalancer
>>> worker.retries=2
>>> worker.balancer.type=lb
>>> worker.balancer.sticky_session=False
>>> worker.balancer.method=Busyness
>>> worker.balancer.balance_workers=tomcat01,tomcat02,tomcat03
>>>
>>> So basically tomcat01 and tomcat02 are the main request handlers, with
>>> tomcat03 acting as a backup server which is accessed only when both
>>> tomcat01 and tomcat02 are in error state (30 seconds without response,
>>> not necessarily mean offline). If something bad happens, e.g.
>>> excessively long GC, or redeployment, we assume each failed tomcat
>>> instance to get back to business in about 5 minutes.
>>>
>>> This meets our needs to a certain degree. However, there's one thing
>>> that bugs me:
>>> If we set the reply_timeout too high, we miss the whole point of
>>> fail-over. If we set the value too low, it's likely we are going to
>>> kill a lot of legitimate/would-otherwise-success request, which is not
>>> what we wanted either.
>>>
>>> Instead of breaking the long request (say,>30 seconds) and put the
>>> worker into "error" state, is there anyway, anyway at all, we can tell
>>> mod_jk to mark a worker "busy", so that future requests are routed to
>>> alternative workers? mok_jk can still check every 30 (or the default
>>> 60) seconds whether it is able to resume one of the "busy"-marked
>>> workers, just like it does with the ones in "error" state.
>>>
>>>
>>> Regards,
>>> Sean
>>>
>>
>> -

Could not get dir listing

2010-04-21 Thread Christoph Kukulies
Strange. Don't know whether this has happened since I upgraded to Tomcat 
6.0.26, anyway, my application doesn't start anymore.


It's a ROOT app, which replaces the stuff, that is normally put into 
ROOT by the tomcat distribution.


21.04.2010 14:49:36 org.apache.naming.resources.FileDirContext list
WARNUNG: Could not get dir listing for 
C:\Programme\Apache_Group\Tomcat_6.0\webapps\ROOT\WEB-INF\lib

21.04.2010 14:49:36 org.apache.naming.resources.FileDirContext list
WARNUNG: Could not get dir listing for 
C:\Programme\Apache_Group\Tomcat_6.0\webapps\ROOT\WEB-INF


The directories are there. I compared the entry with a backup I have and 
I couldn't see any

differences.

--
Christoph Kukulies




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



Re: seperating content from the application

2010-04-21 Thread Pid
On 21/04/2010 09:54, M.H.G. Emmerig wrote:
> 
> 
> Hello
> 
> Our current configuration:
> 
> We are running tomcat 6.0.16 on windows 2003 enterprise.
> 
> We have a website which consists of an application part and a content part.
> Both are in the same folder structure, eg.
> 
> webapps\Root\applicationfiles
> webapps\Root\content\publications
> webapps\Root\content\images

You mean ROOT, I think?

> the application comes as a war file and the content is placed via another
> process.
> 
> the folder structure is placed on a windows share.

You've found out why this is a bad idea.

> Our current problem:
> 
> Whenever there is a problem with the share, the application crashes,
> because tomcat can't find the application files anymore.
> When the share comes back online, tomcat does not recover from the failure
> and a restart is the only option.
> 
> Now I have the following questions:
> 
> I think separating the application from the content and placing the
> application local to tomcat (basically on the same machine)
> will solve the recovery issue.

Tomcat isn't likely to recover from a situation where the webapps
directory disappears.

> I know placing everything local to the tomcat will be the best way and
> gives the best performance, but at the moment that is not an option.

Any reason why not?

> The questions
> 
> - Will placing the app local to the tomcat solve the recovery issue?

Yes.  There won't be a recovery issue, because the app won't fail when
the share disappears.

> - Is there an easy way to seperate the app and the content, ie. some sort
> of pathsetting ?

If you move the content directory to the top-level, it will become an
application in it's own right.  e.g.

  webapps\content

It will still appear in the URL space as /content


p


> De informatie verzonden met dit e-mailbericht is vertrouwelijk en
> uitsluitend bestemd voor de geadresseerde. Indien u als niet-geadresseerde
> dit bericht ontvangt, wordt u verzocht direct de afzender hierover te
> informeren en het bericht te vernietigen. Gebruik van informatie door
> onbevoegden, openbaarmaking of vermenigvuldiging  is verboden en kan leiden
> tot aansprakelijkheid. De afzender is niet aansprakelijk in geval van
> onjuiste overbrenging van het e-mailbericht en/of bij ontijdige ontvangst
> daarvan.
> 
> The information transmitted is confidential and intended only for the
> person or entity to whom or which it is addressed. If you are not the
> intended recipient of this communication, please inform us immediately and
> destroy this communication. Unauthorised use, disclosure or copying of
> information is strictly prohibited and may entail liability. The sender
> accepts no liability for improper transmission of this communication nor
> for any delay in its receipt.




signature.asc
Description: OpenPGP digital signature


Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread André Warnier

Kapil Godara wrote:

Hi

I copied the entire folder Tomcat 6.0 at C:\Program Files\Apache Software
Foundation (where tomcat is installed) to Tomcat_instance2 .

...

Let's start again, from the beginning.

This has been discussed many times on this forum, but I believe it is 
worth repeating it, because it is probably the source of the confusion.


In the Tomcat website download page, there are several versions :

- one is for Unix/Linux. That is a "complete" version, with all the 
files packed together in one .tar.gz file.  To install it, you unpack 
these files under one new directory for Tomcat, and it creates a set of 
subdirectories conf, bin, etc..


But for Windows, there are *two* versions :
- one is a "simple" version, named "installer", which is destined for 
the quick and simple installation of a single Tomcat under Windows, to 
run as a Windows Service. This is apparently the one you downloaded and 
installed. This version does not contain /all/ the same files as the one 
for Unix/Linux above, only a subset of them.


- the other one is a "zip" version, which does contain all the same 
files as the Unix/Linux version, and even some additional ones.
This version /also/ allows you to install Tomcat as a Windows Service, 
but this requires a bit more work.  It also provides all the files 
necessary to install a second instance of Tomcat and run it as a second 
Windows Service.

This is the one you should download now.

My recommendation is :
- remove the first version of Tomcat that you downloaded and installed 
(the .exe version).

- download the zip version
- decide on a "main" and "second" directories where you will run your 
two instances of Tomcat.
I suggest that you pick directory paths that are simple, without spaces 
in the name.  Like "c:\tomcat1" and "c:\tomcat2".  That will save you 
time and problems later.

- unzip the downloaded Tomcat zip version in the first directory.
Note for the future that this is now your "CATALINA_HOME" directory.
- in the directory c:\tomcat1\bin, run the "service.bat" script, to 
install this Tomcat instance as the first Windows Service.  Give it the 
name "Tomcat1".

For this Tomcat, the "CATALINA_BASE" is also "c:\tomcat1".

When all the above is done and you have a running first Tomcat instance, 
then come back here for additional information on how to run an 
additional instance, using the same CATALINA_HOME, but a separate 
CATALINA_BASE.








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



Re: seperating content from the application

2010-04-21 Thread Electronjockey
Since Windows 2003 doesn't support symlinks to network shares, you might 
be able to use DFS. Though someone who knows DFS better than I might 
know for certain.


Something like this where "L:" is your local drive:

L:\path\to\local\webapps\Root\applicationfiles
L:\path\to\local\webapps\Root\publications  
-> \\DFS\network\target\publications
L:\path\to\local\webapps\Root\images
-> \\DFS\network\target\images



M.H.G. Emmerig wrote:



Hello

Our current configuration:

We are running tomcat 6.0.16 on windows 2003 enterprise.

We have a website which consists of an application part and a content part.
Both are in the same folder structure, eg.

webapps\Root\applicationfiles
webapps\Root\content\publications
webapps\Root\content\images

the application comes as a war file and the content is placed via another
process.

the folder structure is placed on a windows share.


Our current problem:

Whenever there is a problem with the share, the application crashes,
because tomcat can't find the application files anymore.
When the share comes back online, tomcat does not recover from the failure
and a restart is the only option.

Now I have the following questions:

I think separating the application from the content and placing the
application local to tomcat (basically on the same machine)
will solve the recovery issue.
I know placing everything local to the tomcat will be the best way and
gives the best performance, but at the moment that is not an option.

The questions

- Will placing the app local to the tomcat solve the recovery issue?
- Is there an easy way to seperate the app and the content, ie. some sort
of pathsetting ?


regards, Milko





Please consider the environment before printing this email.

De informatie verzonden met dit e-mailbericht is vertrouwelijk en
uitsluitend bestemd voor de geadresseerde. Indien u als niet-geadresseerde
dit bericht ontvangt, wordt u verzocht direct de afzender hierover te
informeren en het bericht te vernietigen. Gebruik van informatie door
onbevoegden, openbaarmaking of vermenigvuldiging  is verboden en kan leiden
tot aansprakelijkheid. De afzender is niet aansprakelijk in geval van
onjuiste overbrenging van het e-mailbericht en/of bij ontijdige ontvangst
daarvan.

The information transmitted is confidential and intended only for the
person or entity to whom or which it is addressed. If you are not the
intended recipient of this communication, please inform us immediately and
destroy this communication. Unauthorised use, disclosure or copying of
information is strictly prohibited and may entail liability. The sender
accepts no liability for improper transmission of this communication nor
for any delay in its receipt.


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



Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread Peter Crowther
On 21 April 2010 13:04, Kapil Godara  wrote:

> (I installed tomcat 6.0.20 using apache-tomcat-6.0.20.exe, it does not
> create any startup.bat or shutdown.bat file in bin folder. this
> installation
> creates window service. tomcat6w.exe in turn calls tomcat6.exe)
>
> That's your issue.  For no good reason that anyone on this list has been
able to fathom, the .exe doesn't contain the batch files; the .zip download
does.

To get this running, I suggest you:
1) Download the .zip version of 6.0.20;
2) Unzip it somewhere safe;
3) Copy the missing .bat files to your second installation;
4) Carry on with what you were doing now that you have the files.

If you later want to install the second instance as a second service, you
can do that - but I'd get it running standalone first.  It's far easier to
debug startup errors on a standalone Tomcat, in my experience.

- Peter


Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread Kapil Godara
Hi

I copied the entire folder Tomcat 6.0 at C:\Program Files\Apache Software
Foundation (where tomcat is installed) to Tomcat_instance2 .
(I installed tomcat 6.0.20 using apache-tomcat-6.0.20.exe, it does not
create any startup.bat or shutdown.bat file in bin folder. this installation
creates window service. tomcat6w.exe in turn calls tomcat6.exe)

I have set two environment variables as

CATALINA_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0  and
CATALINA_BASE= C:\Program Files\Apache Software Foundation\Tomcat_instance2

Am I missing something? I did read RUNNING.txt it says in bin I should have
setenv.bat. Do i need to create this? What should be written in this bat
file?

regards
kapil

On Wed, Apr 21, 2010 at 5:07 PM, Pid  wrote:

> On 21/04/2010 12:02, Kapil Godara wrote:
> > Hi
> >
> > There is no startup.bat in bin folder. following are the 5 files in bin
> > folder
> >
> > 1.bootstrap.jar
> > 2.tomcat-juli.jar
> > 3.tcnative-1.dll
> > 4.tomcat6.exe
> > 5.tomcat6w.exe
> >
> > Regards
> > kapil
>
> I think you didn't copy the entire installation.
>
> You can run two Tomcat instances from the same installed binary by
> setting separate CATALINA_BASE and CATALINA_HOME environment variables.
>
> See the file: path/to/tomcat/RUNNING.txt
>
>
> p
>
>
> > On Wed, Apr 21, 2010 at 4:29 PM, Mercy  wrote:
> >
> >> Hi,
> >>
> >>   Please try to execute *startup.bat* in bin folder to startup your
> tomcat
> >> instance.
> >>
> >> Kind regards,
> >> Mercy
> >>
> >>
> >>
> >> Kapil Godara wrote:
> >>
> >>> Hi,
> >>> My requirement: To install Opensso and Policy agent on Tomcat 6.0.20 on
> >>> single windows server. I installed Opensso on default tomcat port 8080
> but
> >>> to install the Poilcy agent I need to create a separate instance of
> tomcat
> >>> on different port say 8081.
> >>>
> >>> My procedure:
> >>>
> >>> Step 1 - Installed tomcat 6.0.20 using apache-tomcat-6.0.20.exe at path
> >>> TOMCAT_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0. It
> is
> >>> running fine
> >>> Step 2 - Copied the contents of TOMCAT_HOME to new directory i.e.
> >>> C:\Program
> >>> Files\Apache Software Foundation\Tomcat_instance2 (TOMCAT_HOME2)
> >>> Step 3 - Changed the ports (http, shutdown and ajp connecter ports) in
> >>> server.xml in TOMCAT_HOME2\conf
> >>> Step 4 - Set environmental variable CATALINA_BASE=C:\Program
> Files\Apache
> >>> Software Foundation\Tomcat_instance2 (There is no startup.bat in bin
> >>> folder)
> >>>
> >>> I start the tomcat from TOMCAT_HOME\bin tomcat6w.exe  In browser
> >>> http://localhost:8080/ runs fine but when I use http://localhost:8081it
> >>> does not work.
> >>>
> >>> Can you please help me how to run second instance of Tomcat on separate
> >>> port?
> >>>
> >>> regards
> >>> kapil
> >>>
> >>>
> >>>
> >>
> >>
> >
>
>
>


Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread Pid
On 21/04/2010 12:02, Kapil Godara wrote:
> Hi
> 
> There is no startup.bat in bin folder. following are the 5 files in bin
> folder
> 
> 1.bootstrap.jar
> 2.tomcat-juli.jar
> 3.tcnative-1.dll
> 4.tomcat6.exe
> 5.tomcat6w.exe
> 
> Regards
> kapil

I think you didn't copy the entire installation.

You can run two Tomcat instances from the same installed binary by
setting separate CATALINA_BASE and CATALINA_HOME environment variables.

See the file: path/to/tomcat/RUNNING.txt


p


> On Wed, Apr 21, 2010 at 4:29 PM, Mercy  wrote:
> 
>> Hi,
>>
>>   Please try to execute *startup.bat* in bin folder to startup your tomcat
>> instance.
>>
>> Kind regards,
>> Mercy
>>
>>
>>
>> Kapil Godara wrote:
>>
>>> Hi,
>>> My requirement: To install Opensso and Policy agent on Tomcat 6.0.20 on
>>> single windows server. I installed Opensso on default tomcat port 8080 but
>>> to install the Poilcy agent I need to create a separate instance of tomcat
>>> on different port say 8081.
>>>
>>> My procedure:
>>>
>>> Step 1 - Installed tomcat 6.0.20 using apache-tomcat-6.0.20.exe at path
>>> TOMCAT_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0. It is
>>> running fine
>>> Step 2 - Copied the contents of TOMCAT_HOME to new directory i.e.
>>> C:\Program
>>> Files\Apache Software Foundation\Tomcat_instance2 (TOMCAT_HOME2)
>>> Step 3 - Changed the ports (http, shutdown and ajp connecter ports) in
>>> server.xml in TOMCAT_HOME2\conf
>>> Step 4 - Set environmental variable CATALINA_BASE=C:\Program Files\Apache
>>> Software Foundation\Tomcat_instance2 (There is no startup.bat in bin
>>> folder)
>>>
>>> I start the tomcat from TOMCAT_HOME\bin tomcat6w.exe  In browser
>>> http://localhost:8080/ runs fine but when I use http://localhost:8081 it
>>> does not work.
>>>
>>> Can you please help me how to run second instance of Tomcat on separate
>>> port?
>>>
>>> regards
>>> kapil
>>>
>>>
>>>
>>
>>
> 




signature.asc
Description: OpenPGP digital signature


Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Mircea LUTIC
Also, my application will eventually be put on a web- based hosting provider 
and I may not have access to the server.xml file. What I want is my application 
to be fully UTF-8 based regardless of what the server is configured like.
The request javax.servlet.Filter system which is configured in the web.xml file 
seems to be the way to do it.

Thank you,
Mircea.






From: Ake Tangkannaond 
To: Tomcat Users List 
Sent: Wed, 21 April, 2010 14:13:18
Subject: RE: UTF-8 encoding in Tomcat 6.0

Where do you see the recommendation of using filter to handle utf8 char 
encoding in GET ?


-Ake

-Original Message-
From: Mircea LUTIC [mailto:mircea_lu...@yahoo.com] 
Sent: Wednesday, April 21, 2010 5:57 PM
To: Tomcat Users List
Subject: Re: UTF-8 encoding in Tomcat 6.0

The filter does get called on my GET request.
In my understanding, a filter is the reccomended method of handling UTF-8 for 
both GET & POST (as well as other methods like HEAD, PUT etc.).

When the request is "test.jsp?Name=larevolu%C8%9Bie" as in the example page
the EncodingFilter.doFilter function is being called and it calls 
the EncodingFilter.check function as below

Name=request.getParameter("Name");
if (Name!=null)
check(Name, lang);

and the String Name is incorrect as mentionned in the comment below:


void check(String Name, java.util.Locale lang)
{
int c8=Name.codePointAt(8);//c8=200=C8 // should be 539=21Bh = ț
int c9=Name.codePointAt(9);//c9=155=9B // should be 105= 69h = i
char ch[]={Name.charAt(8),Name.charAt(9)};
int x=c8+c9;//to have eclipse (Galileo) display the above
String s=new String(ch); 
}


server.xml contains the following:

 

This is because my tomcat 6 is set to work on 8060 with no redirect because 
this is a debug setting.
(some time ago I also had tomcat 5 on 8050 but at that time I didn't check the 
UTF-8 issue)
Thanks for you help.
Mircea.




From: Ake Tangkannaond 
To: Tomcat Users List 
Sent: Wed, 21 April, 2010 12:42:36
Subject: RE: UTF-8 encoding in Tomcat 6.0

Hi Mircea,



That filter you wrote is for POST and it has nothing to do with GET request.



Have you check the documentation on the conf/server.xml on the following line?







-Ake



From: Mircea LUTIC [mailto:mircea_lu...@yahoo.com] 
Sent: Wednesday, April 21, 2010 3:40 PM
To: users@tomcat.apache.org
Subject: UTF-8 encoding in Tomcat 6.0



Hello,


I'm having trouble convincing tomcat 6.0 to take UTF-8 strings.
I created an encoding filter with no luck. 

/**
Here is the Utf8 Filter that fails for me in 
Tomcat 6.0.20 / Eclipse-Galileo / Windows Vista (6.0.6002) <---> Firefox 3.6.3.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)
Everything is on my  laptop (http://localhost:8060).

What I do is create a GET string (based on parameters from a 
showModalDialog)
by script and send it (from Firefox) to the (localhost) server 
which is running under eclipse with a breakpoint in the EncodingFilter.

Note that the system locale is ro_RO (may have an influence)

* 
* set in appl/WebContent/web.xml:
* 

EncodingFilter
ro.lutic.transcode.EncodingFilter

encoding
UTF-8



* 
* set in tomcat/conf/server.xml at 

http://www.w3.org/TR/html4/loose.dtd";>



UTF-8

function send()
{

window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))
}



send




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

Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Mircea LUTIC
Here:
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q8






From: Ake Tangkannaond 
To: Tomcat Users List 
Sent: Wed, 21 April, 2010 14:13:18
Subject: RE: UTF-8 encoding in Tomcat 6.0

Where do you see the recommendation of using filter to handle utf8 char 
encoding in GET ?


-Ake

-Original Message-
From: Mircea LUTIC [mailto:mircea_lu...@yahoo.com] 
Sent: Wednesday, April 21, 2010 5:57 PM
To: Tomcat Users List
Subject: Re: UTF-8 encoding in Tomcat 6.0

The filter does get called on my GET request.
In my understanding, a filter is the reccomended method of handling UTF-8 for 
both GET & POST (as well as other methods like HEAD, PUT etc.).

When the request is "test.jsp?Name=larevolu%C8%9Bie" as in the example page
the EncodingFilter.doFilter function is being called and it calls 
the EncodingFilter.check function as below

Name=request.getParameter("Name");
if (Name!=null)
check(Name, lang);

and the String Name is incorrect as mentionned in the comment below:


void check(String Name, java.util.Locale lang)
{
int c8=Name.codePointAt(8);//c8=200=C8 // should be 539=21Bh = ț
int c9=Name.codePointAt(9);//c9=155=9B // should be 105= 69h = i
char ch[]={Name.charAt(8),Name.charAt(9)};
int x=c8+c9;//to have eclipse (Galileo) display the above
String s=new String(ch); 
}


server.xml contains the following:

 

This is because my tomcat 6 is set to work on 8060 with no redirect because 
this is a debug setting.
(some time ago I also had tomcat 5 on 8050 but at that time I didn't check the 
UTF-8 issue)
Thanks for you help.
Mircea.




From: Ake Tangkannaond 
To: Tomcat Users List 
Sent: Wed, 21 April, 2010 12:42:36
Subject: RE: UTF-8 encoding in Tomcat 6.0

Hi Mircea,



That filter you wrote is for POST and it has nothing to do with GET request.



Have you check the documentation on the conf/server.xml on the following line?







-Ake



From: Mircea LUTIC [mailto:mircea_lu...@yahoo.com] 
Sent: Wednesday, April 21, 2010 3:40 PM
To: users@tomcat.apache.org
Subject: UTF-8 encoding in Tomcat 6.0



Hello,


I'm having trouble convincing tomcat 6.0 to take UTF-8 strings.
I created an encoding filter with no luck. 

/**
Here is the Utf8 Filter that fails for me in 
Tomcat 6.0.20 / Eclipse-Galileo / Windows Vista (6.0.6002) <---> Firefox 3.6.3.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)
Everything is on my  laptop (http://localhost:8060).

What I do is create a GET string (based on parameters from a 
showModalDialog)
by script and send it (from Firefox) to the (localhost) server 
which is running under eclipse with a breakpoint in the EncodingFilter.

Note that the system locale is ro_RO (may have an influence)

* 
* set in appl/WebContent/web.xml:
* 

EncodingFilter
ro.lutic.transcode.EncodingFilter

encoding
UTF-8



* 
* set in tomcat/conf/server.xml at 

http://www.w3.org/TR/html4/loose.dtd";>



UTF-8

function send()
{

window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))
}



send




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

Re: gc new capacity of JVM is gradually reducing when webapp(tomcat) started

2010-04-21 Thread Peter Crowther
This says that the JVM is tuning its memory boundaries to best suit your
application.

Do you have any evidence that this is bad for your application?  Or are you
simply trying to find out why it is happening?

- Peter

2010/4/21 塗 

>
> hi,all
>
> there is a problem with my webapp.
>
> by manual configuration, i allocated 1G(1024M) memory for webapp.
> where the gc new capacity automatically is 262M, the gc old capacity
> automatically is 699M, S0/S1 automatically is 43.6M/43.6M.
>
> When my webapp is started, I use the jvm's own tools(jstat) to trace the
> garbage collections.
> when the 6th Young garbage collection has happened, gc new capacity(262M)
> is gradually reducing.
> About 10 hours after, gc new capacity is only 40.6M.
>
>
> ##web operating environment:
>  tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64
>
> ##blow is my manual configurations for tomcat JVM
>  CATALINA_OPTS="-Xms1024M -Xmx1024M
> -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"
>
>
> ##Jstat Tracking data (unit/k)
>  systemTime --- S0C   ---  S1C  --- S0U --- S1U--- EC ---
>  --- OC --- OU   --- YGC --- YGCT  --- FGC --- FGCT --- GCT
>  10:03:10   --- 43648 --- 43648 --- 22444.3 --- 0  --- 262208 ---
>  217735.7 --- 699072 --- 163.6 --- 4  --- 0.126 --- 1   --- 0.007 --- 0.132
> ##webpp startup
>  10:03:13   --- 43648 --- 43648 --- 22444.3 --- 0  --- 262208 ---
>  217735.7 --- 699072 --- 163.6 --- 4  --- 0.126 --- 1   --- 0.007 --- 0.132
>  :
>  10:11:35   --- 43648 --- 43648 --- 0   --- 22445.1--- 262208 ---
>  261516.6 --- 699072 --- 163.6 --- 5  --- 0.161 --- 1   --- 0.007 --- 0.168
> ##5th YGC
>  10:11:38   --- 20800 --- 33984 --- 19898   --- 0  --- 258688 ---
>  4845.1   --- 699072 --- 163.6 --- 6  --- 0.192 --- 1   --- 0.007 --- 0.199
> ##6th YGC, EC is reduced.
>  :
>  10:18:41   --- 33152 --- 19968 --- 0   --- 19949.1--- 255232 ---
>  --- 699072 --- 163.6 --- 7  --- 0.221 --- 1   --- 0.007 --- 0.228 ##7th
> YGC, EC is reduced.
>  :
>  18:34:43   --- 640   --- 704   --- 608 --- 0  --- 40832  ---  58
>  --- 699072 --- 87896 --- 380--- 5.413 --- 1   --- 0.007 --- 5.419 ##380th
> YGC, EC is reduced.
>
>
> this problem has been troubling me. please help !
>
>
>
> --
> Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
> http://pr.mail.yahoo.co.jp/ie8/
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Ake Tangkannaond
Where do you see the recommendation of using filter to handle utf8 char 
encoding in GET ?


-Ake

-Original Message-
From: Mircea LUTIC [mailto:mircea_lu...@yahoo.com] 
Sent: Wednesday, April 21, 2010 5:57 PM
To: Tomcat Users List
Subject: Re: UTF-8 encoding in Tomcat 6.0

The filter does get called on my GET request.
In my understanding, a filter is the reccomended method of handling UTF-8 for 
both GET & POST (as well as other methods like HEAD, PUT etc.).

When the request is "test.jsp?Name=larevolu%C8%9Bie" as in the example page
the EncodingFilter.doFilter function is being called and it calls 
the EncodingFilter.check function as below

Name=request.getParameter("Name");
if (Name!=null)
check(Name, lang);

and the String Name is incorrect as mentionned in the comment below:


void check(String Name, java.util.Locale lang)
{
int c8=Name.codePointAt(8);//c8=200=C8 // should be 539=21Bh = ț
int c9=Name.codePointAt(9);//c9=155=9B // should be 105= 69h = i
char ch[]={Name.charAt(8),Name.charAt(9)};
int x=c8+c9;//to have eclipse (Galileo) display the above
String s=new String(ch); 
}


server.xml contains the following:

 

This is because my tomcat 6 is set to work on 8060 with no redirect because 
this is a debug setting.
(some time ago I also had tomcat 5 on 8050 but at that time I didn't check the 
UTF-8 issue)
Thanks for you help.
Mircea.




From: Ake Tangkannaond 
To: Tomcat Users List 
Sent: Wed, 21 April, 2010 12:42:36
Subject: RE: UTF-8 encoding in Tomcat 6.0

Hi Mircea,



That filter you wrote is for POST and it has nothing to do with GET request.



Have you check the documentation on the conf/server.xml on the following line?







-Ake



From: Mircea LUTIC [mailto:mircea_lu...@yahoo.com] 
Sent: Wednesday, April 21, 2010 3:40 PM
To: users@tomcat.apache.org
Subject: UTF-8 encoding in Tomcat 6.0



Hello,


I'm having trouble convincing tomcat 6.0 to take UTF-8 strings.
I created an encoding filter with no luck. 

/**
Here is the Utf8 Filter that fails for me in 
Tomcat 6.0.20 / Eclipse-Galileo / Windows Vista (6.0.6002) <---> Firefox 3.6.3.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)
Everything is on my  laptop (http://localhost:8060).

What I do is create a GET string (based on parameters from a 
showModalDialog)
by script and send it (from Firefox) to the (localhost) server 
which is running under eclipse with a breakpoint in the EncodingFilter.

Note that the system locale is ro_RO (may have an influence)

* 
* set in appl/WebContent/web.xml:
* 

EncodingFilter
ro.lutic.transcode.EncodingFilter

encoding
UTF-8



* 
* set in tomcat/conf/server.xml at 

http://www.w3.org/TR/html4/loose.dtd";>



UTF-8

function send()
{

window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))
}



send




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



Re: Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread Goo Sam Kong
Thanks Andre,

I saw there is a script doing zip in /etc. I am new to Linux, :-).

On 21 April 2010 17:45, André Warnier  wrote:

> Goo Sam Kong wrote:
>
>> Hi Pid,
>>
>> My answer below.
>>
>> I saw the same file names in another server (not implement log4j yet),
>> that
>> server is running on default logging (Tomcat Juli).
>>
>> I think Tomcat by default created those extra zip files, I would like to
>> know how to disable that.
>>
>
> Tomcat does not create gzipped logfiles.
> I would venture that the most likely candidate for this is that you have a
> logrotate script which runs under cron from time to time, and which does it.
> If you are under Linux, start with the /etc directory and look for anything
> that mentions logrotate, maybe starting in the /etc/cron.* directories.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


[ANN] Apache Tomcat 5.5.29 released

2010-04-21 Thread Mark Thomas
The Apache Tomcat Team announces the immediate availability of Apache
Tomcat 5.5.29 stable.

Apache Tomcat 5.5.29 incorporates numerous bug fixes and fixes for four
low severity security vulnerabilities.

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

Please refer to the Tomcat 5 security page for the list of security
fixes in this release:
http://tomcat.apache.org/security-5.html

Downloads:
http://tomcat.apache.org/download-55.cgi

Thank you,
The Apache Tomcat Team




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



Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread Kapil Godara
Hi

There is no startup.bat in bin folder. following are the 5 files in bin
folder

1.bootstrap.jar
2.tomcat-juli.jar
3.tcnative-1.dll
4.tomcat6.exe
5.tomcat6w.exe

Regards
kapil

On Wed, Apr 21, 2010 at 4:29 PM, Mercy  wrote:

> Hi,
>
>   Please try to execute *startup.bat* in bin folder to startup your tomcat
> instance.
>
> Kind regards,
> Mercy
>
>
>
> Kapil Godara wrote:
>
>> Hi,
>> My requirement: To install Opensso and Policy agent on Tomcat 6.0.20 on
>> single windows server. I installed Opensso on default tomcat port 8080 but
>> to install the Poilcy agent I need to create a separate instance of tomcat
>> on different port say 8081.
>>
>> My procedure:
>>
>> Step 1 - Installed tomcat 6.0.20 using apache-tomcat-6.0.20.exe at path
>> TOMCAT_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0. It is
>> running fine
>> Step 2 - Copied the contents of TOMCAT_HOME to new directory i.e.
>> C:\Program
>> Files\Apache Software Foundation\Tomcat_instance2 (TOMCAT_HOME2)
>> Step 3 - Changed the ports (http, shutdown and ajp connecter ports) in
>> server.xml in TOMCAT_HOME2\conf
>> Step 4 - Set environmental variable CATALINA_BASE=C:\Program Files\Apache
>> Software Foundation\Tomcat_instance2 (There is no startup.bat in bin
>> folder)
>>
>> I start the tomcat from TOMCAT_HOME\bin tomcat6w.exe  In browser
>> http://localhost:8080/ runs fine but when I use http://localhost:8081 it
>> does not work.
>>
>> Can you please help me how to run second instance of Tomcat on separate
>> port?
>>
>> regards
>> kapil
>>
>>
>>
>
>


Re: gc new capacity of JVM is gradually reducing when webapp(tomcat) started

2010-04-21 Thread Mercy
Hi,

You could add a JVM runtime parameter like this : -Xmn256M to fix the
size of new generation.

Kind regards,
Mercy

塗 wrote:
>
> hi,all
>
> there is a problem with my webapp.
>
> by manual configuration, i allocated 1G(1024M) memory for webapp.
> where the gc new capacity automatically is 262M, the gc old capacity
> automatically is 699M, S0/S1 automatically is 43.6M/43.6M.
>
> When my webapp is started, I use the jvm's own tools(jstat) to trace
> the garbage collections.
> when the 6th Young garbage collection has happened, gc new
> capacity(262M) is gradually reducing.
> About 10 hours after, gc new capacity is only 40.6M.
>
>
> ##web operating environment:
> tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64
>
> ##blow is my manual configurations for tomcat JVM
> CATALINA_OPTS="-Xms1024M -Xmx1024M
> -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"
>
>
> ##Jstat Tracking data (unit/k)
> systemTime --- S0C --- S1C --- S0U --- S1U --- EC --- --- OC --- OU
> --- YGC --- YGCT --- FGC --- FGCT --- GCT
> 10:03:10 --- 43648 --- 43648 --- 22444.3 --- 0 --- 262208 --- 217735.7
> --- 699072 --- 163.6 --- 4 --- 0.126 --- 1 --- 0.007 --- 0.132 ##webpp
> startup
> 10:03:13 --- 43648 --- 43648 --- 22444.3 --- 0 --- 262208 --- 217735.7
> --- 699072 --- 163.6 --- 4 --- 0.126 --- 1 --- 0.007 --- 0.132
> :
> 10:11:35 --- 43648 --- 43648 --- 0 --- 22445.1--- 262208 --- 261516.6
> --- 699072 --- 163.6 --- 5 --- 0.161 --- 1 --- 0.007 --- 0.168 ##5th YGC
> 10:11:38 --- 20800 --- 33984 --- 19898 --- 0 --- 258688 --- 4845.1 ---
> 699072 --- 163.6 --- 6 --- 0.192 --- 1 --- 0.007 --- 0.199 ##6th YGC,
> EC is reduced.
> :
> 10:18:41 --- 33152 --- 19968 --- 0 --- 19949.1--- 255232 --- ---
> 699072 --- 163.6 --- 7 --- 0.221 --- 1 --- 0.007 --- 0.228 ##7th YGC,
> EC is reduced.
> :
> 18:34:43 --- 640 --- 704 --- 608 --- 0 --- 40832 --- 58 --- 699072 ---
> 87896 --- 380--- 5.413 --- 1 --- 0.007 --- 5.419 ##380th YGC, EC is
> reduced.
>
>
> this problem has been troubling me. please help !
>
>
>
> --
> Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
> http://pr.mail.yahoo.co.jp/ie8/
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


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



Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread Mercy

Hi,

   Please try to execute *startup.bat* in bin folder to startup your 
tomcat instance.


Kind regards,
Mercy


Kapil Godara wrote:

Hi,
My requirement: To install Opensso and Policy agent on Tomcat 6.0.20 on
single windows server. I installed Opensso on default tomcat port 8080 but
to install the Poilcy agent I need to create a separate instance of tomcat
on different port say 8081.

My procedure:

Step 1 - Installed tomcat 6.0.20 using apache-tomcat-6.0.20.exe at path
TOMCAT_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0. It is
running fine
Step 2 - Copied the contents of TOMCAT_HOME to new directory i.e. C:\Program
Files\Apache Software Foundation\Tomcat_instance2 (TOMCAT_HOME2)
Step 3 - Changed the ports (http, shutdown and ajp connecter ports) in
server.xml in TOMCAT_HOME2\conf
Step 4 - Set environmental variable CATALINA_BASE=C:\Program Files\Apache
Software Foundation\Tomcat_instance2 (There is no startup.bat in bin folder)

I start the tomcat from TOMCAT_HOME\bin tomcat6w.exe  In browser
http://localhost:8080/ runs fine but when I use http://localhost:8081 it
does not work.

Can you please help me how to run second instance of Tomcat on separate
port?

regards
kapil

  




Re: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Mircea LUTIC
The filter does get called on my GET request.
In my understanding, a filter is the reccomended method of handling UTF-8 for 
both GET & POST (as well as other methods like HEAD, PUT etc.).

When the request is "test.jsp?Name=larevolu%C8%9Bie" as in the example page
the EncodingFilter.doFilter function is being called and it calls 
the EncodingFilter.check function as below

Name=request.getParameter("Name");
if (Name!=null)
check(Name, lang);

and the String Name is incorrect as mentionned in the comment below:


void check(String Name, java.util.Locale lang)
{
int c8=Name.codePointAt(8);//c8=200=C8 // should be 539=21Bh = ț
int c9=Name.codePointAt(9);//c9=155=9B // should be 105= 69h = i
char ch[]={Name.charAt(8),Name.charAt(9)};
int x=c8+c9;//to have eclipse (Galileo) display the above
String s=new String(ch); 
}


server.xml contains the following:

 

This is because my tomcat 6 is set to work on 8060 with no redirect because 
this is a debug setting.
(some time ago I also had tomcat 5 on 8050 but at that time I didn't check the 
UTF-8 issue)
Thanks for you help.
Mircea.




From: Ake Tangkannaond 
To: Tomcat Users List 
Sent: Wed, 21 April, 2010 12:42:36
Subject: RE: UTF-8 encoding in Tomcat 6.0

Hi Mircea,



That filter you wrote is for POST and it has nothing to do with GET request.



Have you check the documentation on the conf/server.xml on the following line?







-Ake



From: Mircea LUTIC [mailto:mircea_lu...@yahoo.com] 
Sent: Wednesday, April 21, 2010 3:40 PM
To: users@tomcat.apache.org
Subject: UTF-8 encoding in Tomcat 6.0



Hello,


I'm having trouble convincing tomcat 6.0 to take UTF-8 strings.
I created an encoding filter with no luck. 

/**
Here is the Utf8 Filter that fails for me in 
Tomcat 6.0.20 / Eclipse-Galileo / Windows Vista (6.0.6002) <---> Firefox 3.6.3.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)
Everything is on my  laptop (http://localhost:8060).

What I do is create a GET string (based on parameters from a 
showModalDialog)
by script and send it (from Firefox) to the (localhost) server 
which is running under eclipse with a breakpoint in the EncodingFilter.

Note that the system locale is ro_RO (may have an influence)

* 
* set in appl/WebContent/web.xml:
* 

EncodingFilter
ro.lutic.transcode.EncodingFilter

encoding
UTF-8



* 
* set in tomcat/conf/server.xml at 

http://www.w3.org/TR/html4/loose.dtd";>



UTF-8

function send()
{

window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))
}



send



How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread Kapil Godara
Hi,
My requirement: To install Opensso and Policy agent on Tomcat 6.0.20 on
single windows server. I installed Opensso on default tomcat port 8080 but
to install the Poilcy agent I need to create a separate instance of tomcat
on different port say 8081.

My procedure:

Step 1 - Installed tomcat 6.0.20 using apache-tomcat-6.0.20.exe at path
TOMCAT_HOME=C:\Program Files\Apache Software Foundation\Tomcat 6.0. It is
running fine
Step 2 - Copied the contents of TOMCAT_HOME to new directory i.e. C:\Program
Files\Apache Software Foundation\Tomcat_instance2 (TOMCAT_HOME2)
Step 3 - Changed the ports (http, shutdown and ajp connecter ports) in
server.xml in TOMCAT_HOME2\conf
Step 4 - Set environmental variable CATALINA_BASE=C:\Program Files\Apache
Software Foundation\Tomcat_instance2 (There is no startup.bat in bin folder)

I start the tomcat from TOMCAT_HOME\bin tomcat6w.exe  In browser
http://localhost:8080/ runs fine but when I use http://localhost:8081 it
does not work.

Can you please help me how to run second instance of Tomcat on separate
port?

regards
kapil


gc new capacity of JVM is gradually reducing when webapp(tomcat) started

2010-04-21 Thread


hi,all

there is a problem with my webapp.

by manual configuration, i allocated 1G(1024M) memory for webapp.
where the gc new capacity automatically is 262M, the gc old capacity 
automatically is 699M, S0/S1 automatically is 43.6M/43.6M.


When my webapp is started, I use the jvm's own tools(jstat) to trace the 
garbage collections.
when the 6th Young garbage collection has happened, gc new capacity(262M) is 
gradually reducing.

About 10 hours after, gc new capacity is only 40.6M.


##web operating environment:
 tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64

##blow is my manual configurations for tomcat JVM
 CATALINA_OPTS="-Xms1024M -Xmx1024M 
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"


##Jstat Tracking data (unit/k)
 systemTime --- S0C   ---  S1C  --- S0U --- S1U--- EC ---  
  --- OC --- OU   --- YGC --- YGCT  --- FGC --- FGCT --- GCT
 10:03:10   --- 43648 --- 43648 --- 22444.3 --- 0  --- 262208 ---  
217735.7 --- 699072 --- 163.6 --- 4  --- 0.126 --- 1   --- 0.007 --- 0.132 
##webpp startup
 10:03:13   --- 43648 --- 43648 --- 22444.3 --- 0  --- 262208 ---  
217735.7 --- 699072 --- 163.6 --- 4  --- 0.126 --- 1   --- 0.007 --- 0.132

  :
 10:11:35   --- 43648 --- 43648 --- 0   --- 22445.1--- 262208 ---  
261516.6 --- 699072 --- 163.6 --- 5  --- 0.161 --- 1   --- 0.007 --- 0.168 
##5th YGC
 10:11:38   --- 20800 --- 33984 --- 19898   --- 0  --- 258688 ---  
4845.1   --- 699072 --- 163.6 --- 6  --- 0.192 --- 1   --- 0.007 --- 0.199 
##6th YGC, EC is reduced.

  :
 10:18:41   --- 33152 --- 19968 --- 0   --- 19949.1--- 255232 ---  
--- 699072 --- 163.6 --- 7  --- 0.221 --- 1   --- 0.007 --- 0.228 
##7th YGC, EC is reduced.

  :
 18:34:43   --- 640   --- 704   --- 608 --- 0  --- 40832  ---  
58--- 699072 --- 87896 --- 380--- 5.413 --- 1   --- 0.007 --- 5.419 
##380th YGC, EC is reduced.



this problem has been troubling me. please help !



--
Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
http://pr.mail.yahoo.co.jp/ie8/

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



Re: mod_jk reply_timeout and error state

2010-04-21 Thread Rainer Jung

Hi Sean,

On 20.04.2010 08:04, Sean GAO wrote:

According to online documentation
(http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html):

Long Garbage Collection pauses on the backend do not make a good fit
with some timeouts. Try to optimise your Java memory and GC settings.


So if JVM tuning doesn't help, what else could I do? Balancer worker's
method=Busyness setting may have some effect, but still this is
different. What do you think?


There is no kind of soft reply timeout which would mean a long response 
time indicates we shouldn't send more requests to that Tomcat but should 
still wait for the outstanding responses.


The best you can do is tweaking the timeouts and the GC. Modern CMS GC 
doesn't do stop-the-world, most of it runs concurrently. Yes, after some 
time you might run into an occasional stop-the-world because of 
fragmentation, but they will be much rarer than without CMS.


If your GC stop times are about 30 seconds, then that is not good, but I 
wouldn't reduce a reply_timeout to something much smaller anyhows. You 
don't want to make the error detection very sensible, because then it is 
not unlikely that you end up making your system more unstable than 
without. You wan to detect serious problems and react on them but you 
shouldn't want to react quickly on any indication of possible problems.


What might help you a bit is the ability to define reply_timeout 
depending on the URL of the request. So if you know there are e.g. some 
reporting URLs that you know will take longet than a minute, you could 
set a general reply_timeout to e.g. 30 seconds, and the timeout for the 
report URLs to e.g. 2 minutes.


If you use reply_timeout, never forget to also add a max_reply_timeouts.

Concerning your configuration below, please do als consult

http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html

Regards,

Rainer


On Tue, Apr 20, 2010 at 12:48 PM, Sean GAO  wrote:

Hi,

We are running apache 2.2.4 and tomcat 5.5.28 with mod_jk 1.2.28. 3
tomcat instances.

Referring to http://tomcat.apache.org/connectors-doc/reference/workers.html
, we came up with a workers.properties file like this:

worker.list=balancer
worker.maintain=30
#tomcat01
worker.tomcat01.port=18009
worker.tomcat01.host=localhost
worker.tomcat01.type=ajp13
worker.tomcat01.lbfactor=120
worker.tomcat01.retries=2
worker.tomcat01.socket_timeout=30
worker.tomcat01.reply_timeout=3
worker.tomcat01.recover_time=300
#tomcat02
worker.tomcat02.port=28009
worker.tomcat02.host=localhost
worker.tomcat02.type=ajp13
worker.tomcat02.lbfactor=100
worker.tomcat02.retries=2
worker.tomcat02.socket_timeout=30
worker.tomcat02.reply_timeout=3
worker.tomcat02.recover_time=300
#tomcat03
worker.tomcat03.port=38009
worker.tomcat03.host=localhost
worker.tomcat03.type=ajp13
worker.tomcat03.lbfactor=0
worker.tomcat03.retries=2
#loadbalancer
worker.retries=2
worker.balancer.type=lb
worker.balancer.sticky_session=False
worker.balancer.method=Busyness
worker.balancer.balance_workers=tomcat01,tomcat02,tomcat03

So basically tomcat01 and tomcat02 are the main request handlers, with
tomcat03 acting as a backup server which is accessed only when both
tomcat01 and tomcat02 are in error state (30 seconds without response,
not necessarily mean offline). If something bad happens, e.g.
excessively long GC, or redeployment, we assume each failed tomcat
instance to get back to business in about 5 minutes.

This meets our needs to a certain degree. However, there's one thing
that bugs me:
If we set the reply_timeout too high, we miss the whole point of
fail-over. If we set the value too low, it's likely we are going to
kill a lot of legitimate/would-otherwise-success request, which is not
what we wanted either.

Instead of breaking the long request (say,>30 seconds) and put the
worker into "error" state, is there anyway, anyway at all, we can tell
mod_jk to mark a worker "busy", so that future requests are routed to
alternative workers? mok_jk can still check every 30 (or the default
60) seconds whether it is able to resume one of the "busy"-marked
workers, just like it does with the ones in "error" state.


Regards,
Sean



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



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



Re: Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread André Warnier

Goo Sam Kong wrote:

Hi Pid,

My answer below.

I saw the same file names in another server (not implement log4j yet), that
server is running on default logging (Tomcat Juli).

I think Tomcat by default created those extra zip files, I would like to
know how to disable that.


Tomcat does not create gzipped logfiles.
I would venture that the most likely candidate for this is that you have 
a logrotate script which runs under cron from time to time, and which 
does it.
If you are under Linux, start with the /etc directory and look for 
anything that mentions logrotate, maybe starting in the /etc/cron.* 
directories.



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



RE: UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Ake Tangkannaond
Hi Mircea,

 

That filter you wrote is for POST and it has nothing to do with GET request.

 

Have you check the documentation on the conf/server.xml on the following line?



 

 

-Ake

 

From: Mircea LUTIC [mailto:mircea_lu...@yahoo.com] 
Sent: Wednesday, April 21, 2010 3:40 PM
To: users@tomcat.apache.org
Subject: UTF-8 encoding in Tomcat 6.0

 

Hello,


I'm having trouble convincing tomcat 6.0 to take UTF-8 strings.
I created an encoding filter with no luck. 

/**
Here is the Utf8 Filter that fails for me in 
Tomcat 6.0.20 / Eclipse-Galileo / Windows Vista (6.0.6002) <---> Firefox 3.6.3.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)
Everything is on my  laptop (http://localhost:8060).

What I do is create a GET string (based on parameters from a 
showModalDialog)
by script and send it (from Firefox) to the (localhost) server 
which is running under eclipse with a breakpoint in the EncodingFilter.

Note that the system locale is ro_RO (may have an influence)

 * 
 * set in appl/WebContent/web.xml:
 * 
 
EncodingFilter
ro.lutic.transcode.EncodingFilter

encoding
UTF-8



 * 
 * set in tomcat/conf/server.xml at 

http://www.w3.org/TR/html4/loose.dtd";>



UTF-8

function send()
{

window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))
}



send





Re: Installing auto updates for my webapp hosted on Tomcat

2010-04-21 Thread André Warnier

Anand HS wrote:

Hi,
I have a webapplication deployed in tomcat and have been asked to develop an
auto updater that can grab a new update and apply the updates to my webapp.
I want to ask the community to see if there are 'hooks' tomcat provides to
achieve this.


You mean like the "autoDeploy" option standard in Tomcat ?



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



Re: Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread Goo Sam Kong
Hi Pid,

My answer below.

I saw the same file names in another server (not implement log4j yet), that
server is running on default logging (Tomcat Juli).

I think Tomcat by default created those extra zip files, I would like to
know how to disable that.

On 21 April 2010 17:00, Pid  wrote:

> On 21/04/2010 09:49, Pid wrote:
> > On 21/04/2010 09:35, Goo Sam Kong wrote:
> >> Oops, type too fast. I want catalina.out to be rotate daily but Tomcat
> >> give me extra files (catalina.out.1.gz, catalina.out.2.gz...catalina.
> >> out.30.gz). I don't want those extra files. Any chance to disable that?
> >
> > Sorry, my mistake, I misread your email.
> >
> > Also:
> >
> >
> http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html
> >
> > seems to say that DailyRollingFileAppender isn't a good choice.
> >
> >> The extra files are generated by Tomcat by default? I do not specify
> >> those file rotation anywhere.
> >
> > Tomcat doesn't tar & gzip files by default.  How are you starting
> > Tomcat, using a script like /etc/init.d/tomcat?
>
> (I need a coffee.)
>
> So, I'm not asking the right questions here.  To recap:
>
> 1. What log files *are* being generated?  Are you getting
> catalina.2010-04-01.log, catalina.2010-04-02.log etc?
> Sam: Yes
>


> 2. If so, are they in addition to the catalina.1.tar.gz type files?
> Sam: The file name is catalina.out.1.gz and so on
>


> 3. How big are is the compressed tar.gz and and how big is the file when
> it's unpacked?
> Sam: Same contents as catalina.out..mm.dd
>


> 4. Did you post the entire log4j.properties or are there other parts to
> it?  E.g. Are there MaxBackupIndex and MaxFileSize settings?  If not,
> try adding one set to -1 and 0.
> Sam: I posted entire log4j.properties in my previous email.
>
> p
>
>
> >> On 21 April 2010 16:32, Goo Sam Kong  >> > wrote:
> >>
> >> I want catalina.out to be rotate daily but Tomcat give me extra
> >> files (catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I
> >> don't those extra files. Any chance to disable that?
> >>
> >>
> >> On 21 April 2010 16:26, Pid  >> > wrote:
> >>
> >> On 21/04/2010 09:07, Goo Sam Kong wrote:
> >> > Hi,
> >> >
> >> > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0
> >> update 7 on RedHat
> >> > Linux server.
> >> >
> >> > I followed the instructions on
> >> > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy
> the
> >> > commons-logging-1.0.4.jar and log4j.jar into
> >> $CATALINA_HOME/common/lib
> >> > directory.
> >> >
> >> > and created log4j.properties in $CATALINA_HOME/common/classes
> >> directory as
> >> > below:
> >> >
> >> > log4j.rootLogger=info, CATALINA
> >> >
> log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
> >> > log4j.appender.CATALINA.DatePattern='.'-MM-dd
> >> >
> log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
> >> > log4j.appender.CATALINA.threshold=info
> >> > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
> >> > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} -
> >> %m%n
> >> >
> >> > After couple of days, I saw some catalina.out files suffix
> >> with ".x.gz",
> >> > where x is number range from 1 to 30. May I know to get rid of
> >> these files?
> >> >
> >> > I only want log4j to handle the file rotation as configured in
> >> > log4j.properties.
> >>
> >> You've configured a DailyRollingFileAppender with DatePattern
> >> DatePattern set to ".-MM-dd" so the log files are being
> >> rotated daily.
> >>
> >> What were you intending it to do?
> >>
> >>
> >> p
> >>
> >>
> >>
> >> > Thank you.
> >> >
> >> > Regards,
> >> > SamKong Goo
> >> >
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
>
>


Re: Tomcat fails on restart: BindException

2010-04-21 Thread Lara Spendier

hi,


/usr/local/tomcat6/bin/shutdown.sh
/usr/local/tomcat6/bin/startup.sh



The shutdown.sh script will probably return before Tomcat has completely
stopped running, which means that the startup.sh script will try to
start Tomcat before the previous instance has exited.
  

yeah, I thought so as well.


What does the log indicate when you're shutting down Tomcat?
How long does it take?
  
Good point, I have to look into this, but at the moment it is not 
possible for me to shut down the instance.

Maybe you have a problem that you're not aware of. A more recent
version of Tomcat may assist you with this, as it contains some
detection that adds messages to the logs when it finds potential
problems during shutdown.

Once you know how long it *should* take to shutdown, under normal
conditions, have a look at the usage statement of
/usr/local/tomcat6/bin/catalina.sh for some options on forcibly shutting
Tomcat down after a time limit.
  
Okay, then this is what I'm going to do next. Thank you very much for 
your quick response and your advice (also regarding the warnings etc.)!


Regards,
Lara

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



Re: Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread Pid
On 21/04/2010 09:49, Pid wrote:
> On 21/04/2010 09:35, Goo Sam Kong wrote:
>> Oops, type too fast. I want catalina.out to be rotate daily but Tomcat
>> give me extra files (catalina.out.1.gz, catalina.out.2.gz...catalina.
>> out.30.gz). I don't want those extra files. Any chance to disable that?
> 
> Sorry, my mistake, I misread your email.
> 
> Also:
> 
> http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html
> 
> seems to say that DailyRollingFileAppender isn't a good choice.
> 
>> The extra files are generated by Tomcat by default? I do not specify
>> those file rotation anywhere.
> 
> Tomcat doesn't tar & gzip files by default.  How are you starting
> Tomcat, using a script like /etc/init.d/tomcat?

(I need a coffee.)

So, I'm not asking the right questions here.  To recap:

1. What log files *are* being generated?  Are you getting
catalina.2010-04-01.log, catalina.2010-04-02.log etc?

2. If so, are they in addition to the catalina.1.tar.gz type files?

3. How big are is the compressed tar.gz and and how big is the file when
it's unpacked?

4. Did you post the entire log4j.properties or are there other parts to
it?  E.g. Are there MaxBackupIndex and MaxFileSize settings?  If not,
try adding one set to -1 and 0.


p


>> On 21 April 2010 16:32, Goo Sam Kong > > wrote:
>>
>> I want catalina.out to be rotate daily but Tomcat give me extra
>> files (catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I
>> don't those extra files. Any chance to disable that?
>>
>>
>> On 21 April 2010 16:26, Pid > > wrote:
>>
>> On 21/04/2010 09:07, Goo Sam Kong wrote:
>> > Hi,
>> >
>> > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0
>> update 7 on RedHat
>> > Linux server.
>> >
>> > I followed the instructions on
>> > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
>> > commons-logging-1.0.4.jar and log4j.jar into
>> $CATALINA_HOME/common/lib
>> > directory.
>> >
>> > and created log4j.properties in $CATALINA_HOME/common/classes
>> directory as
>> > below:
>> >
>> > log4j.rootLogger=info, CATALINA
>> > log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
>> > log4j.appender.CATALINA.DatePattern='.'-MM-dd
>> > log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
>> > log4j.appender.CATALINA.threshold=info
>> > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
>> > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} -
>> %m%n
>> >
>> > After couple of days, I saw some catalina.out files suffix
>> with ".x.gz",
>> > where x is number range from 1 to 30. May I know to get rid of
>> these files?
>> >
>> > I only want log4j to handle the file rotation as configured in
>> > log4j.properties.
>>
>> You've configured a DailyRollingFileAppender with DatePattern
>> DatePattern set to ".-MM-dd" so the log files are being
>> rotated daily.
>>
>> What were you intending it to do?
>>
>>
>> p
>>
>>
>>
>> > Thank you.
>> >
>> > Regards,
>> > SamKong Goo
>> >
>>
>>
>>
>>
> 
> 
> 
> 




signature.asc
Description: OpenPGP digital signature


seperating content from the application

2010-04-21 Thread M.H.G. Emmerig


Hello

Our current configuration:

We are running tomcat 6.0.16 on windows 2003 enterprise.

We have a website which consists of an application part and a content part.
Both are in the same folder structure, eg.

webapps\Root\applicationfiles
webapps\Root\content\publications
webapps\Root\content\images

the application comes as a war file and the content is placed via another
process.

the folder structure is placed on a windows share.


Our current problem:

Whenever there is a problem with the share, the application crashes,
because tomcat can't find the application files anymore.
When the share comes back online, tomcat does not recover from the failure
and a restart is the only option.

Now I have the following questions:

I think separating the application from the content and placing the
application local to tomcat (basically on the same machine)
will solve the recovery issue.
I know placing everything local to the tomcat will be the best way and
gives the best performance, but at the moment that is not an option.

The questions

- Will placing the app local to the tomcat solve the recovery issue?
- Is there an easy way to seperate the app and the content, ie. some sort
of pathsetting ?


regards, Milko





Please consider the environment before printing this email.

De informatie verzonden met dit e-mailbericht is vertrouwelijk en
uitsluitend bestemd voor de geadresseerde. Indien u als niet-geadresseerde
dit bericht ontvangt, wordt u verzocht direct de afzender hierover te
informeren en het bericht te vernietigen. Gebruik van informatie door
onbevoegden, openbaarmaking of vermenigvuldiging  is verboden en kan leiden
tot aansprakelijkheid. De afzender is niet aansprakelijk in geval van
onjuiste overbrenging van het e-mailbericht en/of bij ontijdige ontvangst
daarvan.

The information transmitted is confidential and intended only for the
person or entity to whom or which it is addressed. If you are not the
intended recipient of this communication, please inform us immediately and
destroy this communication. Unauthorised use, disclosure or copying of
information is strictly prohibited and may entail liability. The sender
accepts no liability for improper transmission of this communication nor
for any delay in its receipt.

Re: Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread Pid
On 21/04/2010 09:35, Goo Sam Kong wrote:
> Oops, type too fast. I want catalina.out to be rotate daily but Tomcat
> give me extra files (catalina.out.1.gz, catalina.out.2.gz...catalina.
> out.30.gz). I don't want those extra files. Any chance to disable that?

Sorry, my mistake, I misread your email.

Also:

http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html

seems to say that DailyRollingFileAppender isn't a good choice.

> The extra files are generated by Tomcat by default? I do not specify
> those file rotation anywhere.

Tomcat doesn't tar & gzip files by default.  How are you starting
Tomcat, using a script like /etc/init.d/tomcat?


p


> On 21 April 2010 16:32, Goo Sam Kong  > wrote:
> 
> I want catalina.out to be rotate daily but Tomcat give me extra
> files (catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I
> don't those extra files. Any chance to disable that?
> 
> 
> On 21 April 2010 16:26, Pid  > wrote:
> 
> On 21/04/2010 09:07, Goo Sam Kong wrote:
> > Hi,
> >
> > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0
> update 7 on RedHat
> > Linux server.
> >
> > I followed the instructions on
> > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
> > commons-logging-1.0.4.jar and log4j.jar into
> $CATALINA_HOME/common/lib
> > directory.
> >
> > and created log4j.properties in $CATALINA_HOME/common/classes
> directory as
> > below:
> >
> > log4j.rootLogger=info, CATALINA
> > log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.CATALINA.DatePattern='.'-MM-dd
> > log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
> > log4j.appender.CATALINA.threshold=info
> > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
> > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} -
> %m%n
> >
> > After couple of days, I saw some catalina.out files suffix
> with ".x.gz",
> > where x is number range from 1 to 30. May I know to get rid of
> these files?
> >
> > I only want log4j to handle the file rotation as configured in
> > log4j.properties.
> 
> You've configured a DailyRollingFileAppender with DatePattern
> DatePattern set to ".-MM-dd" so the log files are being
> rotated daily.
> 
> What were you intending it to do?
> 
> 
> p
> 
> 
> 
> > Thank you.
> >
> > Regards,
> > SamKong Goo
> >
> 
> 
> 
> 






signature.asc
Description: OpenPGP digital signature


UTF-8 encoding in Tomcat 6.0

2010-04-21 Thread Mircea LUTIC
Hello,


I'm having trouble convincing tomcat 6.0 to take UTF-8 strings.
I created an encoding filter with no luck. 

/**
Here is the Utf8 Filter that fails for me in 
Tomcat 6.0.20 / Eclipse-Galileo / Windows Vista (6.0.6002) <---> Firefox 3.6.3.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)
Everything is on my  laptop (http://localhost:8060).

What I do is create a GET string (based on parameters from a 
showModalDialog)
by script and send it (from Firefox) to the (localhost) server 
which is running under eclipse with a breakpoint in the EncodingFilter.

Note that the system locale is ro_RO (may have an influence)

 * 
 * set in appl/WebContent/web.xml:
 * 
 
EncodingFilter
ro.lutic.transcode.EncodingFilter

encoding
UTF-8



 * 
 * set in tomcat/conf/server.xml at 

http://www.w3.org/TR/html4/loose.dtd";>



UTF-8

function send()
{

window.location="test.jsp?Name=larevolu%C8%9Bie";//"test.jsp?Name="+escape(Utf8encode("larevoluție"))
}



send


/* 
 *
 * (C) Mircea Lutic Inc.  All rights reserved.
 *
 * DO NOT REDISTRIBUTE THIS SOFTWARE IN ANY WAY WITHOUT THE EXPRESSED
 * WRITTEN PERMISSION OF THE AUTHOR.
 *
 *  v.1.0 2009-03-30 created by mircea_lu...@yahoo.com
 *
 * 
 * Modification Log 
 */
package ro.lutic.transcode;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

/**
 * Servlet Filter implementation class EncodingFilter
 */
/**
Here is the Utf8 Filter that fails for me in Tomcat 6.0.20 / 
Eclipse-Galileo / Windows Vista (6.0.6002) <---> Firefox 3.6.3.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode)
Everything is on my localhost laptop.

What I do is create a GET string (based on parameters from a 
showModalDialog)
by script and send it (from Firefox) to the (localhost) server.

Note that the locale is ro_RO (may have an influence)

 * 
 * set in appl/WebContent/web.xml:
 * 
 
EncodingFilter
ro.lutic.transcode.EncodingFilter

encoding
UTF-8



 * 
 * set in tomcat/conf/server.xml at 
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Re: Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread Goo Sam Kong
Oops, type too fast. I want catalina.out to be rotate daily but Tomcat give
me extra files (catalina.out.1.gz, catalina.out.2.gz...catalina.
out.30.gz). I don't want those extra files. Any chance to disable that?

The extra files are generated by Tomcat by default? I do not specify those
file rotation anywhere.


On 21 April 2010 16:32, Goo Sam Kong  wrote:

> I want catalina.out to be rotate daily but Tomcat give me extra files
> (catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I don't those
> extra files. Any chance to disable that?
>
>
> On 21 April 2010 16:26, Pid  wrote:
>
>> On 21/04/2010 09:07, Goo Sam Kong wrote:
>> > Hi,
>> >
>> > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0 update 7 on
>> RedHat
>> > Linux server.
>> >
>> > I followed the instructions on
>> > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
>> > commons-logging-1.0.4.jar and log4j.jar into $CATALINA_HOME/common/lib
>> > directory.
>> >
>> > and created log4j.properties in $CATALINA_HOME/common/classes directory
>> as
>> > below:
>> >
>> > log4j.rootLogger=info, CATALINA
>> > log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
>> > log4j.appender.CATALINA.DatePattern='.'-MM-dd
>> > log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
>> > log4j.appender.CATALINA.threshold=info
>> > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
>> > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} - %m%n
>> >
>> > After couple of days, I saw some catalina.out files suffix with ".x.gz",
>> > where x is number range from 1 to 30. May I know to get rid of these
>> files?
>> >
>> > I only want log4j to handle the file rotation as configured in
>> > log4j.properties.
>>
>> You've configured a DailyRollingFileAppender with DatePattern
>> DatePattern set to ".-MM-dd" so the log files are being rotated daily.
>>
>> What were you intending it to do?
>>
>>
>> p
>>
>>
>>
>> > Thank you.
>> >
>> > Regards,
>> > SamKong Goo
>> >
>>
>>
>>
>


Re: Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread Goo Sam Kong
I want catalina.out to be rotate daily but Tomcat give me extra files
(catalina.out.1.gz, catalina.out.2.gz...catalina.out.30.gz). I don't those
extra files. Any chance to disable that?

On 21 April 2010 16:26, Pid  wrote:

> On 21/04/2010 09:07, Goo Sam Kong wrote:
> > Hi,
> >
> > I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0 update 7 on
> RedHat
> > Linux server.
> >
> > I followed the instructions on
> > http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
> > commons-logging-1.0.4.jar and log4j.jar into $CATALINA_HOME/common/lib
> > directory.
> >
> > and created log4j.properties in $CATALINA_HOME/common/classes directory
> as
> > below:
> >
> > log4j.rootLogger=info, CATALINA
> > log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
> > log4j.appender.CATALINA.DatePattern='.'-MM-dd
> > log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
> > log4j.appender.CATALINA.threshold=info
> > log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
> > log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} - %m%n
> >
> > After couple of days, I saw some catalina.out files suffix with ".x.gz",
> > where x is number range from 1 to 30. May I know to get rid of these
> files?
> >
> > I only want log4j to handle the file rotation as configured in
> > log4j.properties.
>
> You've configured a DailyRollingFileAppender with DatePattern
> DatePattern set to ".-MM-dd" so the log files are being rotated daily.
>
> What were you intending it to do?
>
>
> p
>
>
>
> > Thank you.
> >
> > Regards,
> > SamKong Goo
> >
>
>
>


Re: Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread Pid
On 21/04/2010 09:07, Goo Sam Kong wrote:
> Hi,
> 
> I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0 update 7 on RedHat
> Linux server.
> 
> I followed the instructions on
> http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
> commons-logging-1.0.4.jar and log4j.jar into $CATALINA_HOME/common/lib
> directory.
> 
> and created log4j.properties in $CATALINA_HOME/common/classes directory as
> below:
> 
> log4j.rootLogger=info, CATALINA
> log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
> log4j.appender.CATALINA.DatePattern='.'-MM-dd
> log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
> log4j.appender.CATALINA.threshold=info
> log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
> log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} - %m%n
> 
> After couple of days, I saw some catalina.out files suffix with ".x.gz",
> where x is number range from 1 to 30. May I know to get rid of these files?
> 
> I only want log4j to handle the file rotation as configured in
> log4j.properties.

You've configured a DailyRollingFileAppender with DatePattern
DatePattern set to ".-MM-dd" so the log files are being rotated daily.

What were you intending it to do?


p



> Thank you.
> 
> Regards,
> SamKong Goo
> 




signature.asc
Description: OpenPGP digital signature


Logging Requirement in Tomcat 5.5.16

2010-04-21 Thread Goo Sam Kong
Hi,

I am using Log4j logging in Tomcat 5.5.16 with JDK 1.5.0 update 7 on RedHat
Linux server.

I followed the instructions on
http://tomcat.apache.org/tomcat-5.5-doc/logging.html to copy the
commons-logging-1.0.4.jar and log4j.jar into $CATALINA_HOME/common/lib
directory.

and created log4j.properties in $CATALINA_HOME/common/classes directory as
below:

log4j.rootLogger=info, CATALINA
log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CATALINA.DatePattern='.'-MM-dd
log4j.appender.CATALINA.File=${catalina.home}/logs/catalina.out
log4j.appender.CATALINA.threshold=info
log4j.appender.CATALINA.layout=org.apache.log4j.PatternLayout
log4j.appender.CATALINA.layout.ConversionPattern=%d:%p %c{2} - %m%n

After couple of days, I saw some catalina.out files suffix with ".x.gz",
where x is number range from 1 to 30. May I know to get rid of these files?

I only want log4j to handle the file rotation as configured in
log4j.properties.

Thank you.

Regards,
SamKong Goo


Re: Tomcat fails on restart: BindException

2010-04-21 Thread Pid
On 21/04/2010 08:17, Lara Spendier wrote:
> Dear list,
> 
> 
> I'm really hoping that someone of you is able to help me with my problem!
> 
> Our system: Debian Lenny, Tomcat 6.0.18, mod_jk, Apache 2.2

6.0.18 is getting on now, plan an upgrade of your server(s).

> With the new version of the web application we're using, we have to
> deploy a war-file in tomcat. Everything worked fine at the beginning,
> but in the last week we experienced some problems with tomcat because we
> got the "Service Temporary Unavailable"-Page every now and then. We have
> to restart tomcat every night and I assume that our problem has
> something to do with that. The restart is happening with a cron
> job/shell script that looks like that:
> #!/bin/bash
> cd /root
> /usr/local/tomcat6/bin/shutdown.sh
> /usr/local/tomcat6/bin/startup.sh

The shutdown.sh script will probably return before Tomcat has completely
stopped running, which means that the startup.sh script will try to
start Tomcat before the previous instance has exited.

> In the last week I got a "Service temporary unavailable"-message in the
> morning (every 2 days) and when I got such a message, the log contained
> this error messages:
> 
> Apr 21, 2010 4:35:01 AM org.apache.coyote.http11.Http11Protocol pause
> INFO: Pausing Coyote HTTP/1.1 on http-8081
> Apr 21, 2010 4:35:02 AM org.apache.catalina.core.StandardService stop
> INFO: Stopping service Catalina
> Apr 21, 2010 4:35:31 AM
> org.apache.tomcat.util.digester.SetPropertiesRule begin
> WARNING: [SetPropertiesRule]{Server} Setting property 'debug' to '0' did
> not find a matching property.

You have a debug attribute on the Server element, remove it to clear
this error.

> Apr 21, 2010 4:35:32 AM
> org.apache.tomcat.util.digester.SetPropertiesRule begin
> WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
> property 'debug' to '4' did not find a matching property.

Same here.

> Apr 21, 2010 4:35:32 AM org.apache.coyote.http11.Http11Protocol init
> SEVERE: Error initializing endpoint
> java.net.BindException: Address already in use:8081

There's already a service running on port 8081.
Check that the previous Tomcat actually shutdown completely.

> at
> org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:502)



> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:412)
> Apr 21, 2010 4:35:32 AM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 312 ms
> Apr 21, 2010 4:35:32 AM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Apr 21, 2010 4:35:32 AM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
> Apr 21, 2010 4:35:32 AM org.apache.catalina.loader.WebappClassLoader
> validateJarFile
> INFO:
> validateJarFile(/usr/local/tomcat6/webapps/olat/WEB-INF/lib/geronimo-spec-servlet-2.4-rc4.jar)
> - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
> javax/servlet/Servlet.class

You have a Servlet API jar in your webapp (you definitely shouldn't
have), remove it to remove this error.

> Apr 21, 2010 4:35:41 AM org.apache.catalina.realm.JAASRealm setContainer
> INFO: Set JAAS app name Catalina
> Apr 21, 2010 4:35:42 AM org.apache.coyote.http11.Http11Protocol start
> SEVERE: Error starting endpoint
> java.net.BindException: Address already in use:8081

...

> LifecycleException:  service.getName(): "Catalina";  Protocol handler
> start failed: java.net.BindException: Address already in use:8081

As above, same error.

> So, I think the problem is: when shutting down tomcat, the
> Http11Protocol is not shut down but Tomcat tries to start it up anyway
> so the "SEVERE: Error starting point" comes up with the BindException
> that the Address is already in use. So, one of my first ideas was to put
> a sleep in between the shutdown.sh and the startup.sh, and it works when
> calling the script manually (tried it like a hundred times on the test
> server). But I really do not understand why tomcat hasn't started up
> today! Maybe this is also worth knowing: the first two error messages
> also appear in the log when tomcat restarts properly, but for the rest,
> there are no error messages at all.

What does the log indicate when you're shutting down Tomcat?
How long does it take?

Maybe you have a problem that you're not aware of.  A more recent
version of Tomcat may assist you with this, as it contains some
detection that adds messages to the logs when it finds potential
problems during shutdown.

Once you know how long it *should* take to shutdown, under normal
conditions, have a look at the usage statement of
/usr/local/tomcat6/bin/catalina.sh for some options on forcibly shutting
Tomcat down after a time limit.


p


> I'm kind of desperate because I really don't know what to do. Might
> there be some problem with the shell script? Or the cron job? Is there a
> known tomcat bug or anything else? I really really hope that someone of
> you is

Re: JSESSIONID being lost

2010-04-21 Thread Ron McNulty

Hi Jim

There may be another mis-configured server out there that produces 
JSESSIONID cookies with a domain-wide scope. SAP portals are a known 
problem.


Best of luck

Regards

Ron

- Original Message - 
From: "Jim Goodspeed" 

To: 
Sent: Wednesday, April 21, 2010 10:47 AM
Subject: JSESSIONID being lost



I'm hoping someone may have some insight into a difficult problem we are
having.  We have a situation where the JSESSIONID seems to get lost
somewhere in a users transaction - the result is they get kicked back to 
the
applications login page (no sessionid so the app thinks they haven't 
logged

in).

Our current setup is two hardware load balancers (layer 4) in front of two
Apache servers (2.2.14) which sit in front of two tomcat servers (6.0.20).
The hardware load balancers load balance apache and apache load balances
tomcat using AJP via mod_proxy.  Apache and Tomcat are running on RHEL4
32-bit.  The JVM is 1.6.

This issue first popped up when we moved to the above architecture -
previously we had no hardware load balancers and only one apache server
balancing two tomcat servers (still with AJP via mod_proxy).  Initial
thoughts were that it had something to do with either the 2nd apache 
server

or the load balancers.

One way we have made this better (but not fixed) was to turn off one of 
the
tomcat servers so that requests could only go to one place - we thought 
that

the users session was being sent to the other tomcat server even though we
were using sticky sessions.  This was our temporary fix until we could
implement clustering, but today we found that users were still being 
kicked

back to the login page even with only one tomcat server running.  In the
interim we have turned off one of the apache servers to see if that helps
(so two hardware load balancers, one apache server and one tomcat server).

This problem is intermittent and almost impossible to reproduce, but it 
does

seem to happen more under heavy load.  Any insight would be very much
appreciated.  If it would help I can post our apache and tomcat
configurations.


Thanks in advance.




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



Re: Installing auto updates for my webapp hosted on Tomcat

2010-04-21 Thread Pid
On 21/04/2010 00:26, Anand HS wrote:
> Hi,
> I have a webapplication deployed in tomcat and have been asked to develop an
> auto updater that can grab a new update and apply the updates to my webapp.
> I want to ask the community to see if there are 'hooks' tomcat provides to
> achieve this.

No hooks.

> In essence here is what Im expecting to achieve -
> 
> 1. A simple agent ( can be a java program inside my web app itself ) senses
> there is an update.

OK so far.

> 2. when an update is available, it stops the tomcat server.

Possible, but somewhat unwise.  You can update a webapp without
restarting Tomcat.

> 3. Applies the update ( similar to redeploy along with configuration file
> changes ) .

Not too complicated to replace a file, if you have a program running.

> 4. restarts the tomcat.

If the agent runs inside webapp (or Tomcat), then it's not running at
this point so it can't restart Tomcat.

> Some of the ideas Im after are -
> 
> 1. Deploy my updater agent outside of tomcat and hence it can stop and start
> the tomcat servers.

If you want to restart the servers themselves, the agent will need to be
running outside the container, yes.

> 2. Have the updater agent as part of my webapp itself and with the help of
> Tomcat API ( ? ) , restart the application.

What would such an API do?


p

> I need advice from the community on other approaches as well as any support
> tomcat provides out of the box.
> 
> Thanks,
> Anand
> 




signature.asc
Description: OpenPGP digital signature


Tomcat fails on restart: BindException

2010-04-21 Thread Lara Spendier

Dear list,


I'm really hoping that someone of you is able to help me with my  
problem!


Our system: Debian Lenny, Tomcat 6.0.18, mod_jk, Apache 2.2

With the new version of the web application we're using, we have to  
deploy a war-file in tomcat. Everything worked fine at the beginning,  
but in the last week we experienced some problems with tomcat because  
we got the "Service Temporary Unavailable"-Page every now and then. We  
have to restart tomcat every night and I assume that our problem has  
something to do with that. The restart is happening with a cron job/ 
shell script that looks like that:

#!/bin/bash
cd /root
/usr/local/tomcat6/bin/shutdown.sh
/usr/local/tomcat6/bin/startup.sh

In the last week I got a "Service temporary unavailable"-message in  
the morning (every 2 days) and when I got such a message, the log  
contained this error messages:


Apr 21, 2010 4:35:01 AM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8081
Apr 21, 2010 4:35:02 AM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Apr 21, 2010 4:35:31 AM  
org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server} Setting property 'debug' to '0'  
did not find a matching property.
Apr 21, 2010 4:35:32 AM  
org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context}  
Setting property 'debug' to '4' did not find a matching property.

Apr 21, 2010 4:35:32 AM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use:8081
at  
org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:502)
at  
org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
at  
org.apache.catalina.connector.Connector.initialize(Connector.java:1058)
at  
org 
.apache.catalina.core.StandardService.initialize(StandardService.java: 
677)
at  
org.apache.catalina.core.StandardServer.initialize(StandardServer.java: 
795)

at org.apache.catalina.startup.Catalina.load(Catalina.java:530)
at org.apache.catalina.startup.Catalina.load(Catalina.java:550)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at  
sun 
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
39)
at  
sun 
.reflect 
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 
25)

at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java: 
260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java: 
412)

Apr 21, 2010 4:35:32 AM org.apache.catalina.startup.Catalina load
SEVERE: Catalina.start
LifecycleException:  Protocol handler initialization failed:  
java.net.BindException: Address already in use:8081
at  
org.apache.catalina.connector.Connector.initialize(Connector.java:1060)
at  
org 
.apache.catalina.core.StandardService.initialize(StandardService.java: 
677)
at  
org.apache.catalina.core.StandardServer.initialize(StandardServer.java: 
795)

at org.apache.catalina.startup.Catalina.load(Catalina.java:530)
at org.apache.catalina.startup.Catalina.load(Catalina.java:550)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at  
sun 
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 
39)
at  
sun 
.reflect 
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: 
25)

at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java: 
260)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java: 
412)

Apr 21, 2010 4:35:32 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 312 ms
Apr 21, 2010 4:35:32 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Apr 21, 2010 4:35:32 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
Apr 21, 2010 4:35:32 AM org.apache.catalina.loader.WebappClassLoader  
validateJarFile
INFO: validateJarFile(/usr/local/tomcat6/webapps/olat/WEB-INF/lib/ 
geronimo-spec-servlet-2.4-rc4.jar) - jar not loaded. See Servlet Spec  
2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Apr 21, 2010 4:35:41 AM org.apache.catalina.realm.JAASRealm setContainer
INFO: Set JAAS app name Catalina
Apr 21, 2010 4:35:42 AM org.apache.coyote.http11.Http11Protocol start
SEVERE: Error starting endpoint
java.net.BindException: Address already in use:8081
at  
org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:502)
at  
org.apache.tomcat.util.net.JIoEndpoint.start(JIoEndpoint.java:519)
at  
org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:203)
at  
org.apache.catalina.connector.Connec