You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vernon Wu <ve...@gatewaytech.com> on 2002/08/08 14:09:58 UTC

Re: Tomcat as a service problem

Which version TC you are using? When the memory problem occurs, during the TC up, or running an application?

The cause of the problem is likely on your side, not in TC.

 
8/8/2002 10:43:33 AM, "Jose Francisco Junior" <jj...@zipmail.com> wrote:

>I have tried to use tomcat as a service in a Windows 2000
> and I verified that it steals the computers memory(RAM).
> Now I am not more running it as a NT service and the
> computer´s memory is ok.
>
>Is there any know Tomcat bug like that ???
>
>
>Thanks,
>Junior
>________________________________________________
>Don't E-Mail, ZipMail! http://www.zipmail.com/
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: jsp include question

Posted by Jose Francisco Junior <jj...@zipmail.com>.
If you want to redirect the request you have to do it
 before printing any other thing on the page.

Example:

it works:

<redirect code here>

<html>
<head>
...
</head>
...

it does not work:

<html>
<head>
...
</head>

<redirect code here>
...
On Fri, 9 Aug 2002 09:38:32 -0700 (PDT)
Ashish Kulkarni <ku...@yahoo.com> wrote:
>Hi
>
>I am developing a web application and came accross
>this problem.
>when in my jsp page i have <jsp:include> runtime
>include and then later in the code when i have
>response.sendRedirect or
>request.getRequestDispatcher() to forward the jsp page
>i get error saying the
>java.lang.IllegalStateException: Response has already
>been committed.
>but when i use <%@ %> compile time include i  dont get
>this error, 
>Can some one explain the why
>Ashish
>
>__________________________________________________
>Do You Yahoo!?
>HotJobs - Search Thousands of New Jobs
>http://www.hotjobs.com
>
>--
>To unsubscribe, e-mail:
>   <ma...@jakarta.apache.org>
>For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>

-----------------------------------------
Prefiro as lágrimas da derrota
do que a vergonha de não ter lutado... 

Willan Brook
-----------------------------------------
________________________________________________
Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


jsp include question

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi

I am developing a web application and came accross
this problem.
when in my jsp page i have <jsp:include> runtime
include and then later in the code when i have
response.sendRedirect or
request.getRequestDispatcher() to forward the jsp page
i get error saying the
java.lang.IllegalStateException: Response has already
been committed.
but when i use <%@ %> compile time include i  dont get
this error, 
Can some one explain the why
Ashish

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: error in jsp??? Response has already been committed

Posted by Tim Funk <fu...@joedog.org>.
If that is how your page is programmed - then yes.

In a nutshell - try to ensure your JSP is doing "display" things only. 
Or if it needs to perform logic which may invoke errors 
(getting/checking data) - try to perform that logic at the very 
beginning of the JSP so a minimal amount of info is buffered and 
exceptions may be caught and you can effortlessly redirect to an error page.


Ashish Kulkarni wrote:
> Hi 
> I had this problem with tomcat so was verifying with
> jrun, and got the same error, i have increades the
> buffer size to 128k, so i guess buffer is not filled, 
> when u say response has send back to client, does this
> mean that i have started writing html from jsp, and
> half way down i get the error and then i try to
> forward the request???
> if this is correct i think i will have to modify the
> logic
> Ashish
> --- Tim Funk <fu...@joedog.org> wrote:
> 
>>Sneaky sneaky - posting a JRun problem on the
>>tomcat-user list :0
>>
>>Anyhow - It appears you are trying to forward to
>>another page but you 
>>can't because "you" (actually your servlet engine)
>>have already sent 
>>data back to the client. (Why? I don't know. Maybe
>>because you are using 
>>a JSP that has lots of whitespace which is filling
>>up a buffer?)
>>
>>Once data is sent back the to client - your can't do
>>any of the following:
>>- Send redirects
>>- Forward to another JSP (or servlet)
>>- Set response headers (Cookies, character encoding
>>...)
>>
>>
>>Ashish Kulkarni wrote:
>>
>>>Hi,
>>>
>>>I am developing some jsp pages, and i get the
>>>following error <br>
>>>java.lang.IllegalStateException: Response has
>>
>>already
>>
>>>been committed
>>>	at
>>>
>>
> allaire.jrun.servlet.JRunResponse.resetContent(../servlet/JRunResponse.java:172)
> 
>>>	at
>>>
>>
> allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1201)
> 
>>>	at
>>>
>>
> allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:89)<br>
> 
>>>In my jsp, I have some logic which check if there
>>
>>is
>>
>>>anydata in database or else forwards the request
>>
>>to
>>
>>>other page, 
>>>so when i m trying to forward the request i get
>>
>>this
>>
>>>error.
>>>I tried
>>>
>>
> request.getRequestDispatcher("PL1077Display.jsp").forward(request,
> 
>>>response);
>>>
>>>also
>>>response.sendRedirect("PL1077Display.jsp");
>>>and also <jsp:forward >
>>><br> with same error...
>>><br> how can i solve it
>>><br>
>>>Ashish
>>>
>>> 
>>
>>
>>--
>>To unsubscribe, e-mail:  
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
> 
> 
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: error in jsp??? Response has already been committed

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi 
I had this problem with tomcat so was verifying with
jrun, and got the same error, i have increades the
buffer size to 128k, so i guess buffer is not filled, 
when u say response has send back to client, does this
mean that i have started writing html from jsp, and
half way down i get the error and then i try to
forward the request???
if this is correct i think i will have to modify the
logic
Ashish
--- Tim Funk <fu...@joedog.org> wrote:
> Sneaky sneaky - posting a JRun problem on the
> tomcat-user list :0
> 
> Anyhow - It appears you are trying to forward to
> another page but you 
> can't because "you" (actually your servlet engine)
> have already sent 
> data back to the client. (Why? I don't know. Maybe
> because you are using 
> a JSP that has lots of whitespace which is filling
> up a buffer?)
> 
> Once data is sent back the to client - your can't do
> any of the following:
> - Send redirects
> - Forward to another JSP (or servlet)
> - Set response headers (Cookies, character encoding
> ...)
> 
> 
> Ashish Kulkarni wrote:
> > Hi,
> > 
> > I am developing some jsp pages, and i get the
> > following error <br>
> > java.lang.IllegalStateException: Response has
> already
> > been committed
> > 	at
> >
>
allaire.jrun.servlet.JRunResponse.resetContent(../servlet/JRunResponse.java:172)
> > 	at
> >
>
allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1201)
> > 	at
> >
>
allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:89)<br>
> > 
> > In my jsp, I have some logic which check if there
> is
> > anydata in database or else forwards the request
> to
> > other page, 
> > so when i m trying to forward the request i get
> this
> > error.
> > I tried
> >
>
request.getRequestDispatcher("PL1077Display.jsp").forward(request,
> > response);
> > 
> > also
> > response.sendRedirect("PL1077Display.jsp");
> > and also <jsp:forward >
> > <br> with same error...
> > <br> how can i solve it
> > <br>
> > Ashish
> > 
> >  
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: error in jsp??? Response has already been committed

Posted by Tim Funk <fu...@joedog.org>.
Sneaky sneaky - posting a JRun problem on the tomcat-user list :0

Anyhow - It appears you are trying to forward to another page but you 
can't because "you" (actually your servlet engine) have already sent 
data back to the client. (Why? I don't know. Maybe because you are using 
a JSP that has lots of whitespace which is filling up a buffer?)

Once data is sent back the to client - your can't do any of the following:
- Send redirects
- Forward to another JSP (or servlet)
- Set response headers (Cookies, character encoding ...)


Ashish Kulkarni wrote:
> Hi,
> 
> I am developing some jsp pages, and i get the
> following error <br>
> java.lang.IllegalStateException: Response has already
> been committed
> 	at
> allaire.jrun.servlet.JRunResponse.resetContent(../servlet/JRunResponse.java:172)
> 	at
> allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1201)
> 	at
> allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:89)<br>
> 
> In my jsp, I have some logic which check if there is
> anydata in database or else forwards the request to
> other page, 
> so when i m trying to forward the request i get this
> error.
> I tried
> request.getRequestDispatcher("PL1077Display.jsp").forward(request,
> response);
> 
> also
> response.sendRedirect("PL1077Display.jsp");
> and also <jsp:forward >
> <br> with same error...
> <br> how can i solve it
> <br>
> Ashish
> 
>  


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


error in jsp??? Response has already been committed

Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi,

I am developing some jsp pages, and i get the
following error <br>
java.lang.IllegalStateException: Response has already
been committed
	at
allaire.jrun.servlet.JRunResponse.resetContent(../servlet/JRunResponse.java:172)
	at
allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1201)
	at
allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDispatcher.java:89)<br>

In my jsp, I have some logic which check if there is
anydata in database or else forwards the request to
other page, 
so when i m trying to forward the request i get this
error.
I tried
request.getRequestDispatcher("PL1077Display.jsp").forward(request,
response);

also
response.sendRedirect("PL1077Display.jsp");
and also <jsp:forward >
<br> with same error...
<br> how can i solve it
<br>
Ashish



__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat as a service problem

Posted by Jose Francisco Junior <jj...@zipmail.com>.
I am using the Tomcat 4.0.3 and the problem accurs when the
 application is runnig. I don´t know why, but the TC is
 holding more memory as necessary.

I don´t think the problem is in my side, because the
 application works fine when the TC isn't running as
 service...

This is a strange problem, I think I should not use TC as a
 service until the next release.

Thanks for your atention,
Junior

On Thu, 08 Aug 2002 05:09:58 -0700
Vernon Wu <ve...@gatewaytech.com> wrote:
>
>Which version TC you are using? When the memory problem
> occurs, during the TC up, or running an application?
>
>The cause of the problem is likely on your side, not in
> TC.
>
> 
>8/8/2002 10:43:33 AM, "Jose Francisco Junior"
> <jj...@zipmail.com> wrote:
>
>>I have tried to use tomcat as a service in a Windows 2000
>> and I verified that it steals the computers memory(RAM).
>> Now I am not more running it as a NT service and the
>> computer´s memory is ok.
>>
>>Is there any know Tomcat bug like that ???
>>
>>
>>Thanks,
>>Junior
>>________________________________________________
>>Don't E-Mail, ZipMail! http://www.zipmail.com/
>>
>>--
>>To unsubscribe, e-mail:
>   <ma...@jakarta.apache.org>
>>For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>>
>>
>
>
>
>
>--
>To unsubscribe, e-mail:
>   <ma...@jakarta.apache.org>
>For additional commands, e-mail:
> <ma...@jakarta.apache.org>
________________________________________________
Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>