Re: Tomcat 7: Why is JDK needed ?

2011-07-21 Thread Justin Randall
It uses the Java compiler for activities such as compiling JSPs into Servlets 
into Java class files.

All versions of Tomcat require the JDK.

Sent from my BlackBerry device

-Original Message-
From: Bobi St 
Date: Thu, 21 Jul 2011 19:58:53 
To: 
Subject: Tomcat 7: Why is JDK needed ?

Hi there,
why is Why is JDK needed also for Tomcat 7 ? Does it use a compiler, or why not 
simply using for example jre6 ?!?
I have to install always extra JDK because of it ...
Best regards,

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



Re: Tomcat Configuration in Multi Core Systems

2011-04-24 Thread Justin Randall
That statement is only correct if memory footprint is an issue, or if each 
thread allocates a lot of dynamic memory that isn't shared by other threads.  
If there isn't much memory required, or if most of the data stored in memory is 
heavily shared, adding more memory will not increase performance.

Each processor has it's own on-die memory caches, which affect performance more 
than the amount of RAM all together (especially with good memory locality 
design).  If all threads are trying to access an object that resides in the 
memory local to processor 1, adding more memory won't change the fact that 
access to this object from other processors will require non-local memory 
access through CPU boundaries.

Regards,

Justin Randall
Sent from my BlackBerry device

-Original Message-
From: David Kerber 
Date: Sun, 24 Apr 2011 08:54:35 
To: Tomcat Users List
Reply-To: "Tomcat Users List" 
Subject: Re: Tomcat Configuration in Multi Core Systems

On 4/24/2011 3:07 AM, sujikin wrote:
> Hi,
>
> Thanks for your replies. I was sure Server B will never will be able to
> match Server A even if it had
> infinite processors in it ( provided everything remains the same). Just
> wanted to confirm.
>
> @David
> Server B has *116* processors only.
> Slow because of time taken to handle single request.
32Gb shared among 116 processors isn't very much RAM for each process 
(that's why I assumed it was 16, not 116).  You'll likely get a 
performance boost if you can give it more RAM.



> Regards,
> Sujeet
>
>
>
> David Kerber wrote:
>> On 4/23/2011 2:31 PM, Sujeet Singh wrote:
>>> Hi,
>>>
>>> I have two servers which has below configuration,
>>>
>>> Server A has 32 GB RAM, 4  processors each of 2.8 GHz
>>>
>>> Server B has 32 GB RAM, 116  processors each of 1.6 GHz.
>>>
>>> Both servers has tomcat installed having same configuration.
>>>
>>> Tomcat of server B is at least half as slow as Server A.
>>>
>>> My question is...just by increasing the worker thread count, the
>>> performance
>>> of
>>> Server B can be increased or we need to do something else also?
>>>
>>> Tomcat version is 5.5 and Java version is 5. OS used is Solaris 10 SPARC.
>>>
>>> Thanks&   Regards,
>>> Sujeet
>>>
>> First, I assume you mean "16" processors in server B, rather than 116.
>>
>> You need to define "slow":  time to process a single request, or # of
>> requests it can handle?
>>
>> Server B's clock speed is about half that of A, so I would expect
>> (everything else being equal) that it would run at ~ half the speed of A
>> for a single request.  However, given that it has 4x as many processors,
>> it should be able to handle ~ 4x as many simultaneous requests, but each
>> of them will still take about 2x as long as they would on A.
>>
>>
>>
>> -
>> 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 Configuration in Multi Core Systems

2011-04-23 Thread Justin Randall
Hi Sujeet,

In any application, speed is primarily determined by serial portions of code 
execution.

Speed isn't something that is increased by adding more threads, however 
throughput can usually be increased which has the illusion of increasing 
"speed" for a given workload.

That said, you should examine the serial parts of your application code and try 
to leverage additional parallelism (i.e. If you have multiple tasks within a 
single request to complete which aren't heavily dependent on each other).  This 
can help reduce the time it takes for a given request to complete.

If each request is handled only by a single thread then it should be expected 
that a CPU with 1/2 the speed performs 1/2 as fast.

Regards,

Justin Randall
--Original Message--
From: Sujeet Singh
To: users@tomcat.apache.org
ReplyTo: Tomcat Users List
Subject: Tomcat Configuration in Multi Core Systems
Sent: Apr 23, 2011 14:31

Hi,

I have two servers which has below configuration,

Server A has 32 GB RAM, 4  processors each of 2.8 GHz

Server B has 32 GB RAM, 116  processors each of 1.6 GHz.

Both servers has tomcat installed having same configuration.

Tomcat of server B is at least half as slow as Server A.

My question is...just by increasing the worker thread count, the performance
of
Server B can be increased or we need to do something else also?

Tomcat version is 5.5 and Java version is 5. OS used is Solaris 10 SPARC.

Thanks & Regards,
Sujeet



Sent from my BlackBerry device

Re: Tomcat on a Linux virtual machine

2011-04-15 Thread Justin Randall
Hi Darryl,

Is the database also running on a VM?  My experience with "problematic 
applications on VMs" hasn't been related to the application itself (Tomcat, 
BIND, Apache, etc.) but moreso whether they generate high volumes of local 
storage I/O (like a database using local disks).  The impact this can have can 
also be magnified if your VM disks aren't properly aligned (a common mistake in 
many older VM deployments).

The vendor should also be providing some form of justification for their 
statements.  Depending on your virtualization platform of choice, there may be 
various utilities you can use to analyze the performance of the virtualization 
host itself to help narrow down where bottlenecks may be occurring.

Regards,

--Original Message--
From: Darryl Lewis
To: Tomcat Users List
ReplyTo: Tomcat Users List
Subject: Tomcat on a Linux virtual machine
Sent: Apr 15, 2011 23:18

I have an application (commercial) running on a virtual instance of Linux 
talking to a Postgres database.
We are continually getting locks on the DB that are crashing the app.
I think it's just bad programming on the suppliers side, but the supplier has 
latched onto the idea that it is because it is running on a virtual machine.
Has any experienced any problems running Tomcat on a virtual machine similar to 
this?



Sent from my BlackBerry device

Re: [OT] servlet-specific error pages

2011-04-13 Thread Justin Randall
Hi Martin,

What Chris is actually looking for is custom servlet specific error handling in 
addition to web application error handling (the later is what you have 
described below).

In other words, 401 for Servlet X is directed to a different JSP than 401 for 
the entire web application.

Regards,

Justin Randall
Sent from my BlackBerry device

-Original Message-
From: Martin Gainty 
Date: Wed, 13 Apr 2011 21:47:51 
To: Tomcat Users List
Reply-To: "Tomcat Users List" 
Subject: RE: [OT] servlet-specific error pages


in web.xml for your webapp
map a custom jsp for each returned HTTP status code e.g:

  
401
/401.jsp
  
  
403
/403.jsp
  
  
404
/404.jsp
  

Martin  
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




> From: ran...@hotmail.com
> To: users@tomcat.apache.org
> Subject: RE: [OT] servlet-specific error pages
> Date: Wed, 13 Apr 2011 20:10:48 -0400
> 
> 
> Hi Chris,
> 
> > Of course. I was wondering about other exceptions or errors that maybe I
> > cannot control from that code.
> 
> Are you referring to internal exceptions within Tomcat's own code or simply 
> unexpected exceptions within the servlet's implemented code?  If it's the 
> later you could always just wrap your code with a try block that catches 
> "Throwable" which will catch any possible exception thrown by Java and 
> properly implemented library exceptions.  Perhaps not ideal but considering 
> the available options it might not be too bad.
> 
> Technically speaking, catching Throwable isn't such a bad practice for 
> end-user facing applications because you can at least redirect to a more 
> elegant "Unexpected Exception has occurred" page rather than an error page 
> showing a stack trace of a NullPointerException or some other unexpected 
> errors due to programming mistakes as an example.
> 
> Regards,
> 
> Justin Randall
> 
> > Date: Wed, 13 Apr 2011 16:11:09 -0400
> > From: ch...@christopherschultz.net
> > To: users@tomcat.apache.org
> > Subject: Re: [OT] servlet-specific error pages
> > 
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA1
> > 
> > Justin,
> > 
> > On 4/13/2011 9:17 AM, Justin Randall wrote:
> > > Hi Chris,
> > > 
> > > I'm assuming the servlet is in control of generating all of the
> > > errors you are implying?
> > 
> > Yes and no:
> > 
> > > For example, if the servlet doesn't load properly and a 404 would be
> > > generated, the servlet would obviously not be in control of handling
> > > this exception and this would would have to make use of 
> > > directives in web.xml, specifically for  404 which would
> > > redirect to a JSP that just so happens to be an XML file.
> > 
> > Right, but I want the default 404 error page to be in HTML.
> > 
> > Basically, I want two defaults.
> > 
> > If the servlet spec allowed for  to include a 
> > filter, that's what I would use. But it doesn't :(
> > 
> > > If I've understood what you're looking for correctly I've worked on
> > > similar projects in the past and what's worked well for me is
> > > leveraging MVC by using the RequestDispatcher to forward to relevant
> > > JSPs which happen to all be XML files with the contents populated
> > > either via JSP tags or EL.  This way you can catch the
> > > exceptions/error conditions in your servlet, set the appropriate
> > > exception information within the request context and the dispatch to
> > > the correct JSP XML page.
> > 
> > Of course. I was wondering about other exceptions or errors that maybe I

RE: [OT] servlet-specific error pages

2011-04-13 Thread Justin Randall

Hi Chris,

> Of course. I was wondering about other exceptions or errors that maybe I
> cannot control from that code.

Are you referring to internal exceptions within Tomcat's own code or simply 
unexpected exceptions within the servlet's implemented code?  If it's the later 
you could always just wrap your code with a try block that catches "Throwable" 
which will catch any possible exception thrown by Java and properly implemented 
library exceptions.  Perhaps not ideal but considering the available options it 
might not be too bad.

Technically speaking, catching Throwable isn't such a bad practice for end-user 
facing applications because you can at least redirect to a more elegant 
"Unexpected Exception has occurred" page rather than an error page showing a 
stack trace of a NullPointerException or some other unexpected errors due to 
programming mistakes as an example.

Regards,

Justin Randall

> Date: Wed, 13 Apr 2011 16:11:09 -0400
> From: ch...@christopherschultz.net
> To: users@tomcat.apache.org
> Subject: Re: [OT] servlet-specific error pages
> 
> -BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Justin,
> 
> On 4/13/2011 9:17 AM, Justin Randall wrote:
> > Hi Chris,
> > 
> > I'm assuming the servlet is in control of generating all of the
> > errors you are implying?
> 
> Yes and no:
> 
> > For example, if the servlet doesn't load properly and a 404 would be
> > generated, the servlet would obviously not be in control of handling
> > this exception and this would would have to make use of 
> > directives in web.xml, specifically for  404 which would
> > redirect to a JSP that just so happens to be an XML file.
> 
> Right, but I want the default 404 error page to be in HTML.
> 
> Basically, I want two defaults.
> 
> If the servlet spec allowed for  to include a 
> filter, that's what I would use. But it doesn't :(
> 
> > If I've understood what you're looking for correctly I've worked on
> > similar projects in the past and what's worked well for me is
> > leveraging MVC by using the RequestDispatcher to forward to relevant
> > JSPs which happen to all be XML files with the contents populated
> > either via JSP tags or EL.  This way you can catch the
> > exceptions/error conditions in your servlet, set the appropriate
> > exception information within the request context and the dispatch to
> > the correct JSP XML page.
> 
> Of course. I was wondering about other exceptions or errors that maybe I
> cannot control from that code.
> 
> Thanks,
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk2mA10ACgkQ9CaO5/Lv0PAvMgCgqk4ZiH5b75jrl25Kq73Po3hq
> qCIAniutff9LdBlxKTUya36QdWp9e+eL
> =j2iW
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
  

RE: [OT] servlet-specific error pages

2011-04-13 Thread Justin Randall

Hi Chris,

I'm assuming the servlet is in control of generating all of the errors you are 
implying?

For example, if the servlet doesn't load properly and a 404 would be generated, 
the servlet would obviously not be in control of handling this exception and 
this would would have to make use of  directives in web.xml, 
specifically for  404 which would redirect to a JSP that just so 
happens to be an XML file.

If I've understood what you're looking for correctly I've worked on similar 
projects in the past and what's worked well for me is leveraging MVC by using 
the RequestDispatcher to forward to relevant JSPs which happen to all be XML 
files with the contents populated either via JSP tags or EL.  This way you can 
catch the exceptions/error conditions in your servlet, set the appropriate 
exception information within the request context and the dispatch to the 
correct JSP XML page.

For example:

errorfile.jsp:

=
<%@ page trimDirectiveWhitespaces="true" %>
<%@ page contentType="text/xml; charset=UTF-8" %>
<%@ page session="false" %>
<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
%>


${requestScope.errorCode}
${requestScope.errorMessage}

=

In your serlvet you would redirect to the JSP as follows:

=
RequestDispatcher dispatcher = 
req.getRequestDispatcher("/WEB-INF/path/to/errorfile.jsp");
req.setAttribute("errorCode", "500");
req.setAttribute("errorMessage", "My server had an oops!");
dispatcher.forward(req, rsp);
=

Note the XML file doesn't have a schema associated with it but that's just for 
brevity of the example.

I hope this helps!

Justin Randall


> Date: Tue, 12 Apr 2011 16:38:25 -0400
> From: ch...@christopherschultz.net
> To: users@tomcat.apache.org
> Subject: [OT] servlet-specific error pages
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> All,
> 
> I have a webapp where some of the servlets are expected to return XML
> all the time, even for error conditions. I'd like to be able to set an
> error page for those servlets so the response will be in XML instead of
> HTML like you'd get with the default Tomcat error page or an error page
> we might have configured for the rest of the site.
> 
> I didn't see anything in web.xml that would allow me to set an error
> page for a particular servlet.
> 
> Any good ideas?
> 
> Obviously, I can create a system-wide "error" resource that determines
> the resource that was being used and then dispatch to either an
> HTML-oriented or XML-oriented error page, but I was wondering if
> something like that already existed or if there was a better approach.
> 
> Thanks,
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAk2kuEEACgkQ9CaO5/Lv0PBpqACfVky6ZZvG/Rgpt4XK804jdbei
> JpEAnj/NF2td4NNHoBAbFBRAgsUDkC0v
> =xjBP
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
  

Re: Customize URL access

2011-03-31 Thread Justin Randall
Read up on web.xml and using Serlvet mappings to define paths that map to the 
Servlet class itself.

It looks like you're currently using direct servlet invocation.

--Original Message--
From: Jonatan Aguirre Kobayashi
To: users@tomcat.apache.org
ReplyTo: Tomcat Users List
Subject: Customize URL access
Sent: Mar 31, 2011 09:17

Hello, a have a application and the url is for example
http://localhost:8080/myapp/servlet/maiservlet.
How i do to access to my application with this url:
http://localhost:8080/myapp/maiservlet (without servlet reference)


PD: Sorry , my english is not good.



Sent from my BlackBerry device

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



Re: [OT] Followup on 32-bit versus 64-bit performance discussion(s)

2011-03-14 Thread Justin Randall
Indeed.

It really makes you wonder why caches and pipelines weren't scaled more 
proportionally.

At least we can appreciate better calling conventions.  :)

--Original Message--
From: Christopher Schultz
To: Tomcat Users List
ReplyTo: Tomcat Users List
Subject: Re: [OT] Followup on 32-bit versus 64-bit performance discussion(s)
Sent: Mar 14, 2011 17:08

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Justin,

On 3/14/2011 3:45 PM, Justin Randall wrote:
> In general, it is technically possible for a 32-bit application to
> perform faster than a 64-bit application when running on a 64-bit CPU
> because of CPU memory cache behaviour.

Also due to the amount of data that can be transferred at once across
the data paths to the CPU: 64-bit pointers simply take up more bandwidth
on those paths.

A 32-bit process, using 32-bit pointers, will enjoy a 2x speedup for
those types of data.

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

iEYEARECAAYFAk1+g+MACgkQ9CaO5/Lv0PB8DwCgqTO/v8DuSS4M8qKbAiGAMJch
bVoAoIdFUL3MM0TqBOFxWZfMp/+9s8At
=2ZPm
-END PGP SIGNATURE-

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




Sent from my BlackBerry device

Re: [OT] Followup on 32-bit versus 64-bit performance discussion(s)

2011-03-14 Thread Justin Randall
In general, it is technically possible for a 32-bit application to perform 
faster than a 64-bit application when running on a 64-bit CPU because of CPU 
memory cache behaviour.

64-bit memory addresses occupy more space within a single cache line and can 
result in added memory cache misses (cache lines filled more quickly) which 
require additional "loads" from real memory into CPU registers, effectively 
slowing down the performance of an application.


Sent from my BlackBerry device

-Original Message-
From: Leon Rosenberg 
Date: Mon, 14 Mar 2011 20:33:21 
To: Tomcat Users List
Reply-To: "Tomcat Users List" 
Subject: Re: [OT] Followup on 32-bit versus 64-bit performance discussion(s)

I'm sorry, I probably missed something, but why should 64 bit app on
64 bit os on 64 bit cpu be slower as 32 bit analog?

regards
Leon

On Mon, Mar 14, 2011 at 6:45 PM, Christopher Schultz
 wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> David,
>
> On 3/14/2011 1:36 PM, David kerber wrote:
>> On 3/14/2011 1:31 PM, Christopher Schultz wrote:
>>>
>>> I should have mentioned, we are in a Linux environment, so we have lots
>>> of options. ;)
>>
>> Lucky you; I wish I could say the same...
>
> You should lobby to virtualize your infrastructure on top of some kind
> of Linux-based virtualization platform. Then you can still be "running
> on Windows" but also have some ... other options ;)
>
> I would suggest the other way around if you wanted to operate in a Linux
> environment, but if the idea is to improve stability, then running Linux
> on top of Windows isn't exactly "recommended technique".
>
> I had always heard that Microsoft SQL Server was a really good RDBMS.
> It's just too bad it has to run on Windows.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk1+VDYACgkQ9CaO5/Lv0PBD+wCfQBK7R2hi6tcsxYaIjNTMYQsR
> jlkAnijh8Tmk7JEX8GLsfzFkf/4qc8Ck
> =emTF
> -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: Change of email address

2010-12-25 Thread Justin Randall
One would imagine you would simply subscribe your new address and (potentially) 
unsubscribe your old address.

--Original Message--
From: Michael McQuade
To: 'Tomcat Users List'
ReplyTo: Tomcat Users List
Subject: Change of email address
Sent: Dec 25, 2010 09:57

How does one go about changing to a new email address?  A new address of
m.mcqu...@powergate.ca is in effect

Thank-You and Merry christmas
Mike


-
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




Sent from my BlackBerry device

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



Re: Can tomcat detect disconnection by client side in Async mode?

2010-12-06 Thread Justin Randall
Just to clarify, I'm not trying to imply that ClientAbortException wouldn't be 
generated for Async mode in some way but simply that I've only tested TCP RST 
behaviour in non-Async mode.

Sent from my BlackBerry device

-Original Message-
From: "Justin Randall" 
Date: Tue, 7 Dec 2010 00:16:01 
To: Tomcat Users List
Reply-To: "Tomcat Users List" 
Subject: Re: Can tomcat detect disconnection by client side in Async mode?

Hello,

Without knowing the application and going on standard sockets, I know from 
experience without using Async mode that Tomcat does generate a 
ClientAbortException when a TCP RST is received from a client when Tomcat is 
writing the HTTP response to the client.

The client was a CPE which downloaded firmware/config via HTTP and sent a TCP 
RST after the first chunk of data if the version on the server and in the CPE 
were identical.  Not sure if this is relevant and what the behaviour of your 
client would be for "disconnecting" from the server (assuming it's not a web 
browser).

Regards,

Justin Randall
Sent from my BlackBerry device

-Original Message-
From: Ben 
Date: Sun, 5 Dec 2010 14:25:56 
To: Tomcat Users List
Reply-To: "Tomcat Users List" 
Subject: Can tomcat detect disconnection by client side in Async mode?

Hi there,

Any idea about the disconnection handling? Cannot find reference for this.

In my application the client may disconnect and send a new request with 
different parameters. On server side I wanna clean the AsynContext held by 
previous request. Right now only timeout will do, which is not efficient cos I 
set the timeout to quite high value to avoid frequent disconnect / connect.

Thanks for help.

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




Re: Can tomcat detect disconnection by client side in Async mode?

2010-12-06 Thread Justin Randall
Hello,

Without knowing the application and going on standard sockets, I know from 
experience without using Async mode that Tomcat does generate a 
ClientAbortException when a TCP RST is received from a client when Tomcat is 
writing the HTTP response to the client.

The client was a CPE which downloaded firmware/config via HTTP and sent a TCP 
RST after the first chunk of data if the version on the server and in the CPE 
were identical.  Not sure if this is relevant and what the behaviour of your 
client would be for "disconnecting" from the server (assuming it's not a web 
browser).

Regards,

Justin Randall
Sent from my BlackBerry device

-Original Message-
From: Ben 
Date: Sun, 5 Dec 2010 14:25:56 
To: Tomcat Users List
Reply-To: "Tomcat Users List" 
Subject: Can tomcat detect disconnection by client side in Async mode?

Hi there,

Any idea about the disconnection handling? Cannot find reference for this.

In my application the client may disconnect and send a new request with 
different parameters. On server side I wanna clean the AsynContext held by 
previous request. Right now only timeout will do, which is not efficient cos I 
set the timeout to quite high value to avoid frequent disconnect / connect.

Thanks for help.

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




Re: GET and POST data in same request

2010-12-02 Thread Justin Randall
GET and POST are HTTP verbs/operations.

It is impossible to have a combo GET/POST.  Which ever verb is specified in the 
HTTP headers is what will control whether doGet or doPost is called.

You are correct that GET and POST reference data differently, however they are 
actions and not "areas of data" in an HTTP request.

Regards,

Justin

--Original Message--
From: Larry
To: users
ReplyTo: Tomcat Users List
Subject: GET and POST data in same request
Sent: Dec 2, 2010 17:21

Hello,

I need to have an apache mod_rewrite pass a request ( which contains
POST data ) along to my servlet with some GET parameters.

I think when Tomcat sees the GET params, it invokes my servlet's doGet
( which annihilates my POST data ).

I need to be able to access both the GET data from the request URL and
the POST data from the body.

Is this possible? Maybe its not tomcat's fault ;)

Any insight is welcome, thanks.

-Larry

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




Sent from my BlackBerry device

RE: what is it doing ?

2010-10-19 Thread Justin Randall

One more thing, aside from checking whether the CPU consumed is usr or sys you 
may also want to lookup at iowait (a.k.a "wa").  This would indicate the CPU is 
busy waiting for IO operations to complete (potentially a slow disk or storage 
device).

Regards,

Justin Randall

> From: ran...@hotmail.com
> To: users@tomcat.apache.org
> Subject: RE: what is it doing ?
> Date: Tue, 19 Oct 2010 12:10:54 -0400
> 
> 
> Hello,
> 
> From a general Linux perspective, if you have a knowledge of Linux system 
> calls, along with what operations are performed by which web application you 
> could use "strace" (use the -f to follow threads).  Depending on what you're 
> interested in you can filter further for operations on files or network 
> activity (i.e. "-e trace=file,network,desc").  If you see a lot of erroneous 
> activity (such as constantly trying to open/stat a file that doesn't exist) 
> and you know which web app (or Tomcat) is responsible you can address the 
> issue.
> 
> You could also check "top" to see whether the CPU is being consumed in usr or 
> sys space, along with whether maybe the memory on your system is maxed out 
> (trigger high CPU load transfer data between RAM and swap space).
> 
> Regards,
> 
> Justin Randall
> 
> > Date: Tue, 19 Oct 2010 17:40:17 +0200
> > From: a...@ice-sa.com
> > To: users@tomcat.apache.org
> > Subject: what is it doing ?
> > 
> > Hi.
> > 
> > I have a Linux system like so :
> > 
> > Linux arthur 2.6.26-2-686 #1 SMP Mon Aug 30 07:01:57 UTC 2010 i686 GNU/Linux
> > 
> > with a tomcat like so :
> > 
> > Using CATALINA_BASE:   /usr/share/tomcat5.5
> > Using CATALINA_HOME:   /usr/share/tomcat5.5
> > Using CATALINA_TMPDIR: /usr/share/tomcat5.5/temp
> > Using JRE_HOME:   /usr/lib/jvm/java-1.5.0-sun
> > Server version: Apache Tomcat/5.5
> > Server built:   Oct 15 2008 12:57:44
> > Server number:  5.5.26.0
> > OS Name:Linux
> > OS Version: 2.6.26-2-686
> > Architecture:   i386
> > JVM Version:1.5.0_22-b03
> > JVM Vendor: Sun Microsystems Inc.
> > 
> > (Java JDK installed)
> > 
> > and where night and day, tomcat seems to be using a fair amount of CPU 
> > time, like so :
> > 
> >PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
> >   2901 tomcat55  20   0  459m 285m  16m S   13 32.3 354:39.13 java
> > 
> > although by all means, it should not be doing that much sometimes.
> > 
> > How can I figure out what it is actually doing ?
> > I mean, which is the easiest standard tool or procedure not requiring a 
> > degree in quantum 
> > physics, and which could give me at least a rough idea of which webapp or 
> > internal tomcat 
> > process is keeping that CPU busy all the time ?
> > 
> > I have a nagging feeling that someone is going to tell me to take thread 
> > dumps.  If so, 
> > maybe they would also kindly point out a place where I could find some 
> > instructions as to 
> > how to interpret such a thing ?
> > 
> > Thanks
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> > For additional commands, e-mail: users-h...@tomcat.apache.org
> > 
> 
  

RE: what is it doing ?

2010-10-19 Thread Justin Randall

Hello,

>From a general Linux perspective, if you have a knowledge of Linux system 
>calls, along with what operations are performed by which web application you 
>could use "strace" (use the -f to follow threads).  Depending on what you're 
>interested in you can filter further for operations on files or network 
>activity (i.e. "-e trace=file,network,desc").  If you see a lot of erroneous 
>activity (such as constantly trying to open/stat a file that doesn't exist) 
>and you know which web app (or Tomcat) is responsible you can address the 
>issue.

You could also check "top" to see whether the CPU is being consumed in usr or 
sys space, along with whether maybe the memory on your system is maxed out 
(trigger high CPU load transfer data between RAM and swap space).

Regards,

Justin Randall

> Date: Tue, 19 Oct 2010 17:40:17 +0200
> From: a...@ice-sa.com
> To: users@tomcat.apache.org
> Subject: what is it doing ?
> 
> Hi.
> 
> I have a Linux system like so :
> 
> Linux arthur 2.6.26-2-686 #1 SMP Mon Aug 30 07:01:57 UTC 2010 i686 GNU/Linux
> 
> with a tomcat like so :
> 
> Using CATALINA_BASE:   /usr/share/tomcat5.5
> Using CATALINA_HOME:   /usr/share/tomcat5.5
> Using CATALINA_TMPDIR: /usr/share/tomcat5.5/temp
> Using JRE_HOME:   /usr/lib/jvm/java-1.5.0-sun
> Server version: Apache Tomcat/5.5
> Server built:   Oct 15 2008 12:57:44
> Server number:  5.5.26.0
> OS Name:Linux
> OS Version: 2.6.26-2-686
> Architecture:   i386
> JVM Version:1.5.0_22-b03
> JVM Vendor: Sun Microsystems Inc.
> 
> (Java JDK installed)
> 
> and where night and day, tomcat seems to be using a fair amount of CPU time, 
> like so :
> 
>PID USER  PR  NI  VIRT  RES  SHR S %CPU %MEMTIME+  COMMAND
>   2901 tomcat55  20   0  459m 285m  16m S   13 32.3 354:39.13 java
> 
> although by all means, it should not be doing that much sometimes.
> 
> How can I figure out what it is actually doing ?
> I mean, which is the easiest standard tool or procedure not requiring a 
> degree in quantum 
> physics, and which could give me at least a rough idea of which webapp or 
> internal tomcat 
> process is keeping that CPU busy all the time ?
> 
> I have a nagging feeling that someone is going to tell me to take thread 
> dumps.  If so, 
> maybe they would also kindly point out a place where I could find some 
> instructions as to 
> how to interpret such a thing ?
> 
> Thanks
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
  

RE: j_security_check with https

2009-01-07 Thread Justin Randall

Hello,

I'm not going to bother responding to the many posts that said the solution I 
mentioned was wrong, instead I'll just provide the example of how to do it, 
since it works.



. lines removed .

package blah;

. lines removed .

public final class SomeFilterClass implements Filter {

. lines removed .

public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse rsp = (HttpServletResponse) response;
rsp.sendRedirect(req.getRequestURI());
filterChain.doFilter(request, response);
}

. lines removed .

}
=

And below is what the web.xml looks like:

=

 lines removed .

  
  SomeFilterClass
  blah.SomeFilterClass
  
  
  SomeFilterClass
  /ssl/*
  FORWARD
  INCLUDE
  ERROR
  

. lines removed .

  
  
  RequiresLogin
  /html/*
  
  
  somerole
  
  
  
  
  
  RequiresSSL
  /ssl/*
  
  
  CONFIDENTIAL
  
  
  
  
  somerole
  
  
  
  FORM
  
  /ssl/login.jsp
  /ssl/login-error.jsp
  
  

. lines removed .

=

Of course you'll need to change the login/security constraint URLs and role 
name to match those in your environment.

For anyone who stated the earlier statements were incorrect, I encourage you to 
provide another "better" working example.  This one works for me and is used by 
other industry professionals.

Regards,

Justin

Here is an example:

> Date: Wed, 7 Jan 2009 09:35:33 +0100
> From: rc4...@googlemail.com
> To: users@tomcat.apache.org
> Subject: Re: j_security_check with https
> 
> Hi Justin,
> 
> On Wed, Jan 7, 2009 at 4:13 AM, Justin Randall  wrote:
> >
> > Create a Filter subclass with the sole purpose of having its "doFilter" 
> > method call "sendRedirect" on the HttpServletResponse object.  Map this 
> > Filter to the same URL pattern you use for SSL and make sure to use the 
> >  tags for FORWARD, INCLUDE, ERROR, and whatever other 
> > RequestDispatcher operations you want to ensure use SSL.
> >
> 
> You've got any example using this solution?
> 
> Gregor
> -- 
> just because your paranoid, doesn't mean they're not after you...
> gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
> gpgp-key available @ http://pgpkeys.pca.dfn.de:11371
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

_
Keep in touch and up to date with friends and family. Make the connection now.
http://www.microsoft.com/windows/windowslive/

RE: j_security_check with https

2009-01-06 Thread Justin Randall

Howdy,

First, to clear an incorrect point made...

There is a point of switching back to HTTP after HTTPS.  From a server load 
perspective having to perform SSL computations for every single HTTP request 
can be a serious performance bottleneck.  As for the security aspect, 
transmission of the username/password should be done over HTTPS, as this is 
considered "private/confidential" data and can be used to establish future 
authenticated sessions, however unless you are in a location where 
eavesdropping attacks are a risk, there is no need for encryption as the 
session ID is either a hashed string in a cookie, or the servlet is making use 
of URL re-writing, both of which are only "temporary passes" until the 
HttpSession has been invalidated.

Second, to answer the question regarding actions redirect to HTTP...

The reason the redirects are not going to HTTPS is because of the 
RequestDispatcher.  When Tomcat sees that you are trying to access a resource 
for which login is required, it FOWARDs the request to the login form.  The 
security constraints defined in web.xml are for when requests are made directly 
for those resources.  What this means is that your configuration to make sure 
that the login pages use SSL only come into affect when the browser requests 
them directly.  Requests that have been FORWARDed by the RequestDispatcher 
totally bypass the SSL constraints.

What is the solution?

Create a Filter subclass with the sole purpose of having its "doFilter" method 
call "sendRedirect" on the HttpServletResponse object.  Map this Filter to the 
same URL pattern you use for SSL and make sure to use the  tags for 
FORWARD, INCLUDE, ERROR, and whatever other RequestDispatcher operations you 
want to ensure use SSL.

Hope this helps.

Justin

> Date: Tue, 6 Jan 2009 19:01:24 -0200
> From: diegogus...@gmail.com
> To: users@tomcat.apache.org
> Subject: Re: j_security_check with https
> 
> this didnt work
> 
> 
> 
>   
>   
>   Usuario  
>   /login/*
>   POST
>   GET  
> 
>   
>   
>   
> CONFIDENTIAL
>   
> 
>   
> 
> if i try /login/login.jsp  work, but when i try an action and
> has restrict access, and havent user logged, tomcat redirect to login
> page with http !!!
> 
> 2009/1/6 Caldarale, Charles R :
> >> From: Diego Armando Gusava [mailto:diegogus...@gmail.com]
> >> Subject: Re: j_security_check with https
> >>
> >> when u login, your username and password will be transport https, but
> >> after that, you are in http! u dont need https because, you are only
> >> reading messages(emails)
> >
> > And what does that have to do with the behavior of a servlet container?
> >
> >  - 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
> >
> >
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 

_
Keep in touch and up to date with friends and family. Make the connection now.
http://www.microsoft.com/windows/windowslive/

RE: Form Based Authenticattion - j_security_check does not redirect from http to https

2008-12-09 Thread Justin Randall

Hello,

Are you using other filters?

If you are you will need the method to look like the below:

public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain filterChain) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse rsp = (HttpServletResponse) response;
rsp.sendRedirect(req.getRequestURI());
filterChain.doFilter(request, response);
}

However, from the looks of your stack trace the problem is with your 
"login.jsp?action=error" page.  You need to review your code to figure out 
where and how it is trying to create an HttpSession (presumably in the login 
error page) after a failed login attempt.

Regards,

Justin

> Date: Tue, 9 Dec 2008 02:29:53 -0800
> From: [EMAIL PROTECTED]
> To: users@tomcat.apache.org
> Subject: RE: Form Based Authenticattion - j_security_check does not redirect 
> from http to https
> 
> 
> 
> Justin Randall-5 wrote:
> > 
> > 
> > Hi again,
> > 
> > I thought about this a little more and I think what you're experiencing
> > might be as a result of the RequestDispatcher.
> > 
> > When the RequestDispatcher "fowards" to a URL resource, it overrides the
> > SSL/Authentication constraints you have setup.  There is a way of getting
> > around this (which also adds an additional layer of maintenance
> > programming security in your code) by using Filters.
> > 
> > Basically, in your web.xml you define a filter for your SSL protected
> > pages:
> > 
> >   
> >   MyFilterClass
> >   my.package.MyFilterClass
> >   
> >   
> >   MyFilterClass
> >   /ssl/*
> >   FORWARD
> >   INCLUDE
> >   ERROR
> >   
> > 
> > Below is a sample implementation of the "doFilter" that takes care of the
> > redirecting:
> > 
> > public void doFilter(ServletRequest request, ServletResponse response,
> > FilterChain arg2) throws IOException, ServletException {
> > HttpServletRequest req = (HttpServletRequest) request;
> > HttpServletResponse rsp = (HttpServletResponse) response;
> > rsp.sendRedirect(req.getRequestURI());
> > }
> > 
> > 
> 
> 
> I tried this but I got the following exception and the j_security_check page
> on http doesn't get redirected:
> 
> java.lang.IllegalStateException: Cannot create a session after the response
> has been committed
>   at org.apache.catalina.connector.Request.doGetSession(Request.java:2221)
>   at org.apache.catalina.connector.Request.getSession(Request.java:2031)
>   at
> org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:832)
>   at
> javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:216)
>   at
> org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:545)
>   at
> org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:494)
>   at
> org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:136)
>   at
> org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:113)
>   at
> org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:105)
>   at
> org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:62)
>   at org.apache.jsp.login_jsp._jspService(login_jsp.java:33)
>   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>   at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
>   at 
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>   at com.solidcore.bl.servlet.TagFilter.doFilter(TagFilter.java:110)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>   at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)
>   at
> org.apache.catalina.core.ApplicationDispatcher.pr

RE: Form Based Authenticattion - j_security_check does not redirect from http to https

2008-12-09 Thread Justin Randall

Hi again,

I thought about this a little more and I think what you're experiencing might 
be as a result of the RequestDispatcher.

When the RequestDispatcher "fowards" to a URL resource, it overrides the 
SSL/Authentication constraints you have setup.  There is a way of getting 
around this (which also adds an additional layer of maintenance programming 
security in your code) by using Filters.

Basically, in your web.xml you define a filter for your SSL protected pages:

  
  MyFilterClass
  my.package.MyFilterClass
  
  
  MyFilterClass
  /ssl/*
  FORWARD
  INCLUDE
  ERROR
  

Below is a sample implementation of the "doFilter" that takes care of the 
redirecting:

public void doFilter(ServletRequest request, ServletResponse response,
FilterChain arg2) throws IOException, ServletException {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse rsp = (HttpServletResponse) response;
rsp.sendRedirect(req.getRequestURI());
}

I hope this helps!

Justin

> From: [EMAIL PROTECTED]
> To: users@tomcat.apache.org
> Subject: RE: Form Based Authenticattion - j_security_check does not redirect 
> from http to https
> Date: Tue, 9 Dec 2008 03:28:10 -0500
> 
> 
> Hello,
> 
> Have you tried adding "j_security_check" to your web.xml for patterns which 
> should be redirected to SSL?
> 
> Regards,
> 
> Justin
> 
> > Date: Tue, 9 Dec 2008 00:17:36 -0800
> > From: [EMAIL PROTECTED]
> > To: users@tomcat.apache.org
> > Subject: Form Based Authenticattion - j_security_check does not redirect 
> > from http to https
> > 
> > 
> > Hi,
> > 
> >  
> > 
> > I am using Apache Tomcat Version 5.5.2. I am running it on Windows XP
> > Professional Service Pack 2.
> > 
> >  
> > 
> > I have a form based authentication for my application:
> > 
> >  
> > 
> > […]
> > 
> > 
> > 
> >   FORM
> > 
> >   Authentication Area
> > 
> >   
> > 
> > /login.jsp
> > 
> > /login.jsp?action=error
> > 
> >
> > 
> > 
> > 
> > […]
> > 
> >  
> > 
> >  
> > 
> > Also, I have redirected all my requests for port-80 to port-443. So,
> > whenever I try to open a page in http, it automatically gets redirected to
> > https. This is working fine for all the pages. 
> > 
> >  
> > 
> > Except, when I open the http://localhost//j_security_check page it
> > does not get redirected and stays on http. This is the only page showing
> > this deviation in behavior.
> > 
> > For example, the http://localhost//security_check page gets
> > redirected to https, and the same goes for my login page and all other pages
> > in my app.
> > 
> >  
> > 
> > Is this a known issue or is there a configuration that I am unaware of.
> > 
> >  
> > 
> > Thanks a lot.
> > 
> > 
> > -- 
> > View this message in context: 
> > http://www.nabble.com/Form-Based-Authenticattion---j_security_check-does-not-redirect-from-http-to-https-tp20910454p20910454.html
> > Sent from the Tomcat - User mailing list archive at Nabble.com.
> > 
> > 
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> _
> 

_



RE: Form Based Authenticattion - j_security_check does not redirect from http to https

2008-12-09 Thread Justin Randall

Hello,

Have you tried adding "j_security_check" to your web.xml for patterns which 
should be redirected to SSL?

Regards,

Justin

> Date: Tue, 9 Dec 2008 00:17:36 -0800
> From: [EMAIL PROTECTED]
> To: users@tomcat.apache.org
> Subject: Form Based Authenticattion - j_security_check does not redirect from 
> http to https
> 
> 
> Hi,
> 
>  
> 
> I am using Apache Tomcat Version 5.5.2. I am running it on Windows XP
> Professional Service Pack 2.
> 
>  
> 
> I have a form based authentication for my application:
> 
>  
> 
> […]
> 
> 
> 
>   FORM
> 
>   Authentication Area
> 
>   
> 
> /login.jsp
> 
> /login.jsp?action=error
> 
>
> 
> 
> 
> […]
> 
>  
> 
>  
> 
> Also, I have redirected all my requests for port-80 to port-443. So,
> whenever I try to open a page in http, it automatically gets redirected to
> https. This is working fine for all the pages. 
> 
>  
> 
> Except, when I open the http://localhost//j_security_check page it
> does not get redirected and stays on http. This is the only page showing
> this deviation in behavior.
> 
> For example, the http://localhost//security_check page gets
> redirected to https, and the same goes for my login page and all other pages
> in my app.
> 
>  
> 
> Is this a known issue or is there a configuration that I am unaware of.
> 
>  
> 
> Thanks a lot.
> 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Form-Based-Authenticattion---j_security_check-does-not-redirect-from-http-to-https-tp20910454p20910454.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_



RE: Tomcat 6.0.18 Servlet Loading/Reloading

2008-12-04 Thread Justin Randall

Hello,

After continuing to dig further and perform some additional debugging, it turns 
out that the "init" methods are being called on startup.

The problem is that the DataSource which I'm pulling from the ServletContext is 
failing to initialize itself on start-up, but succeeds when moving the .war 
file into the webapps directory.  I'll continue to debug this further and 
respond with more information as it becomes available.

Thanks,

Justin.

> From: [EMAIL PROTECTED]
> To: users@tomcat.apache.org
> Subject: RE: Tomcat 6.0.18 Servlet Loading/Reloading
> Date: Thu, 4 Dec 2008 10:00:38 -0500
> 
> 
> Hi Chuck,
> 
> Thanks for the response.  I guess perhaps I was not clear enough in my 
> configuration or description of the issue.
> 
> Each Servlet in the application has X 
> where X represents the numeric order in which I've assigned them to start.
> 
> Also what I did mention previously is that "init" is NOT called when I browse 
> to the URI, however the Servlet is loaded as my System.out.println statements 
> in "doGet/doPost"  are being output to catalina.out and they also show that 
> "init" was never called (by checking parameters that should have been 
> initialized by "init".
> 
> Lastly, the reason I say "init' methods is that there IS more than one, and 
> Tomcat calls both of them when initializing a Servlet.  If you think this is 
> incorrect, make sure to @Override both "init" and "init(ServletConfig 
> config)" and have different logging statements.  You will see both of them 
> being executed when Tomcat loads the Servlet.
> 
> I hope this helps better clarify the situation.
> 
> Justin.
> 
> > From: [EMAIL PROTECTED]
> > To: users@tomcat.apache.org
> > Date: Wed, 3 Dec 2008 20:46:50 -0600
> > Subject: RE: Tomcat 6.0.18 Servlet Loading/Reloading
> > 
> > > From: Justin Randall [mailto:[EMAIL PROTECTED]
> > > Subject: RE: Tomcat 6.0.18 Servlet Loading/Reloading
> > >
> > > Basically when I restart Tomcat, it doesn't call any of the
> > > "init" methods of the Servlet
> > 
> > Unless you have  set for the servlet in your webapp's 
> > WEB-INF/web.xml, that is correct behavior for a Tomcat restart.  The init() 
> > method (there can only be one per servlet) should be called upon first 
> > reference to a URL that matches a  element inside one of your 
> >  elements.  If  is set, the init() method 
> > will be called at Tomcat restart for each such servlet.
> > 
> > > however all of the initialization which was to be
> > > performed by the "init" methods was never done.
> > 
> > You keep using the word "methods" when there is only one init() method for 
> > a given servlet; why is that?
> > 
> > > When I copy the existing war file from the webapps directory
> > > to another location, update the modify timestamp and then
> > > move it back into the webapps directory, the "init" methods
> > > are then called and the application works properly.
> > 
> > This is also correct behavior for initial or re-deployment.  Although the 
> > spec doesn't require it, Tomcat calls the init() methods to verify webapp 
> > viability at these times.
> > 
> >  - 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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > 
> 
> _
> 

_



RE: Tomcat 6.0.18 Servlet Loading/Reloading

2008-12-04 Thread Justin Randall

Hi Chuck,

Thanks for the response.  I guess perhaps I was not clear enough in my 
configuration or description of the issue.

Each Servlet in the application has X where 
X represents the numeric order in which I've assigned them to start.

Also what I did mention previously is that "init" is NOT called when I browse 
to the URI, however the Servlet is loaded as my System.out.println statements 
in "doGet/doPost"  are being output to catalina.out and they also show that 
"init" was never called (by checking parameters that should have been 
initialized by "init".

Lastly, the reason I say "init' methods is that there IS more than one, and 
Tomcat calls both of them when initializing a Servlet.  If you think this is 
incorrect, make sure to @Override both "init" and "init(ServletConfig config)" 
and have different logging statements.  You will see both of them being 
executed when Tomcat loads the Servlet.

I hope this helps better clarify the situation.

Justin.

> From: [EMAIL PROTECTED]
> To: users@tomcat.apache.org
> Date: Wed, 3 Dec 2008 20:46:50 -0600
> Subject: RE: Tomcat 6.0.18 Servlet Loading/Reloading
> 
> > From: Justin Randall [mailto:[EMAIL PROTECTED]
> > Subject: RE: Tomcat 6.0.18 Servlet Loading/Reloading
> >
> > Basically when I restart Tomcat, it doesn't call any of the
> > "init" methods of the Servlet
> 
> Unless you have  set for the servlet in your webapp's 
> WEB-INF/web.xml, that is correct behavior for a Tomcat restart.  The init() 
> method (there can only be one per servlet) should be called upon first 
> reference to a URL that matches a  element inside one of your 
>  elements.  If  is set, the init() method 
> will be called at Tomcat restart for each such servlet.
> 
> > however all of the initialization which was to be
> > performed by the "init" methods was never done.
> 
> You keep using the word "methods" when there is only one init() method for a 
> given servlet; why is that?
> 
> > When I copy the existing war file from the webapps directory
> > to another location, update the modify timestamp and then
> > move it back into the webapps directory, the "init" methods
> > are then called and the application works properly.
> 
> This is also correct behavior for initial or re-deployment.  Although the 
> spec doesn't require it, Tomcat calls the init() methods to verify webapp 
> viability at these times.
> 
>  - 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

_



RE: Tomcat 6.0.18 Servlet Loading/Reloading

2008-12-03 Thread Justin Randall

I've been doing some more testing and added a bunch of "System.out.println" 
statements to the "init", "init(ServletConfig)", and "doPost/doGet" methods so 
that I could see what my application was doing without log4j initialized.

Basically when I restart Tomcat, it doesn't call any of the "init" methods of 
the Servlet, however it does load it partially.  When I actually browse to the 
URL of the Servlet, I can see my "System.out.println" statements being output 
to catalina.out, however all of the initialization which was to be performed by 
the "init" methods was never done.

When I copy the existing war file from the webapps directory to another 
location, update the modify timestamp and then move it back into the webapps 
directory, the "init" methods are then called and the application works 
properly.


> From: [EMAIL PROTECTED]
> To: users@tomcat.apache.org
> Subject: Tomcat 6.0.18 Servlet Loading/Reloading
> Date: Wed, 3 Dec 2008 19:22:15 -0500
> 
> 
> Hello,
> 
> I have a very strange issue with Tomcat 6.0.18 and I'm not sure what 
> information to provide to help debug further.
> 
> I have an installation of Tomcat 6.0.18 which fails to properly initialize 
> servlets upon restart. If I deploy a new application.war file while Tomcat is 
> running (even if it is the same war file with different modify timestamp) 
> everything loads up just fine.  Below are the system details:
> 
>   - Tomcat: Tomcat version 6.0.18 with APR 1.1.14
>   - Java: JDK 1.6u10
>   - RedHat Enteprise Linux 5
> 
> It seems that Servlet X, for example, does load to a point, because it 
> returns a value, however the log4j subsystem is not initialized at all 
> (providing me with no debug info at all) and catalina.out/err show no signs 
> of trouble.  Below is a snippet of restarting Tomcat.
> 
> =
> Dec 3, 2008 7:08:36 PM org.apache.coyote.http11.Http11AprProtocol pause
> INFO: Pausing Coyote HTTP/1.1 on http-80
> Dec 3, 2008 7:08:37 PM org.apache.catalina.core.StandardService stop
> INFO: Stopping service Catalina
> Dec 3, 2008 7:08:37 PM org.apache.catalina.core.ApplicationContext log
> INFO: SessionListener: contextDestroyed()
> Dec 3, 2008 7:08:37 PM org.apache.catalina.core.ApplicationContext log
> INFO: ContextListener: contextDestroyed()
> Dec 3, 2008 7:08:37 PM org.apache.coyote.http11.Http11AprProtocol destroy
> INFO: Stopping Coyote HTTP/1.1 on http-80
> Dec 3, 2008 7:08:43 PM org.apache.catalina.core.AprLifecycleListener init
> INFO: Loaded APR based Apache Tomcat Native library 1.1.14.
> Dec 3, 2008 7:08:43 PM org.apache.catalina.core.AprLifecycleListener init
> INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], 
> random [true].
> Dec 3, 2008 7:08:43 PM org.apache.coyote.http11.Http11AprProtocol init
> INFO: Initializing Coyote HTTP/1.1 on http-80
> Dec 3, 2008 7:08:43 PM org.apache.catalina.startup.Catalina load
> INFO: Initialization processed in 562 ms
> Dec 3, 2008 7:08:43 PM org.apache.catalina.core.StandardService start
> INFO: Starting service Catalina
> Dec 3, 2008 7:08:43 PM org.apache.catalina.core.StandardEngine start
> INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
> Dec 3, 2008 7:08:44 PM org.apache.catalina.core.ApplicationContext log
> INFO: ContextListener: contextInitialized()
> Dec 3, 2008 7:08:44 PM org.apache.catalina.core.ApplicationContext log
> INFO: SessionListener: contextInitialized()
> Dec 3, 2008 7:08:44 PM org.apache.coyote.http11.Http11AprProtocol start
> INFO: Starting Coyote HTTP/1.1 on http-80
> Dec 3, 2008 7:08:44 PM org.apache.catalina.startup.Catalina start
> INFO: Server startup in 1432 ms
> AbandonedObjectPool is used ([EMAIL PROTECTED])
>LogAbandoned: false
>RemoveAbandoned: true
>RemoveAbandonedTimeout: 60
> =
> 
> Then once I move a new .war file into the webapps directory:
> 
> =
> Dec 3, 2008 7:20:25 PM org.apache.catalina.startup.HostConfig checkResources
> INFO: Undeploying context [/thewebapplication]
> Dec 3, 2008 7:20:25 PM org.apache.catalina.startup.HostConfig deployWAR
> INFO: Deploying web application archive thewebapplication.war
> =
> 
> Has anyone else ever experienced this before and can provide some help?
> 
> Kind regards,
> 
> Justin
> 
> _
> 

_



Tomcat 6.0.18 Servlet Loading/Reloading

2008-12-03 Thread Justin Randall

Hello,

I have a very strange issue with Tomcat 6.0.18 and I'm not sure what 
information to provide to help debug further.

I have an installation of Tomcat 6.0.18 which fails to properly initialize 
servlets upon restart. If I deploy a new application.war file while Tomcat is 
running (even if it is the same war file with different modify timestamp) 
everything loads up just fine.  Below are the system details:

  - Tomcat: Tomcat version 6.0.18 with APR 1.1.14
  - Java: JDK 1.6u10
  - RedHat Enteprise Linux 5

It seems that Servlet X, for example, does load to a point, because it returns 
a value, however the log4j subsystem is not initialized at all (providing me 
with no debug info at all) and catalina.out/err show no signs of trouble.  
Below is a snippet of restarting Tomcat.

=
Dec 3, 2008 7:08:36 PM org.apache.coyote.http11.Http11AprProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-80
Dec 3, 2008 7:08:37 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Dec 3, 2008 7:08:37 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Dec 3, 2008 7:08:37 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
Dec 3, 2008 7:08:37 PM org.apache.coyote.http11.Http11AprProtocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-80
Dec 3, 2008 7:08:43 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.14.
Dec 3, 2008 7:08:43 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], 
random [true].
Dec 3, 2008 7:08:43 PM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-80
Dec 3, 2008 7:08:43 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 562 ms
Dec 3, 2008 7:08:43 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 3, 2008 7:08:43 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
Dec 3, 2008 7:08:44 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 3, 2008 7:08:44 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Dec 3, 2008 7:08:44 PM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-80
Dec 3, 2008 7:08:44 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1432 ms
AbandonedObjectPool is used ([EMAIL PROTECTED])
   LogAbandoned: false
   RemoveAbandoned: true
   RemoveAbandonedTimeout: 60
=

Then once I move a new .war file into the webapps directory:

=
Dec 3, 2008 7:20:25 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/thewebapplication]
Dec 3, 2008 7:20:25 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive thewebapplication.war
=

Has anyone else ever experienced this before and can provide some help?

Kind regards,

Justin

_