Tomcat Settings advice on long-running process.

2003-11-12 Thread Elankath, Tarun (Cognizant)
Hi list,

We have a long running process (all in java, not external) that is initiated from 
struts action class, (does a lot of file I/O, etc)

The browser apparently timesout after about 20 minutes or whereabouts, and then 
suddenly the process do stops bang in the middle as soon as this happens. This is 
quite puzzling as one expects the process to continue even if the browser timed out.

I do know the correct solution is to make it run in the background and give constant 
updates to the user, however, we just need to make it work ASAP with the correct 
approach. We'll migrate to the background process  progress page approach soon enough.

Any pointers/comments on browser (Internet Explorer), server (Tomcat) settings and 
Struts settings to handle long-running activities in the web-request cycle would be 
greatly appreciated. I did scout the web, but apart from the connectionTimeout setting 
in the connector element of tomcat, I didn't find anything much. I don't think 
increasing session-timeout would be of any help here.

Any pointers on how to avoid the 'freeze' would also be much appreciated. 

Thank you,
Tarun

This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Visit us at http://www.cognizant.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Tomcat Settings advice on long-running process.

2003-11-12 Thread Elankath, Tarun (Cognizant)
Hmm. thanks people.
I was just scouting for an quick-and-dirty fix, that's all. But I guess, the 
background-thread and progress page seems to be the only suitable fix.

Unfortunately the process is part of some existing java code that is being maintained 
by us. So I am not allowed (literally) to change its code to reflect status updates. I 
can only only whether its completed or failed.

I guess a meta-refresh page, with a Please Wait.. message is what I would have to do.

Thank you all,
Tarun

-Original Message-
From: Rodrigo Ruiz [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 12, 2003 7:39 PM
To: Tomcat Users List
Subject: Re: Tomcat Settings advice on long-running process.


Elankath, Tarun (Cognizant) wrote:

Hi list,

We have a long running process (all in java, not external) that is initiated from 
struts action class, (does a lot of file I/O, etc)

The browser apparently timesout after about 20 minutes or whereabouts, and then 
suddenly the process do stops bang in the middle as soon as this happens. This is 
quite puzzling as one expects the process to continue even if the browser timed out.
  

If you do not write anything to the servlet output, perhaps Tomcat is 
assuming some kind of connection timeout or it is somehow detecting that 
the remote browser has broken the connection. I guess you cannot change 
this behaviour.

I do know the correct solution is to make it run in the background and give constant 
updates to the user, however, we just need to make it work ASAP with the correct 
approach. We'll migrate to the background process  progress page approach soon 
enough.
  

That's correct. IMHO you should move to this approach ASAP. Otherwise, 
you could encounter migration problems and bugs, due to some differences 
in how to make thing work. Remember your thread will have to notify 
state changes to a listener, or publish state data for your structs 
action to be able to get it. You should take this into account right 
now, even before migration :-)

Any pointers/comments on browser (Internet Explorer), server (Tomcat) settings and 
Struts settings to handle long-running activities in the web-request cycle would be 
greatly appreciated. I did scout the web, but apart from the connectionTimeout 
setting in the connector element of tomcat, I didn't find anything much. I don't 
think increasing session-timeout would be of any help here.
  

If you have access to the servlet output from your process, you could 
write something to it from time to time. If, for example, you write 
html right at the beggining of your servlet process, you can write 
dummy comments like !-- --. If you put these statements in the right 
point, you could keep the connection alive until the process finishes. 
If you do this, remember to do an out.flush() after the writing.

I once did something similar. I wrote an html page with two divs 
simulating a progress bar. My process started just before writing the 
/html tag. During the process I was sending a javascript code that was 
updating the inner div width according to the current state of the process.

This worked for me, but it made my process code far more complex than 
necessary... and than maintainable :-P

Finally, I dropped that code and replaced it by a background thread 
approach.

Hope this helps you,
Rodrigo Ruiz

Any pointers on how to avoid the 'freeze' would also be much appreciated. 

Thank you,
Tarun
  




This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

   Visit us at http://www.cognizant.com


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Visit us at http://www.cognizant.com

Howto setup env with WAR in Tomcat and EJB's in WebSphere ?

2003-07-18 Thread Elankath, Tarun (Cognizant)
Hi all,

I need to setup a devel environment where web-applications are deployed in the local 
instance of Tomcat and ejb's are deployed in a remote WebSphere instance.

I have created all the remote interfaces  deployment descriptors, the ejb jar's, the 
WAR's and the EAR. I have deployed the EAR file on WebSphere and it works fine.

I guess I need to do use a different InitialContext and possibly other things as well 
for the Tomcat web 2 WebSphere EJB connection.

All help deeply appreciated,
Tarun








This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Visit us at http://www.cognizant.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: Tomcat Scheduler

2003-03-18 Thread Elankath, Tarun (Cognizant)
Thanks RND. 

I had just wanted to know whether there was a 'tomcat' way of doing it. Otherwise the 
solution that you suggested was the one I was going to try out.



-Original Message-
From: Tomcat-RND [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 16, 2003 2:06 PM
To: Tomcat Users List; [EMAIL PROTECTED]
Subject: Re: Tomcat Scheduler


Hi,

You can use JDK1.3 provided classes from java.util package. Use the
TimerTask, Timer classes.
Start a load-on-startup servlet of your application and use the above
classes if your requirement is such that these should run whenver server is
started.
Other wise you can invoke from a request obviously.

Hope this may suit your requirement.

Regards,
Pratt.





- Original Message -
From: Tarun Ramakrishna Elankath [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 16, 2003 2:01 PM
Subject: Tomcat Scheduler


 Hi list,

 Is there any scheduler facility that tomcat offers? By means of which I
 can schedule a task to occur (actually sending email, + other stuff) at
 regular intervals.

 Thanks,
 Tarun


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Visit us at http://www.cognizant.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]