RE: tomcat starting even after port is in use

2010-07-19 Thread Caldarale, Charles R
> From: sudhir singh rana [mailto:sudhirsinghr...@gmail.com]
> Subject: Re: tomcat starting even after port is in use
> 
> is there any way I can achieve this in 5.5.27

Not via configuration, as far as I know.  You could change the code at lines 
501-508 in org/apache/catalina/startup/Catalin.java from this:

// Start the new server
if (server instanceof Lifecycle) {
try {
server.initialize();
} catch (LifecycleException e) {
log.error("Catalina.start", e);
}
}

to this:

// Start the new server
if (server instanceof Lifecycle) {
try {
server.initialize();
} catch (LifecycleException e) {
if 
(Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE"))
throw new java.lang.Error(e);
else
log.error("Catalina.start", e);
}
}

to match the updated code in 6.0.x, allowing use of the system property.  Or 
just upgrade your Tomcat.

 - Chuck


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


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



Re: APR & Tomcat...

2010-07-19 Thread Tony Anecito
Interesting. I saw that when a static file was around 21K or below a dramatic 
improvement in recorded time in the log for APR. I have not tried with regular 
Apache Web Server to see what I get.

Regards,
-Tony



- Original Message 
From: "Caldarale, Charles R" 
To: Tomcat Users List 
Sent: Mon, July 19, 2010 9:50:59 PM
Subject: RE: APR & Tomcat...

> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Subject: Re: APR & Tomcat...
> 
> My tests show that use of sendFile is dramatically faster 
> than without.

Was that vs BIO or NIO?  As I recall, there is no sendFile capability in BIO, 
so 
both NIO and APR should beat that.

- Chuck


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




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



Re: tomcat starting even after port is in use

2010-07-19 Thread sudhir singh rana
is there any way I can achieve this in 5.5.27

thanks

On Tue, Jul 20, 2010 at 9:15 AM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> > From: sudhir singh rana [mailto:sudhirsinghr...@gmail.com]
> > Subject: Re: tomcat starting even after port is in use
> >
> > I am using tomcat 5.5.27 and problem is that even tomcat
> > got exception due to port in use it initialized my servlet
> > I mean called init function.
>
> Not sure how to avoid that on Tomcat 5.5.27, but if you could move up to
> 6.0 or 7.0, you can set the following system property to true:
>
> org.apache.catalina.startup.EXIT_ON_INIT_FAILURE
>
> The doc is at the end of this page:
> http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you received
> this in error, please contact the sender and delete the e-mail and its
> attachments from all computers.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: APR & Tomcat...

2010-07-19 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Subject: Re: APR & Tomcat...
> 
> My tests show that use of sendFile is dramatically faster 
> than without.

Was that vs BIO or NIO?  As I recall, there is no sendFile capability in BIO, 
so both NIO and APR should beat that.

 - Chuck


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



RE: tomcat starting even after port is in use

2010-07-19 Thread Caldarale, Charles R
> From: sudhir singh rana [mailto:sudhirsinghr...@gmail.com]
> Subject: Re: tomcat starting even after port is in use
> 
> I am using tomcat 5.5.27 and problem is that even tomcat 
> got exception due to port in use it initialized my servlet
> I mean called init function.

Not sure how to avoid that on Tomcat 5.5.27, but if you could move up to 6.0 or 
7.0, you can set the following system property to true:

org.apache.catalina.startup.EXIT_ON_INIT_FAILURE

The doc is at the end of this page:
http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html

 - Chuck


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


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



Re: APR & Tomcat...

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dale,

On 7/19/2010 7:42 PM, Dale Ogilvie wrote:
> Reasons to use httpd being what?

Here are a few ideas:

1. Load balancing
2. Use of mixed Java and non-Java webapps (PHP, Perl, etc.)
3. Use of multiple Tomcat instances behind a single web server

If I thought about it, I could come up with a few more.

> We historically have used httpd and
> mod_proxy_ajp, but less being more I'm considering a tomcat only setup. 

Tomcat-only is a great setup when you have a non-complicated
environment. If you can do it, I'd say "go for it". Fewer attack
vectors, fewer packages to keep up-to-date, etc. Just remember to use
APR+sendFile ;) Or even NIO+sendFile.

> The reason we used httpd in the past was "httpd serves static content
> better".

That reason is no longer valid with a proper configuration.

> One other reason that comes to mind is httpd url rewrite support,
> assuming tomcat can't help in this area. Any others?

tuckey's urlrewrite, though mod_rewrite is much more chainsawy than
urlrewrite.

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

iEYEARECAAYFAkxFGwIACgkQ9CaO5/Lv0PAtCgCfQhy1SRwitWFe/YIcPYLLhp/G
l3EAn1Xl0vj98K8+uLCR/XBN5W5fGs7Q
=+w6j
-END PGP SIGNATURE-

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



Re: APR & Tomcat...

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 7/19/2010 9:57 PM, Caldarale, Charles R wrote:
>> From: Tony Anecito [mailto:adanec...@yahoo.com]
>> Subject: Re: APR & Tomcat...
>>
>> So as to say the Tomcat group did not want to compete 
>> why build the APR?
> 
> Tomcat people did not create it - APR has been around for years.
> It's part of many products (e.g., subversion).
> 
> What the Tomcat group did was provide a JNI interface to APR to allow
> its use with Tomcat directly, primarily because OpenSSL is much
> faster than the pure Java SSE equivalent.  APR provides no
> significant benefits for unencrypted content.

My tests show that use of sendFile is dramatically faster than without.
I did not benchmark SSL.

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

iEYEARECAAYFAkxFGgYACgkQ9CaO5/Lv0PCMCQCgt4f7Banncs4EqYkSE23Uk7CA
k58An1LIVEB4vtipQpkLdkvIfjuzi50y
=1ya/
-END PGP SIGNATURE-

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



Re: tomcat starting even after port is in use

2010-07-19 Thread sudhir singh rana
I am using tomcat 5.5.27 and problem is that even tomcat got exception due
to port in use it initialized my servlet I mean called init function.

thanks

On Mon, Jul 19, 2010 at 10:29 PM, Mark Thomas  wrote:

> > Hi,
> >
> > I started tomcat but tomcat port was in use. Due to this some
> functionality
> > of my program was not working. Tomcat gives the error when port is in use
> > but it comes up. I want tomcat should not come up when port is in use.
> >
> > Can anyone help me
>
> Yes, but only when you provide some basic information such as exactly
> which Tomcat version you are using.
>
> Mark
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: APR & Tomcat...

2010-07-19 Thread Caldarale, Charles R
> From: Tony Anecito [mailto:adanec...@yahoo.com]
> Subject: Re: APR & Tomcat...
> 
> The disadvantages are such as when Tomcat is taken down 
> so does your static content.

So why are you taking Tomcat down?  "Doctor, doctor, it hurts when I do this!"

> I am guessing better security for Apache Web Server 
> versus APR

You're right - you're guessing.  There's no evidence to support that conjecture.

 - Chuck


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


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



RE: APR & Tomcat...

2010-07-19 Thread Caldarale, Charles R
> From: Dale Ogilvie [mailto:dale.ogil...@trimble.co.nz]
> Subject: RE: APR & Tomcat...
> 
> Reasons to use httpd being what?

Serving PHP and as a poor man's load balancer, for starters.

> The reason we used httpd in the past was "httpd serves 
> static content better".

Which hasn't been true for some years.

> One other reason that comes to mind is httpd url rewrite support,

The equivalent for Tomcat is here:
http://www.tuckey.org/urlrewrite/

> /still hoping my tomcat download license doesn't get 
> revoked before tomcat 7 is released/

Too late: Tomcat 7 has been released - albeit still beta.

 - Chuck


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


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



RE: APR & Tomcat...

2010-07-19 Thread Caldarale, Charles R
> From: Tony Anecito [mailto:adanec...@yahoo.com]
> Subject: Re: APR & Tomcat...
> 
> So as to say the Tomcat group did not want to compete 
> why build the APR?

Tomcat people did not create it - APR has been around for years.  It's part of 
many products (e.g., subversion).

What the Tomcat group did was provide a JNI interface to APR to allow its use 
with Tomcat directly, primarily because OpenSSL is much faster than the pure 
Java SSE equivalent.  APR provides no significant benefits for unencrypted 
content.

 - Chuck


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


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



Please remove me from the users emailing list

2010-07-19 Thread lei jiang



RE: APR & Tomcat...

2010-07-19 Thread Richard Maynard
Next experiment can be Varnish in front of Tomcat with APR :) 

I'm having a lot of fun with it with mostly stateless apps and to optimize some 
test projects, but haven't had an opportunity to deploy it in any large 
configuration. It provides a lot of great features and can really be used to 
tune the heck out of static and semi-static content!

--
Richard Maynard

-Original Message-
From: Tony Anecito [mailto:adanec...@yahoo.com] 
Sent: Monday, July 19, 2010 7:42 PM
To: Tomcat Users List
Subject: Re: APR & Tomcat...

I used APR for performance reasons. I was running Apache Web Server and Tomcat 
on the same physical windows server. I mentioned what configuration might be 
faster and was told APR native with Tomcat and it was faster. I might have gone 
from 1.5 to 1.0 milliseconds for JAXWS requests.

The disadvantages are such as when Tomcat is taken down so does your static 
content. Apache Web Server is probably updated more frequently than APR Native. 
I am guessing better security for Apache Web Server versus APR and probably 
more 
that the Tomcat and Apache Web Server teams can agree upon such as load 
balancing.

So APR Native was an experiment for me not a final solution. Time to go back to 
reality.

Thanks,
-Tony



- Original Message 
From: Dale Ogilvie 
To: Tomcat Users List 
Sent: Mon, July 19, 2010 5:42:39 PM
Subject: RE: APR & Tomcat...


Reasons to use httpd being what? We historically have used httpd and
mod_proxy_ajp, but less being more I'm considering a tomcat only setup. 

The reason we used httpd in the past was "httpd serves static content
better".

One other reason that comes to mind is httpd url rewrite support,
assuming tomcat can't help in this area. Any others?

Dale

/still hoping my tomcat download license doesn't get revoked before
tomcat 7 is released/

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Tuesday, 20 July 2010 9:51 a.m.
To: Tomcat Users List
Subject: Re: APR & Tomcat...

There certainly are reasons to use Apache httpd out in front of Tomcat,
but performance isn't one of them.

- -chris

-
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



Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is 
prohibited.
If you receive this transmission in error, please notify us immediately by 
e-mail
at ab...@rackspace.com, and delete the original message.
Your cooperation is appreciated.


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



Re: APR & Tomcat...

2010-07-19 Thread Tony Anecito
I used APR for performance reasons. I was running Apache Web Server and Tomcat 
on the same physical windows server. I mentioned what configuration might be 
faster and was told APR native with Tomcat and it was faster. I might have gone 
from 1.5 to 1.0 milliseconds for JAXWS requests.

The disadvantages are such as when Tomcat is taken down so does your static 
content. Apache Web Server is probably updated more frequently than APR Native. 
I am guessing better security for Apache Web Server versus APR and probably 
more 
that the Tomcat and Apache Web Server teams can agree upon such as load 
balancing.

So APR Native was an experiment for me not a final solution. Time to go back to 
reality.

Thanks,
-Tony



- Original Message 
From: Dale Ogilvie 
To: Tomcat Users List 
Sent: Mon, July 19, 2010 5:42:39 PM
Subject: RE: APR & Tomcat...


Reasons to use httpd being what? We historically have used httpd and
mod_proxy_ajp, but less being more I'm considering a tomcat only setup. 

The reason we used httpd in the past was "httpd serves static content
better".

One other reason that comes to mind is httpd url rewrite support,
assuming tomcat can't help in this area. Any others?

Dale

/still hoping my tomcat download license doesn't get revoked before
tomcat 7 is released/

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Tuesday, 20 July 2010 9:51 a.m.
To: Tomcat Users List
Subject: Re: APR & Tomcat...

There certainly are reasons to use Apache httpd out in front of Tomcat,
but performance isn't one of them.

- -chris

-
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: APR & Tomcat...

2010-07-19 Thread Dale Ogilvie
 
Reasons to use httpd being what? We historically have used httpd and
mod_proxy_ajp, but less being more I'm considering a tomcat only setup. 

The reason we used httpd in the past was "httpd serves static content
better".

One other reason that comes to mind is httpd url rewrite support,
assuming tomcat can't help in this area. Any others?

Dale

/still hoping my tomcat download license doesn't get revoked before
tomcat 7 is released/

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Tuesday, 20 July 2010 9:51 a.m.
To: Tomcat Users List
Subject: Re: APR & Tomcat...

There certainly are reasons to use Apache httpd out in front of Tomcat,
but performance isn't one of them.

- -chris

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



Re: APR & Tomcat...

2010-07-19 Thread Tony Anecito
For each image I would get a small red x. When I hit refresh and it then 
display 
them.

Comments like this on Confluence web site for example explain:

After a bit of Googling came across this:
"Apache Portable Runtime to provide superior scalability, performance" for 
Tomcat 6.
There are comments that when using the APR Tomcat will server static content on 
par with Apache (httpd) server speeds - though I haven't been able to 
personally 
verify this just yet.
 
Or from the Tomcat site itself http://tomcat.apache.org/tomcat-5.5-doc/apr.html:
 
Tomcat can use the Apache Portable Runtime to provide superior scalability, 
performance, and better integration with native server technologies. The Apache 
Portable Runtime is a highly portable library that is at the heart of Apache 
HTTP Server 2.x. APR has many uses, including access to advanced IO 
functionality (such as sendfile, epoll and OpenSSL), OS level functionality 
(random number generation, system status, etc), and native process handling 
(shared memory, NT pipes and Unix sockets). 

>These features allows making Tomcat a general purpose webserver, will enable 
>much better integration with other native web technologies, and overall make 
>Java much more viable as a full fledged webserver platform rather than simply 
>a 
>backend focused technology. 
>
So as to say the Tomcat group did not want to compete why build the APR?

In either case it does not matter for me but I do appreciate the feedback.

Regards,
-Tony


- Original Message 
From: Christopher Schultz 
To: Tomcat Users List 
Sent: Mon, July 19, 2010 3:51:28 PM
Subject: Re: APR & Tomcat...

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tony,

On 7/19/2010 5:21 PM, Tony Anecito wrote:
> First off I get a little red x in the upper left hand corner of the web page.

For the whole page? I thought this was an image problem.

> Yep I agree maybe an upgrade to the latest Tomcat and APR might accomplish 
> fixing the problem but silly me I like to understand an issue before I 
upgrade.

Upgrading is a good idea, but is unlikely to magically fix everything.
I'm unaware of any huge bugs in Tomcat 6.0.20 like "web server doesn't
work at all".

> APR==httpd at least that is what the Apache Web site says and the acronym I 
> put 
>
> up on the title page is about. The Apache Web server group disavow any 
>knowledge 
>
> of APR since they say the Tomcat Group developed to to replace Apache Web 
> Server.

APR != httpd

The "Tomcat Group" neither developed APR nor did they do it to undercut
anything the httpd group is doing. On the contrary, libapr is a project
to help many other projects, including httpd itself.

http://apr.apache.org/
http://apr.apache.org/projects.html
http://en.wikipedia.org/wiki/Apache_Portable_Runtime

> What little info I could find seems to indicate APR uses the ROOT directory  
> under Webapps for html based apps.

APR does nothing of the sort. APR essentially provides two major
capabilities to Tomcat:

1. SSL services using OpenSSL library instead of Java-based SSL
2. "Sendfile" services to serve static content directly from
disk-to-socket with minimal overhead

Both of these features are configured on a  in Tomcat and
will work with any webapp deployed into the container. It has nothing to
do with ROOT or any other specific webapp.

> I will probably go back to Apache Web server as a separate tier. I was trying 
>to 
>
> get better performance using APR + Tomcat and saw some but not enough to 
>justify 
>
> the advantages of a seperate tier.

Apache httpd + Tomcat will always be slower than simply using Tomcat +
APR/sendfile because of the overhead involved in forwarding the requests
back and forth. The only exception might be a site which is almost
exclusively static content and only one or two dynamic resources. In
that case, I might ask why that person was using Java in the first place ;)

There certainly are reasons to use Apache httpd out in front of Tomcat,
but performance isn't one of them.

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

iEYEARECAAYFAkxEyOAACgkQ9CaO5/Lv0PD+ngCdGoi80vMKrjB7UMP9kQKyLaS3
X/UAnjslqqAnc7796Xr14ic5cDEckPYl
=vtNH
-END PGP SIGNATURE-

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




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



Re: IP based request filters for admin/manager

2010-07-19 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Johan,

On 7/18/2010 11:48 PM, Johan Martinez wrote:

Started afresh and got it working finally.

 I tried with and without escape character and both worked.


Probably because . matches '.'.


Yep. :-)

Johan, if you are still there, a bit more explicitly :

The regexp /123.123.123.123/ will match th string "123.123.123.123", but also the strings 
"123#123#123#123" and "123?123X123+123" (and many other similar ones), because in a regexp 
a non-escaped "." matches any single character.


On the other hand, the regexp /123\.123\.123\.123/ will only match the string 
"123.123.123.123", because escaping the "." by a backslash means "a literal dot".



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



Re: SEVERE message from DeltaManager

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

On 7/19/2010 6:00 PM, Mark Thomas wrote:
> On 19/07/2010 22:36, Christopher Schultz wrote:
>> Mark,
>>
>> On 7/19/2010 1:07 PM, Mark Thomas wrote:
>>> Testing shows that it is caused by using async session replication. If
>>> you use synchronous replication that ensures messages are processed on
>>> the receiving nodes in the order they are sent. Asynchronous replication
>>> in conjunction with the fact the the receiving node uses a thread pool
>>> to process messages means that it is possible for messages to be
>>> processed out of sequence. If a session invalidate is processed before
>>> and update then you'll see this error.
>>
>> I am by no means an expert on Tomcat clustering (nor any other container
>> clustering for that matter), but it seems to me that a potential
>> solution would be to use a replication queue something like this:
>>
>> Client event -> server queue -> event handled
>>  ^^
>>  server thread poolserver replication thread pool
>>
>> If the queue were synchronized and a priority queue (based upon
>> timestamp) or queueing were guaranteed on the basis of event reception,
>> then the use of asynchronous versus synchronous replication should
>> always result in deterministic replication behavior.
> 
> Not sure what you are proposing here.
> 
> Async replication means that multiple messages for a single session may
> be sent from node A before node B has a chance to process them.

Duh. No amount of queuing can fix that.

I obviously wasn't thinking very clearly... I was thinking about a
server (meaning the receiving node) processing the events out-of-order
after it had received them (or as part of a non-deterministic
event-processing thread priority) rather than the client failing to send
them in a timely manner.

> I think this comes down to a simple trade-off between performance
> (async) and deterministic (sync) behaviour. I think the constraints you
> would have to impose to make the async deterministic would remove most
> of the benefits.

Agreed.

Something that could be done is that this error message might be demoted
from SEVERE to WARNING if async replication is being used.

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

iEYEARECAAYFAkxEzIwACgkQ9CaO5/Lv0PDjogCeNhn487GRHsNUG4ys1FA7Gsss
VNAAnibzqtKWhVx7GSw1wNbqj9aMM4XK
=q+n/
-END PGP SIGNATURE-

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



Re: How to retrieve persisted session

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ashish,

On 7/19/2010 4:48 PM, Ashish Kulkarni wrote:
> Is there a way i can save this session cookie, so i can access it later? is
> it possible

Set the maxAge of the session to something other than -1 (the default,
which means "this cookie will die when the browser shuts down").

> How does yahoo or gmail keep me signed on for 2-3 days

See above.

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

iEYEARECAAYFAkxEy5YACgkQ9CaO5/Lv0PAZhACfTxY8EWC5c1yhNbwA64AgLPRH
9NQAoKxsfFPaqiX/2WHLpZkcg6VAjAAw
=4ABC
-END PGP SIGNATURE-

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



Re: SEVERE message from DeltaManager

2010-07-19 Thread Mark Thomas
On 19/07/2010 22:36, Christopher Schultz wrote:
> Mark,
> 
> On 7/19/2010 1:07 PM, Mark Thomas wrote:
>> Testing shows that it is caused by using async session replication. If
>> you use synchronous replication that ensures messages are processed on
>> the receiving nodes in the order they are sent. Asynchronous replication
>> in conjunction with the fact the the receiving node uses a thread pool
>> to process messages means that it is possible for messages to be
>> processed out of sequence. If a session invalidate is processed before
>> and update then you'll see this error.
> 
> I am by no means an expert on Tomcat clustering (nor any other container
> clustering for that matter), but it seems to me that a potential
> solution would be to use a replication queue something like this:
> 
> Client event -> server queue -> event handled
>  ^^
>  server thread poolserver replication thread pool
> 
> If the queue were synchronized and a priority queue (based upon
> timestamp) or queueing were guaranteed on the basis of event reception,
> then the use of asynchronous versus synchronous replication should
> always result in deterministic replication behavior.

Not sure what you are proposing here.

Async replication means that multiple messages for a single session may
be sent from node A before node B has a chance to process them.

The issue is that if multiple session update messages from node A are in
node B's input queue and B processes that queue with multiple threads,
it is possible - depending on thread prioritisation - for node B to
process the messages out of order even if node B removes them from its
queue in order.

Fixing it would require limiting node B to processing a single message
per session from node A at a time. (assuming messages were send and
received in order).

I think this comes down to a simple trade-off between performance
(async) and deterministic (sync) behaviour. I think the constraints you
would have to impose to make the async deterministic would remove most
of the benefits.

As an aside, if a UA sends multiple requests in parallel to a single
node then you have little control of the order that events will occur in
the session anyway.

> I'm interested to know why synchronous replication solves this
> problem... is it a client event queuing problem when asynchronous
> replication is used? Or does either the client or the server serialize
> processing of replication events in some way only when synchronous
> replication is being used?

Synchronous replication essentially ensures that node B only ever has at
most one message from node A for a single session and therefore has to
process them in order.

Mark



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



Re: APR & Tomcat...

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tony,

On 7/19/2010 5:21 PM, Tony Anecito wrote:
> First off I get a little red x in the upper left hand corner of the web page.

For the whole page? I thought this was an image problem.

> Yep I agree maybe an upgrade to the latest Tomcat and APR might accomplish 
> fixing the problem but silly me I like to understand an issue before I 
> upgrade.

Upgrading is a good idea, but is unlikely to magically fix everything.
I'm unaware of any huge bugs in Tomcat 6.0.20 like "web server doesn't
work at all".

> APR==httpd at least that is what the Apache Web site says and the acronym I 
> put 
> up on the title page is about. The Apache Web server group disavow any 
> knowledge 
> of APR since they say the Tomcat Group developed to to replace Apache Web 
> Server.

APR != httpd

The "Tomcat Group" neither developed APR nor did they do it to undercut
anything the httpd group is doing. On the contrary, libapr is a project
to help many other projects, including httpd itself.

http://apr.apache.org/
http://apr.apache.org/projects.html
http://en.wikipedia.org/wiki/Apache_Portable_Runtime

> What little info I could find seems to indicate APR uses the ROOT directory  
> under Webapps for html based apps.

APR does nothing of the sort. APR essentially provides two major
capabilities to Tomcat:

1. SSL services using OpenSSL library instead of Java-based SSL
2. "Sendfile" services to serve static content directly from
disk-to-socket with minimal overhead

Both of these features are configured on a  in Tomcat and
will work with any webapp deployed into the container. It has nothing to
do with ROOT or any other specific webapp.

> I will probably go back to Apache Web server as a separate tier. I was trying 
> to 
> get better performance using APR + Tomcat and saw some but not enough to 
> justify 
> the advantages of a seperate tier.

Apache httpd + Tomcat will always be slower than simply using Tomcat +
APR/sendfile because of the overhead involved in forwarding the requests
back and forth. The only exception might be a site which is almost
exclusively static content and only one or two dynamic resources. In
that case, I might ask why that person was using Java in the first place ;)

There certainly are reasons to use Apache httpd out in front of Tomcat,
but performance isn't one of them.

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

iEYEARECAAYFAkxEyOAACgkQ9CaO5/Lv0PD+ngCdGoi80vMKrjB7UMP9kQKyLaS3
X/UAnjslqqAnc7796Xr14ic5cDEckPYl
=vtNH
-END PGP SIGNATURE-

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



Re: Unable to get Tomcat 7 to work in Eclipse

2010-07-19 Thread Austin Shelton
The resource for my web page servlet can't be located. This was not the case
with Tomcat 6.

Nobody complained once I started getting a good Tomcat launch.

There are no logs in the Tomcat home.

On Mon, Jul 19, 2010 at 1:56 PM, Pid  wrote:

> On 19/07/2010 20:13, Austin Shelton wrote:
> > Hi,
> >
> > I am unable to get Tomcat 7.0.0 to work correctly with Eclipse Helios.
> > Tomcat 6 was working just fine; the problem occurred when I upgraded to
> > Tomcat 7.0. It complained about "Resource Not found. I now have it
> working
> > to the extent that no errors or warning show up in the console. But I do
> not
> > get my page, without errors, to display. Any tips on solving this
> problem?
> >
> > Thanks
>
> Which resource isn't found?
>
> What complained, your browser, Eclipse, or Tomcat?
>
> What do the Tomcat logs say?  (Note: they may be in a different location
> than a normal Tomcat installation)
>
>
> p
>
>


Re: SEVERE message from DeltaManager

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

On 7/19/2010 1:07 PM, Mark Thomas wrote:
> Testing shows that it is caused by using async session replication. If
> you use synchronous replication that ensures messages are processed on
> the receiving nodes in the order they are sent. Asynchronous replication
> in conjunction with the fact the the receiving node uses a thread pool
> to process messages means that it is possible for messages to be
> processed out of sequence. If a session invalidate is processed before
> and update then you'll see this error.

I am by no means an expert on Tomcat clustering (nor any other container
clustering for that matter), but it seems to me that a potential
solution would be to use a replication queue something like this:

Client event -> server queue -> event handled
 ^^
 server thread poolserver replication thread pool

If the queue were synchronized and a priority queue (based upon
timestamp) or queueing were guaranteed on the basis of event reception,
then the use of asynchronous versus synchronous replication should
always result in deterministic replication behavior.

I'm interested to know why synchronous replication solves this
problem... is it a client event queuing problem when asynchronous
replication is used? Or does either the client or the server serialize
processing of replication events in some way only when synchronous
replication is being used?

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

iEYEARECAAYFAkxExXAACgkQ9CaO5/Lv0PDeegCgvZeiKaApROcZguagjOmEcDhB
GbcAnjg48ECuBvfYBRau0hMjnZlyYYi3
=UnUy
-END PGP SIGNATURE-

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



Re: Tomcat7 HTTPS APR Performance

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Shivani,

On 7/19/2010 2:02 PM, shivanic wrote:
> I would recheck the performance stats with 100 users with HTTP protocol
> instead of HTTPS and revert back. Mladen Turk  has mentioned that only
> constant response time (and not allowing the factors that make it vary like
> access to external resources)  - can determine the absolute picture of the
> container behavior. I agree on that point - however as you can see the
> differences are huge  - specifically the average response time wrt op like
> login  to application. Login involves a simple ldap bind and the test case
> involves only login with correct pwd. 

Still, you ought to be able to login faster than even 38 seconds on
average if all you're doing is a simple LDAP authentication. Yes,
Tomcat7 appears to take ~3x as long, but your baseline time still
stinks. Perhaps you have a hideous misconfiguration somewhere?

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

iEYEARECAAYFAkxEw6YACgkQ9CaO5/Lv0PDgqgCgj8Q0jNbxpMPLmX/Zqg5nY/py
yEsAniVn/6oya0vVGqaGM/ezmXbjdXsX
=ShZX
-END PGP SIGNATURE-

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



Re: IP based request filters for admin/manager

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Johan,

On 7/18/2010 11:48 PM, Johan Martinez wrote:
> Started afresh and got it working finally.
> 
>  I tried with and without escape character and both worked.

Probably because . matches '.'.

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

iEYEARECAAYFAkxEwrcACgkQ9CaO5/Lv0PAi4ACgw79srQYS9kezOpXogU/9TrU9
vcIAn1gIBO8SNyJkmml5mKX/KWDCKWNE
=hbFT
-END PGP SIGNATURE-

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



Re: APR & Tomcat...

2010-07-19 Thread Tony Anecito
Hi Pid

First off I get a little red x in the upper left hand corner of the web page.

Yep I agree maybe an upgrade to the latest Tomcat and APR might accomplish 
fixing the problem but silly me I like to understand an issue before I upgrade.

APR==httpd at least that is what the Apache Web site says and the acronym I put 
up on the title page is about. The Apache Web server group disavow any 
knowledge 
of APR since they say the Tomcat Group developed to to replace Apache Web 
Server.

What little info I could find seems to indicate APR uses the ROOT directory  
under Webapps for html based apps.

I will probably go back to Apache Web server as a separate tier. I was trying 
to 
get better performance using APR + Tomcat and saw some but not enough to 
justify 
the advantages of a seperate tier.

Best Regards,
-Tony



- Original Message 
From: Pid 
To: Tomcat Users List 
Sent: Mon, July 19, 2010 3:05:41 PM
Subject: Re: APR & Tomcat...

On 19/07/2010 19:44, Tony Anecito wrote:
> Hi All,
> 
> I have been having odd issues with APR & Tomcat (6.0.20) since I set it up a 
> while ago. I am seeing:

Time for an upgrade.

> 1. Sometimes on the first try to get images from a page where the images are 
> assigned a sub domain via a host tag I get a red x. Hitting refresh seems to 
> retrieve the images. The images are in a subfolder off of the ROOT folder of 
> tomcat.

Can you reproduce the problem?

What does the client actually see?

You can use a browser tool to find out, e.g. Firebug in Firefox.
Fiddler, ieHttpHeaders in IE, the built-in developer tools in Safari/Chrome.

What does the server actually send?  You didn't state your OS (tsk) but
there are tools available for most OS which will allow you to monitor
network traffic at the server. (e.g. Wireshark).

> 2. I get a file not found off of another folder where the file is a jnlp file.
> 
> 
> So is there any type of directory tag (allow, deny ect) I should be using for 
> the sub folders off or ROOT? When I used Apache Web server I set those up but 
> then I was not using a Host tag either. But for APR I did not set up any type 
> directory tags.

No there isn't.  Tomcat != Apache HTTPD.

Security permissions are set in the "ROOT/WEB-INF/web.xml", as per the
Servlet Spec.


p

> If I need the directory tags where would I put them?
> 
> Thanks,
> -Tony
> 
> 
>      
> 
> -
> 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: Tomcat 5.5.23 server startup issue

2010-07-19 Thread Pid
On 19/07/2010 17:23, Venkat Tanga wrote:
> *Hi All,
> 
>  I am facing the below mentioned issues in the server startup. hence
> the server is not starting up.
> 
> Can any one plz help me how to resolve these issues. *
> 
> Jul 19, 2010 9:41:30 PM org.apache.catalina.startup.HostConfig
> deployDescriptor
> SEVERE: Error deploying configuration descriptor host-manager.xml
> java.lang.NoSuchMethodError:
> org.apache.naming.NamingContextBindingsEnumeration.(Ljava/util/Iterator;Ljavax/naming/Context;)V
> 
>at
> org.apache.naming.resources.FileDirContext.listBindings(FileDirContext.java:338)
> 
>at
> org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:516)
> 
>at
> org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:175)
> 
>at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4064)
>at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
> 
>at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
>at
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
> 
>at
> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
> 
>at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
>at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
>at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
> 
>at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
>at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
>at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
>at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>at
> org.apache.catalina.core.StandardService.start(StandardService.java:448)
>at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
>at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>at java.lang.reflect.Method.invoke(Unknown Source)
>at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
>at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
> Jul 19, 2010 9:41:30 PM org.apache.catalina.startup.HostConfig
> deployDescriptor
> SEVERE: Error deploying configuration descriptor manager.xml
> java.lang.NoSuchMethodError:
> org.apache.naming.NamingContextBindingsEnumeration.(Ljava/util/Iterator;Ljavax/naming/Context;)V
> 
>at
> org.apache.naming.resources.FileDirContext.listBindings(FileDirContext.java:338)
> 
>at
> org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:516)
> 
>at
> org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:175)
> 
>at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4064)
>at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
> 
>at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
>at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
>at
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
> 
>at
> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
> 
>at
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
>at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
>at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
>at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
> 
>at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
>at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
>at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
>at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
>at
> org.apache.catalina.core.StandardService.start(StandardService.java:448)
>at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
>at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>at java.lang.reflect.Method.invoke(Unknown Source)
>at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
>at org.apache.catalina.startup.Bootstrap.main(Bootst

Re: Unable to get Tomcat 7 to work in Eclipse

2010-07-19 Thread Pid
On 19/07/2010 20:13, Austin Shelton wrote:
> Hi,
> 
> I am unable to get Tomcat 7.0.0 to work correctly with Eclipse Helios.
> Tomcat 6 was working just fine; the problem occurred when I upgraded to
> Tomcat 7.0. It complained about "Resource Not found. I now have it working
> to the extent that no errors or warning show up in the console. But I do not
> get my page, without errors, to display. Any tips on solving this problem?
> 
> Thanks

Which resource isn't found?

What complained, your browser, Eclipse, or Tomcat?

What do the Tomcat logs say?  (Note: they may be in a different location
than a normal Tomcat installation)


p



signature.asc
Description: OpenPGP digital signature


Re: APR & Tomcat...

2010-07-19 Thread Pid
On 19/07/2010 19:44, Tony Anecito wrote:
> Hi All,
> 
> I have been having odd issues with APR & Tomcat (6.0.20) since I set it up a 
> while ago. I am seeing:

Time for an upgrade.

> 1. Sometimes on the first try to get images from a page where the images are 
> assigned a sub domain via a host tag I get a red x. Hitting refresh seems to 
> retrieve the images. The images are in a subfolder off of the ROOT folder of 
> tomcat.

Can you reproduce the problem?

What does the client actually see?

You can use a browser tool to find out, e.g. Firebug in Firefox.
Fiddler, ieHttpHeaders in IE, the built-in developer tools in Safari/Chrome.

What does the server actually send?  You didn't state your OS (tsk) but
there are tools available for most OS which will allow you to monitor
network traffic at the server. (e.g. Wireshark).

> 2. I get a file not found off of another folder where the file is a jnlp file.
> 
> 
> So is there any type of directory tag (allow, deny ect) I should be using for 
> the sub folders off or ROOT? When I used Apache Web server I set those up but 
> then I was not using a Host tag either. But for APR I did not set up any type 
> directory tags.

No there isn't.  Tomcat != Apache HTTPD.

Security permissions are set in the "ROOT/WEB-INF/web.xml", as per the
Servlet Spec.


p

> If I need the directory tags where would I put them?
> 
> Thanks,
> -Tony
> 
> 
>   
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 




signature.asc
Description: OpenPGP digital signature


Re: How to retrieve persisted session

2010-07-19 Thread Ashish Kulkarni
Hi
Is there a way i can save this session cookie, so i can access it later? is
it possible

How does yahoo or gmail keep me signed on for 2-3 days
Ashish

On Mon, Jul 19, 2010 at 4:43 PM, Mark Thomas  wrote:

> On 19/07/2010 20:48, Ashish Kulkarni wrote:
> > Hi
> > I have configured my tomcat to save session in database as per
> > documentation, and it works as expected i can see the session is saved in
> > database,
> > Now if the user closes the browser, and then reopens i dont want to show
> the
> > login screen but get the session from database and go to the last visited
> > page,
> > how can i retrieve this session from database,
>
> You can't. Once the browser is closed, the session cookie is removed
> from the browser.
>
> Mark
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com


Re: How to retrieve persisted session

2010-07-19 Thread Mark Thomas
On 19/07/2010 20:48, Ashish Kulkarni wrote:
> Hi
> I have configured my tomcat to save session in database as per
> documentation, and it works as expected i can see the session is saved in
> database,
> Now if the user closes the browser, and then reopens i dont want to show the
> login screen but get the session from database and go to the last visited
> page,
> how can i retrieve this session from database,

You can't. Once the browser is closed, the session cookie is removed
from the browser.

Mark



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



Re: using Apache as a front end for Tomcat

2010-07-19 Thread André Warnier

James Godrej wrote:

Hi,
it would be very kind of you people if some one can share how can I use Apache 
as a front end to Tomcat.
I am having an application in CATALINA_HOME/webapps 
and I can access it as http://localhost:9090/portal
Thanks 

Apart from the recommendations you already got, it may help to indicate which versions of 
Apache and Tomcat you are using,

 and on which platform.




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



How to retrieve persisted session

2010-07-19 Thread Ashish Kulkarni
Hi
I have configured my tomcat to save session in database as per
documentation, and it works as expected i can see the session is saved in
database,
Now if the user closes the browser, and then reopens i dont want to show the
login screen but get the session from database and go to the last visited
page,
how can i retrieve this session from database,
Normally our application checks for session, and a flag in session, if the
flag is on then user id logged in, but in my current application if i open
new browser window, it creates a new session,

any ideas

-- 
Ashish
www.ayurwellness.com
www.mysoftwareneeds.com


Re: using Apache as a front end for Tomcat

2010-07-19 Thread Marco Ehrentreich
Hi James,

> Marco thanks for your kind reply.
> 
Your welcome ;-)

> I am a bit new to this Proxy business I did searched tutorials on net but I 
> have 
> got a lot confused.
> If you can share your vhost as how you are using mod_proxy_ajp
> 
> For example following is an example configuration of Apache as front end 
> I enabled mod_proxy_ajp as per your instructions.
> 
> 
> ServerName myserver.com
> 
> 
> 
> ProxyPass ajp://192.168.1.5:9090/portal
> ProxyPassReverse ajp://192.168.1.5:9090/portal
> 
> 
> 
> 
> 
> 
> Is this what you meant for the front end.
> Or I also need to do some thing where sakai is present.
> 

This is basically what I meant. You don't even need a Location
container. You can put this configuration options for mod_proxy_ajp
directly inside the Server or Vhost container like this:


SetEnv BALANCER_SESSION_STICKY jsessionid
ProxyRequests Off
ProxyPreserveHost Off

# Hudson continous integration server
ProxyPass /hudson ajp://localhost:1/hudson
ProxyPassReverse /hudson ajp://localhost:1/hudson


As you can see there are general options for mod_proxy/mod_proxy_ajp you
can tweak but the most important are the ProxyPass and ProxyPassReverse
directive which you can just copy for any web application URL you want
to forward to Tomcat.

Of course the port number in these directives must match the port of
your AJP connector of Tomcat inside the server.xml configuration for Tomcat.

The directives and parameters are well documented on the Apache module
documentation pages and in the Tomcat documentation too.
Of course it's a huge topic to understand the Apache configuration
itself in detail, so it's almost impossible to explain every option
here. But the configuration snippets above show the important things
which are needed to get an existing Apache config working with Tomcat
backend(s).

Marco


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



Unable to get Tomcat 7 to work in Eclipse

2010-07-19 Thread Austin Shelton
Hi,

I am unable to get Tomcat 7.0.0 to work correctly with Eclipse Helios.
Tomcat 6 was working just fine; the problem occurred when I upgraded to
Tomcat 7.0. It complained about "Resource Not found. I now have it working
to the extent that no errors or warning show up in the console. But I do not
get my page, without errors, to display. Any tips on solving this problem?

Thanks


Re: using Apache as a front end for Tomcat

2010-07-19 Thread James Godrej
Hi,
Marco thanks for your kind reply.

I am a bit new to this Proxy business I did searched tutorials on net but I 
have 
got a lot confused.
If you can share your vhost as how you are using mod_proxy_ajp

For example following is an example configuration of Apache as front end 
I enabled mod_proxy_ajp as per your instructions.


ServerName myserver.com



ProxyPass ajp://192.168.1.5:9090/portal
ProxyPassReverse ajp://192.168.1.5:9090/portal






Is this what you meant for the front end.
Or I also need to do some thing where sakai is present.




Re: using Apache as a front end for Tomcat

2010-07-19 Thread James Godrej
Thanks Caldarale,I will go through all of them.





From: "Caldarale, Charles R" 
To: Tomcat Users List 
Sent: Tue, 20 July, 2010 12:29:48 AM
Subject: RE: using Apache as a front end for Tomcat

> From: James Godrej [mailto:jamesgod...@yahoo.in]
> Subject: using Apache as a front end for Tomcat
> 
> it would be very kind of you people if some one can share 
> how can I use Apache as a front end to Tomcat.

A lot of it is in the FAQ and doc:
http://wiki.apache.org/tomcat/FAQ/Connectors 
http://wiki.apache.org/tomcat/HowTo#How_do_I_configure_Tomcat_Connectors.3F 
http://tomcat.apache.org/connectors-doc/ 

I'd strongly recommend looking at the above before Googling.

- Chuck


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



RE: using Apache as a front end for Tomcat

2010-07-19 Thread Caldarale, Charles R
> From: James Godrej [mailto:jamesgod...@yahoo.in]
> Subject: using Apache as a front end for Tomcat
> 
> it would be very kind of you people if some one can share 
> how can I use Apache as a front end to Tomcat.

A lot of it is in the FAQ and doc:
http://wiki.apache.org/tomcat/FAQ/Connectors
http://wiki.apache.org/tomcat/HowTo#How_do_I_configure_Tomcat_Connectors.3F
http://tomcat.apache.org/connectors-doc/

I'd strongly recommend looking at the above before Googling.

 - Chuck


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



Re: using Apache as a front end for Tomcat

2010-07-19 Thread Marco Ehrentreich
Hi James!

> it would be very kind of you people if some one can share how can I use 
> Apache 
> as a front end to Tomcat.

I guess most installations of Apache and Tomcat are using the AJP
protocol for communication between the Apache frontend and Tomcat backend.

There are two similar approaches with two different Apache modules:
mod_jk or the newer mod_proxy_ajp module.
I've used mod_proxy_ajp for a few installations recently and it works
without problems. Another advantage is that it's part of the Apache 2.2
standard modules.

For both solutions you basically have to tell Apache which URLs or URL
patterns it should forward to your Tomcat backend for processing of
these requests.

I think you'll find enough tutorials and examples on the intenert. Maybe
there are comletely different approaches too, but in my opinion
mod_proxy_ajp is really straight forward and not too hard to configure.

Marco

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



APR & Tomcat...

2010-07-19 Thread Tony Anecito
Hi All,

I have been having odd issues with APR & Tomcat (6.0.20) since I set it up a 
while ago. I am seeing:

1. Sometimes on the first try to get images from a page where the images are 
assigned a sub domain via a host tag I get a red x. Hitting refresh seems to 
retrieve the images. The images are in a subfolder off of the ROOT folder of 
tomcat.

2. I get a file not found off of another folder where the file is a jnlp file.


So is there any type of directory tag (allow, deny ect) I should be using for 
the sub folders off or ROOT? When I used Apache Web server I set those up but 
then I was not using a Host tag either. But for APR I did not set up any type 
directory tags.

If I need the directory tags where would I put them?

Thanks,
-Tony


  

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



Re: Tomcat7 HTTPS APR Performance

2010-07-19 Thread shivanic


Christopher Schultz-2 wrote:
> 
>  
> Can you clarify? Are you using the same version of APR with both Tomcat
> 7 and JBoss? APR 2.1.4 is an unlikely version number. Care to
> double-check?
> 

Correction  : It is jboss web server version 2.1.4 used. APR Version used is
the latest available 1.4.2
Both Jboss Web Server and Tomcat7 are enabled with APR and using JDK6.



>> While doing load testing with HP Load Runner we observed the following
>> response times(seconds) for 100 concurrent users:
>> Tomcat7  JbossWebServer-2.1.4Jboss4.2.3
>> 
>> Login  94.63 38.74 63.826
> 
> 
> Wow... login takes 30 second under the best of conditions? That seems...
> long. Or, is this the total time to serve 100 requests all at once?
> 


It is the average response time of the application when under a load of 100
concurrent users.
For login - authentication is being done from LDAP Server.



> Uhh... there could be many reasons that your webapp runs slowly.
> 

I would recheck the performance stats with 100 users with HTTP protocol
instead of HTTPS and revert back. Mladen Turk  has mentioned that only
constant response time (and not allowing the factors that make it vary like
access to external resources)  - can determine the absolute picture of the
container behavior. I agree on that point - however as you can see the
differences are huge  - specifically the average response time wrt op like
login  to application. Login involves a simple ldap bind and the test case
involves only login with correct pwd. 



> http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Request_Dumper_Filter
> Note that you will configure this component in web.xml, now, and not in
> context.xml.
> 

Chris, thanks for this info!.

Shivani 
-- 
View this message in context: 
http://old.nabble.com/Tomcat7-HTTPS-APR-Performance-tp29180708p29207557.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: SEVERE message from DeltaManager

2010-07-19 Thread Mark Thomas
On 16/07/2010 10:19, Mark Thomas wrote:
> On 16/07/2010 06:49, Matt Peterson wrote:
>> While load testing our clustered Tomcats, we are seeing the following
>> stack
>> trace in our catalina.out occasionally, but not regularly:
>>
>>
>>
>> Jul 16, 2010 3:34:49 PM org.apache.catalina.ha.session.DeltaManager
>> messageReceived
>>
>> SEVERE: Manager [localhost#/urs]: Unable to receive message through TCP
>> channel
>>
>> java.lang.IllegalStateException: removeAttribute: Session already
>> invalidated
> 
> 
> 
>> Under what conditions would this occur? Could it be that a session
>> diff is
>> being transmitted, but the session it relates to has been invalidated
>> by the
>> time the diff is processed (via a user logout for example)? Or could
>> it be
>> that a timeout has been reached???
> 
> Someone at $work has been doing a load test with tc Server (which has
> identical code to Tomcat in this area) and seen the same issue. I know
> it isn't due to timeout since the sessions are only a few seconds old
> when it happens. My current guess is that the messages are not being
> processed in the same order as they are sent. I need to dig into this
> more to figure out if this is a configuration issue or a bug.
> 
> I did wonder if switching to channel send options 6 would fix it. I'll
> get them to try that and see.

Matt,

Testing shows that it is caused by using async session replication. If
you use synchronous replication that ensures messages are processed on
the receiving nodes in the order they are sent. Asynchronous replication
in conjunction with the fact the the receiving node uses a thread pool
to process messages means that it is possible for messages to be
processed out of sequence. If a session invalidate is processed before
and update then you'll see this error.

Mark



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



Re: SEVERE message from DeltaManager

2010-07-19 Thread Mark Thomas
On 19/07/2010 10:50, Luciano Fioriti wrote:
> May be, but i do notthink so.

Again, you are way off-base here. Hitting the max threads in the
connector has nothing to do with errors in session replication.

Mark

> 
> This errors :
> "SEVERE: Manager [localhost#/urs]: Unable to receive message through TCP
> channel
> 
> java.lang.
> IllegalStateException: removeAttribute: Session already
> invalidated"
> 
> may dependds on tomcat failure
> and i see in the Receiver configuration:
> 
>  maxThreads="6"/>
> 
> 
> 2010/7/16 Mark Thomas 
> 
>> On 16/07/2010 14:50, Luciano Fioriti wrote:
>>
>>> I had done a stress test with 20 contemporary request to a web app using
>>> tomcat6 6bit.
>>> When maxThreads=200 tomcat gave response to only some request  then went
>>> to
>>> 0 cpu time
>>> no more response, nothing on log file.
>>> This happenend only on contemporary requests (max threads reched i
>>> presume).
>>> Increasing maxThreads to 250 all request were satisfied.
>>>
>>
>> Which has absolutely nothing to do with the error Matt is reporting.
>>
>> There are various things that look odd in the statements above but this
>> thread isn't the place to go into that.
>>
>> Mark
>>
>>
>>
>>> Lucio
>>>
>>> 2010/7/16 Mark Thomas
>>>
>>>  On 16/07/2010 14:19, Luciano Fioriti wrote:

  It may be caused by maxThreads parameter in http connector, try to
> increase
>
>
 On what basis are you reaching that conclusion?

 Mark




  lucio
>
> 2010/7/16 Mark Thomas
>
>  On 16/07/2010 06:49, Matt Peterson wrote:
>
>>
>>  While load testing our clustered Tomcats, we are seeing the following
>>
>>> stack
>>> trace in our catalina.out occasionally, but not regularly:
>>>
>>>
>>>
>>> Jul 16, 2010 3:34:49 PM org.apache.catalina.ha.session.DeltaManager
>>> messageReceived
>>>
>>> SEVERE: Manager [localhost#/urs]: Unable to receive message through
>>> TCP
>>> channel
>>>
>>> java.lang.IllegalStateException: removeAttribute: Session already
>>> invalidated
>>>
>>>
>>>  
>>
>>
>>  Under what conditions would this occur? Could it be that a session
>> diff
>> is
>>
>>  being transmitted, but the session it relates to has been invalidated
>>> by
>>> the
>>> time the diff is processed (via a user logout for example)? Or could
>>> it
>>> be
>>> that a timeout has been reached???
>>>
>>>
>>>  Someone at $work has been doing a load test with tc Server (which has
>> identical code to Tomcat in this area) and seen the same issue. I know
>> it
>> isn't due to timeout since the sessions are only a few seconds old when
>> it
>> happens. My current guess is that the messages are not being processed
>> in
>> the same order as they are sent. I need to dig into this more to figure
>> out
>> if this is a configuration issue or a bug.
>>
>> I did wonder if switching to channel send options 6 would fix it. I'll
>> get
>> them to try that and see.
>>
>> Mark
>>
>>
>>
>>
>> -
>> 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



>>>
>>
>>
>>
>> -
>> 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: tomcat starting even after port is in use

2010-07-19 Thread Mark Thomas
On 19/07/2010 08:35, sudhir singh rana wrote:
> Hi,
> 
> I started tomcat but tomcat port was in use. Due to this some functionality
> of my program was not working. Tomcat gives the error when port is in use
> but it comes up. I want tomcat should not come up when port is in use.
> 
> Can anyone help me

Yes, but only when you provide some basic information such as exactly
which Tomcat version you are using.

Mark



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



Re: tomcat 7: IllegalArgumentException: taglib definition not consistent with specification version

2010-07-19 Thread Mark Thomas
On 19/07/2010 08:02, Edoardo Panfili wrote:
> On 17/07/10 16.28, Mark Thomas wrote:
 >>  
 >>  
 >>   ...
 >>  
 >>  >> >  but this one works! also with the wrong schemaLocation.
>>> >  Without your help I can't figure the meaning of the exception. Is
>>> Tomcat
>>> >  supposing a specification version using the presence/absence of
>>> this tag?
>>> >  thank you.
>> No. Tomcat 7 is requiring that if you declare your web application to be
>> using version 2.5 of the Servlet specification that you declare your tag
>> libraries as required by schema for that version of the spec. You were
>> trying to use an old way old defining tag libraries from an older (2.3?)
>> version of the spec.
> 
> Ok, I am declaring the use of a specific version of the specification
> and then I use (my mistake obviously!) an older schema in my web.xml...
> Is a SAX exception more appropriate during the parsing of web.xml?

If you enabled validation, you'd probably get one.

> JSR site is the only place to find this kind of informations? Is there a
> place where I can find the different characteristics (and schemas) of
> the different sevlet/jsp/taglibs specification?

Not that I am aware of.

Mark



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



Tomcat 5.5.23 server startup issue

2010-07-19 Thread Venkat Tanga

*Hi All,

 I am facing the below mentioned issues in the server startup. 
hence the server is not starting up.


Can any one plz help me how to resolve these issues. *

Jul 19, 2010 9:41:30 PM org.apache.catalina.startup.HostConfig 
deployDescriptor

SEVERE: Error deploying configuration descriptor host-manager.xml
java.lang.NoSuchMethodError: 
org.apache.naming.NamingContextBindingsEnumeration.(Ljava/util/Iterator;Ljavax/naming/Context;)V
   at 
org.apache.naming.resources.FileDirContext.listBindings(FileDirContext.java:338)
   at 
org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:516)
   at 
org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:175)
   at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4064)
   at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)

   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
   at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
   at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)

   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)

   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)

   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Jul 19, 2010 9:41:30 PM org.apache.catalina.startup.HostConfig 
deployDescriptor

SEVERE: Error deploying configuration descriptor manager.xml
java.lang.NoSuchMethodError: 
org.apache.naming.NamingContextBindingsEnumeration.(Ljava/util/Iterator;Ljavax/naming/Context;)V
   at 
org.apache.naming.resources.FileDirContext.listBindings(FileDirContext.java:338)
   at 
org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:516)
   at 
org.apache.catalina.util.ExtensionValidator.validateApplication(ExtensionValidator.java:175)
   at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:4064)
   at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
   at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)

   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
   at 
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
   at 
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
   at 
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)

   at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
   at 
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
   at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)

   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
   at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at 
org.apache.catalina.core.StandardService.start(StandardService.java:448)
   at 
org.apache.catalina.core.StandardServer.start(StandardServer.java:700)

   at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

--
Regards,
Venkat





Re: where to declare the datasource?

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel,

On 7/19/2010 11:19 AM, Daniel Plappert wrote:
> It is possible to declare the datasource in the servlet.xml and
> reference it in the web.xml of the application (via jndi)[?]

Assuming you meant "server.xml", then yes, you can define it globally
and reference it locally. Look under the configuration reference for
your Tomcat version for "Global Resources" a.k.a. .

> Or one can declare it in the application itself, i.e. in 
> application-context.xml. The first one declares the datasource for 
> all applications deployed in this servlet-container, the second one 
> is only for the application.

Right.

> Is there a good reason for declaring the datasource in servlet.xml,
> other than to "share" the datasource with multiple applications?

I can think of several reasons you might want to do this, including but
not limited to any of the following:

1. There really is a database that should be shared by a number of
different applications, and they should all use the same pool of connections

2. The developers have no idea about the data source connection details,
and expect the server admins to provide the configuration

#2 isn't really a good reason to do this, though: the server admins can
always provide or override a webapp-provided context.xml file in order
to include the correct configuration. This allows you to change the
configuration without starting the entire server: only a webapp
restart/redeploy is necessary.

> Shouldn't every application have their own datasource?

That depends entirely on your own requirements.

> Which type of declaration do you prefer?

I would recommend per-webapp configuration, but sometimes it makes sense
to share a connection pool across many webapps. Again, it depends
entirely upon your own requirements.

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

iEYEARECAAYFAkxEdocACgkQ9CaO5/Lv0PDOSQCfcNKLkXM+F/IkEgkXa7aWDwxH
zlAAoLFCl9AJ0YEheFotb+mfC7ZZV6Za
=xB3n
-END PGP SIGNATURE-

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



where to declare the datasource?

2010-07-19 Thread Daniel Plappert
Hi!

It is possible to declare the datasource in the servlet.xml and reference it in 
the web.xml of the application (via jndi). Or one can declare it in the 
application itself, i.e. in application-context.xml. The first one declares the 
datasource for all applications deployed in this servlet-container, the second 
one is only for the application.
Is there a good reason for declaring the datasource in servlet.xml, other than 
to "share" the datasource with multiple applications? Shouldn't every 
application have their own datasource? 
Which type of declaration do you prefer?


Greetings,
Daniel




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



Re: How can i verify clusterization?

2010-07-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Luca,

On 7/19/2010 3:07 AM, Luca Gervasi wrote:
> I use httpd + mod_jk as frontend to load balance among all the backends
> (lb worker).

Okay, that will simplify switching backends at will from a client.

> The backends use the BackupManager to achieve clusterization enclosed
> in the  tag.

Ok. Have you tried DeltaManager (the default)?

>> Also, make sure that you have logging.properties set up in a sane way,
>> and that you can get debugging output from at least one component.
> 
> I don't have a logging.properties file. All the settings are "default".

Those two statements are not compatible: Tomcat ships with a
conf/logging.properties file. Have you disabled it?

At the very least, you ought to be able to force your way into a backend
server with a URL like this:

http://host/context;jsessionid=ABCDEF.node1

(where "node1" is your jvmRoute set in your mod_jk configuration and in
your  on the backend).

Once you've created a session on one node and stuffed some interesting
things into it, then switch nodes by changing your URL:

http://host/context;jsessionid=ABCDEF.node2

If your session still works, then the cluster is working. If your
session isn't there, or the expected attributes are not present, they
there is either a misconfiguration or some kind of connectivity issue.

Speaking of configuration, would you care to post your cluster
configuration?

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

iEYEARECAAYFAkxEWnoACgkQ9CaO5/Lv0PCorQCfcETrdSZ9acf4nkrSWqeDR4dY
miEAnjMDhhoIG7csHu0xQKTm8Q06eQsj
=ggnZ
-END PGP SIGNATURE-

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



Re: SEVERE message from DeltaManager

2010-07-19 Thread Luciano Fioriti
May be, but i do notthink so.

This errors :
"SEVERE: Manager [localhost#/urs]: Unable to receive message through TCP
channel

java.lang.
IllegalStateException: removeAttribute: Session already
invalidated"

may dependds on tomcat failure
and i see in the Receiver configuration:

 


2010/7/16 Mark Thomas 

> On 16/07/2010 14:50, Luciano Fioriti wrote:
>
>> I had done a stress test with 20 contemporary request to a web app using
>> tomcat6 6bit.
>> When maxThreads=200 tomcat gave response to only some request  then went
>> to
>> 0 cpu time
>> no more response, nothing on log file.
>> This happenend only on contemporary requests (max threads reched i
>> presume).
>> Increasing maxThreads to 250 all request were satisfied.
>>
>
> Which has absolutely nothing to do with the error Matt is reporting.
>
> There are various things that look odd in the statements above but this
> thread isn't the place to go into that.
>
> Mark
>
>
>
>> Lucio
>>
>> 2010/7/16 Mark Thomas
>>
>>  On 16/07/2010 14:19, Luciano Fioriti wrote:
>>>
>>>  It may be caused by maxThreads parameter in http connector, try to
 increase


>>> On what basis are you reaching that conclusion?
>>>
>>> Mark
>>>
>>>
>>>
>>>
>>>  lucio

 2010/7/16 Mark Thomas

  On 16/07/2010 06:49, Matt Peterson wrote:

>
>  While load testing our clustered Tomcats, we are seeing the following
>
>> stack
>> trace in our catalina.out occasionally, but not regularly:
>>
>>
>>
>> Jul 16, 2010 3:34:49 PM org.apache.catalina.ha.session.DeltaManager
>> messageReceived
>>
>> SEVERE: Manager [localhost#/urs]: Unable to receive message through
>> TCP
>> channel
>>
>> java.lang.IllegalStateException: removeAttribute: Session already
>> invalidated
>>
>>
>>  
>
>
>  Under what conditions would this occur? Could it be that a session
> diff
> is
>
>  being transmitted, but the session it relates to has been invalidated
>> by
>> the
>> time the diff is processed (via a user logout for example)? Or could
>> it
>> be
>> that a timeout has been reached???
>>
>>
>>  Someone at $work has been doing a load test with tc Server (which has
> identical code to Tomcat in this area) and seen the same issue. I know
> it
> isn't due to timeout since the sessions are only a few seconds old when
> it
> happens. My current guess is that the messages are not being processed
> in
> the same order as they are sent. I need to dig into this more to figure
> out
> if this is a configuration issue or a bug.
>
> I did wonder if switching to channel send options 6 would fix it. I'll
> get
> them to try that and see.
>
> Mark
>
>
>
>
> -
> 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
>>>
>>>
>>>
>>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


tomcat starting even after port is in use

2010-07-19 Thread sudhir singh rana
Hi,

I started tomcat but tomcat port was in use. Due to this some functionality
of my program was not working. Tomcat gives the error when port is in use
but it comes up. I want tomcat should not come up when port is in use.

Can anyone help me

thanks in advance


Re: How can i verify clusterization?

2010-07-19 Thread Luca Gervasi
On Fri, 2010-07-16 at 15:56 -0400, Christopher Schultz wrote: 
> Luca,
> 
> On 7/14/2010 2:42 AM, Luca Gervasi wrote:
> > i'm using (mostly):
> 
> What does "(mostly)" mean? You have environments that sometimes deviate
> from this configuration? Sometimes you use another Tomcat and/or JDK
> just for fun?

With "mostly" i mean i handle several cluster rangeing from 5.x to
6.0.28. I'm interested in the 6.0.x trunk cluster capabilities and
handling (since are the one that i handle on my own). 

> > Tomcat: 2.0.26
> 
> No, you're not. Maybe 6.0.26?

Yes, my bad :) Tomcat 6.0.26.

> JDK: jdk1.6.0_18
> 
> Ok.
> 
> > I have clusters of 2-4 tomcats. Is there a way to verify that the
> > cluster is working?
> 
> What do you define as a "cluster"? Are you just load-balancing between
> machines that aren't tied to each other in any way? Are you attempting
> to use distributable sessions?
> What component is "clusterizing" these machines? Do you have an lb out
> front, or Apache httpd + mod_jk/mod_proxy? These details are useful in
> helping you.

I use httpd + mod_jk as frontend to load balance among all the backends
(lb worker). The backends use the BackupManager to achieve
clusterization enclosed in the  tag.

> > I can see no message exchange. is there a way (even
> > some jsp code) to ensure that the cluster is working and the number of
> > nodes joining it?
> 
> You may be able to verify that sessions are being distributed properly
> by modifying your own JSESSIONID cookie (or simply running with cookies
> disabled and then manually changing the 'jsessionid' parameter in the
> URL in order to force connection to a particular backend. Again, this
> depends entirely upon your lb strategy (which we don't know).
> 
> > Furthermore...is there some debugging tool to see the cluster status?
> 
> Logs certainly help. How about providing your startup log from catalina.out?

My Logs are strange. After a (successfull?) startup, i start getting some 
errors that seems indicating a bad
clustering behavior:

[ Successfull startup? This ip is other node's - this is a two nodes 
cluster ]
Jul 19, 2010 8:48:41 AM org.apache.catalina.ha.tcp.SimpleTcpCluster memberAdded
INFO: Replication member 
added:org.apache.catalina.tribes.membership.MemberImpl[tcp://{172, 16, 35, 
3}:8830,{172, 16, 35, 3},8830, alive=1040,id={55 -95 -24 -5 -91 -45 65 79 -93 
18 68 -18 -30 84 -96 76 }, payload={}, command={}, domain={}, ]

[ Strange errors ]
Jul 19, 2010 8:47:33 AM org.apache.catalina.tribes.tipis.AbstractReplicatedMap 
heartbeat
SEVERE: Unable to send AbstractReplicatedMap.ping message
org.apache.catalina.tribes.ChannelException: Sender not connected.; No faulty 
members identified.
at 
org.apache.catalina.tribes.transport.nio.PooledParallelSender.sendMessage(PooledParallelSender.java:45)
at 
org.apache.catalina.tribes.transport.ReplicationTransmitter.sendMessage(ReplicationTransmitter.java:81)
at 
org.apache.catalina.tribes.group.ChannelCoordinator.sendMessage(ChannelCoordinator.java:78)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75)
at 
org.apache.catalina.tribes.group.interceptors.ThroughputInterceptor.sendMessage(ThroughputInterceptor.java:61)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75)
at 
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.sendMessage(MessageDispatchInterceptor.java:73)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75)
at 
org.apache.catalina.tribes.group.interceptors.TcpFailureDetector.sendMessage(TcpFailureDetector.java:87)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.sendMessage(ChannelInterceptorBase.java:75)
at 
org.apache.catalina.tribes.group.GroupChannel.send(GroupChannel.java:216)
at 
org.apache.catalina.tribes.group.GroupChannel.send(GroupChannel.java:175)
at org.apache.catalina.tribes.group.RpcChannel.send(RpcChannel.java:89)
at 
org.apache.catalina.tribes.tipis.AbstractReplicatedMap.ping(AbstractReplicatedMap.java:253)
at 
org.apache.catalina.tribes.tipis.AbstractReplicatedMap.heartbeat(AbstractReplicatedMap.java:794)
at 
org.apache.catalina.tribes.group.GroupChannel.heartbeat(GroupChannel.java:158)
at 
org.apache.catalina.tribes.group.GroupChannel$HeartbeatThread.run(GroupChannel.java:661)

All this continues to be outputted unless i restart my nodes some _random_ 
times (I keep each istance down at least 1 hearthbeat long).
That's why i need to know if they are really "clustering". Is the errors 
suppressed because they "works" or 
because they "ultimately decided not to work at all" and just gave up? 


> Also, make sure that you have logging.properties set up in a sane way,
> and that you can get debugging output from at least one component.

I don't 

Re: tomcat 7: IllegalArgumentException: taglib definition not consistent with specification version

2010-07-19 Thread Edoardo Panfili

On 17/07/10 16.28, Mark Thomas wrote:

>>  
>>  
>>   ...
>>  
>>  
>  but this one works! also with the wrong schemaLocation.
>  Without your help I can't figure the meaning of the exception. Is Tomcat
>  supposing a specification version using the presence/absence of this tag?
>  thank you.

No. Tomcat 7 is requiring that if you declare your web application to be
using version 2.5 of the Servlet specification that you declare your tag
libraries as required by schema for that version of the spec. You were
trying to use an old way old defining tag libraries from an older (2.3?)
version of the spec.


Ok, I am declaring the use of a specific version of the specification 
and then I use (my mistake obviously!) an older schema in my web.xml... 
Is a SAX exception more appropriate during the parsing of web.xml?


JSR site is the only place to find this kind of informations? Is there a 
place where I can find the different characteristics (and schemas) of 
the different sevlet/jsp/taglibs specification?


Thank you again
Edoardo


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