You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Yoel Spotts <yo...@secured-services.com> on 2003/11/12 23:01:08 UTC

getting IOException when parsing template

Hello everyone. I searched the archives for my problem but did not come 
up with anything. We are getting a rather strange IOException when 
rendering a template, speficially from a #parse directive. Here is the 
error message reported in the lgo file:

Exception rendering #parse( user_conf.vm )  : java.io.IOException: 
Object state is improper for request.

The strange thing is that this only happens sometimes -- most of the 
time it works fine. I could not even find that error text related to 
IOException in a google search.

Anyone have any ideas?

Thanks a lot,

Yoel Spotts

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Yoel Spotts <yo...@secured-services.com>.

Dave Newton wrote:

> On Fri, 2003-11-14 at 14:46, Yoel Spotts wrote:
> 
>>I thought of that as well that the content of the template might have 
>>caused the Exception but really the template does very little -- just 
>>rendering some stuff which was placed in the context. Does not seem 
>>likely. I also should have mentioned we are using velocity within an 
>>iplanet web server.
> 
> 
> Really, what's in it though?
> 

Sorry, I should have posted it to begin with. The following parameters 
are passed into the context:

1) $doDUR -- a simple Boolean value
2) $allRoles -- a String array
3) $applicants -- an array of HashMaps. Each HashMap contains pairs of 
String to String mappings. There is one mapping called mri in the 
template which is a simple class which contains several String fields.

I hope this helps. If there is any other information which may be 
helpful, please let me know!

Thanks,

Yoel


user_appl.vm
==============

<center>
<H3>Applicant List</H3>
<script language=JavaScript>
function checkIt (theForm)
{
     var checked = false;
     var els = theForm.elements;
     var i;
     for (i = 0; i < theForm.length; i++) {
         if (theForm.elements[i].type == "checkbox") {
             if (theForm.elements[i].checked) {
                 checked = true;
                 break;;
             }
         }
     }
     if (!checked) {
         alert ("Please select an user first");
         return false;
     }
     return true;
}
</script>
<FORM METHOD="POST" ACTION="$req.RequestURI" onSubmit="return 
checkIt(this) && disableSubmit(this);" >
#if ($doDUR)
   <TABLE COLS=10 CELLPADDING=0 CELLSPACING=4 BORDER=0
     style="background-color: rgb(155,186,214);" width="96%">
#else
   <TABLE COLS=8  CELLPADDING=0 CELLSPACING=4 BORDER=0
     style="background-color: rgb(155,186,214);" width="96%">
#end
     <TR align=left>
	<TH nowrap>Applicant Name</TH>
	<TH>Account Name</TH>
#if ($doDUR)
	<TH>Requested Roles</TH>
	<TH>Approved Roles</TH>
	<TH>Email Address</TH>
	<TH>Access Code</TH>
#else
	<TH>Approved Roles</TH>
	<TH>Email Address</TH>
#end
	<TH>Duty Phone</TH>
	<TH>Home Phone</TH>
	<TH>Pager</TH>
	<TH>Reason</TH>
     </TR>
     #foreach ($user in $applicants)
     <TR>
#if ($doDUR)
        <td colspan=10 bgcolor="#ffffff" height=2><img 
src="images/shim.gif"></td>
#else
        <td colspan=8 bgcolor="#ffffff" height=2><img 
src="images/shim.gif"></td>
#end
     </TR>
     <TR align=left>
	<TD nowrap>
          <INPUT TYPE="checkbox" NAME=sel_$user.Name 
VALUE="yes"/>&nbsp;$!user.FullName
         </TD>
	<INPUT TYPE="hidden" NAME="name_$user.Name" VALUE="$!user.FullName"/>
	<INPUT TYPE="hidden" NAME="currole_$user.Name" VALUE="$!user.Role"/>
	<INPUT TYPE="hidden" NAME="email_$user.Name" VALUE="$!user.Email"/>
	<TD nowrap>
             &nbsp;$!user.Name
         </TD>
#if ($doDUR)
	<TD>
	    #foreach ($role in $user.mri.RequestedRoles)
	    $role <BR>
	    #end
	</TD>
	<TD>
	    <SELECT NAME="selrole_$user.Name" MULTIPLE size=5>
	    #foreach ($role in $allRoles)
		<OPTION VALUE="$role">$role
	    #end
	    </SELECT>
	</TD>
	<TD>&nbsp;$!user.Email</TD>
	<TD>&nbsp;$!user.accesscode</TD>
#else
	<TD>
	    <SELECT NAME="selrole_$user.Name" MULTIPLE size=5>
	    #foreach ($role in $allRoles)
		<OPTION VALUE="$role">$role
	    #end
	    </SELECT>
	</TD>
	<TD>&nbsp;$!user.Email</TD>
#end
	<TD>&nbsp;$!user.mri.DutyPhone</TD>
	<TD>&nbsp;$!user.mri.HomePhone</TD>
	<TD>&nbsp;$!user.mri.Pager</TD>
	<TD><INPUT TYPE="text" SIZE=20" NAME="reason_$user.Name"></TD>
     </TR>
     #end

     </TABLE>
     <p align="center">
     <INPUT TYPE="submit" name="Action" VALUE="Accredit Applicants">
     &nbsp;&nbsp
     <INPUT TYPE="submit" name="Action" VALUE="Delete Applicants">
     &nbsp
     </p>
</FORM>
</center>



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Will Glass-Husain <wg...@forio.com>.
Look's like it is generated by the sun libraries.  Maybe it's an encoding
issue?  Do you explicitly set the encoding? If so, to what?

WILL

----- Original Message ----- 
From: "Dave Newton" <da...@solaraccess.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Friday, November 14, 2003 11:47 AM
Subject: Re: getting IOException when parsing template


> On Fri, 2003-11-14 at 14:46, Yoel Spotts wrote:
> > I thought of that as well that the content of the template might have
> > caused the Exception but really the template does very little -- just
> > rendering some stuff which was placed in the context. Does not seem
> > likely. I also should have mentioned we are using velocity within an
> > iplanet web server.
>
> Really, what's in it though?
>
> > Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : adding VMs from VM
> > library template : VM_global_library.vm
> > Fri Nov 14 14:11:58 EST 2003  [error] ResourceManager : unable to find
> > resource 'VM_global_library.vm' in any resource loader.
> > Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : error using  VM
> > library template VM_global_library.vm :
> > org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> > resource 'VM_global_library.vm'
>
> Is this important?
>
> > Fri Nov 14 14:12:56 EST 2003  [error] Exception rendering #parse(
> > user_appl.vm )  : java.io.IOException: Connection reset by peer
>
> Gotta go with Geir; what's in the template?
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: getting IOException when parsing template - OT

Posted by Dave Newton <da...@solaraccess.com>.
On Sat, 2003-11-15 at 10:58, Tim Colson wrote:
>>>> [error] ResourceManager :  unable to find resource 
>>>> 'VM_global_library.vm' in any resource loader.
>>> Is this important?
>> No, and I'm going to kill that message in 1.5 :)
> YIPPEE!!! :-)

+1 ;)

I coded, I saw, I ignored... but it lurked in the back o' me mind.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: getting IOException when parsing template - OT

Posted by Tim Colson <tc...@cisco.com>.
> >> Fri Nov 14 14:11:58 EST 2003  [error] ResourceManager :  unable to
find
> >> resource 'VM_global_library.vm' in any resource loader.
> >> Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : error using  VM
> >> library template VM_global_library.vm :
> >> org.apache.velocity.exception.ResourceNotFoundException: Unable to 
> >> find resource 'VM_global_library.vm'
> >
> > Is this important?
> 
> No, and I'm going to kill that message in 1.5 :)

YIPPEE!!! :-)




---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Friday, November 14, 2003, at 02:47 PM, Dave Newton wrote:

> On Fri, 2003-11-14 at 14:46, Yoel Spotts wrote:
>> I thought of that as well that the content of the template might have
>> caused the Exception but really the template does very little -- just
>> rendering some stuff which was placed in the context. Does not seem
>> likely. I also should have mentioned we are using velocity within an
>> iplanet web server.
>
> Really, what's in it though?
>
>> Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : adding VMs from VM
>> library template : VM_global_library.vm
>> Fri Nov 14 14:11:58 EST 2003  [error] ResourceManager : unable to find
>> resource 'VM_global_library.vm' in any resource loader.
>> Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : error using  VM
>> library template VM_global_library.vm :
>> org.apache.velocity.exception.ResourceNotFoundException: Unable to 
>> find
>> resource 'VM_global_library.vm'
>
> Is this important?

No, and I'm going to kill that message in 1.5 :)

>
>> Fri Nov 14 14:12:56 EST 2003  [error] Exception rendering #parse(
>> user_appl.vm )  : java.io.IOException: Connection reset by peer
>
> Gotta go with Geir; what's in the template?
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Dave Newton <da...@solaraccess.com>.
On Fri, 2003-11-14 at 14:46, Yoel Spotts wrote:
> I thought of that as well that the content of the template might have 
> caused the Exception but really the template does very little -- just 
> rendering some stuff which was placed in the context. Does not seem 
> likely. I also should have mentioned we are using velocity within an 
> iplanet web server.

Really, what's in it though?

> Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : adding VMs from VM 
> library template : VM_global_library.vm
> Fri Nov 14 14:11:58 EST 2003  [error] ResourceManager : unable to find 
> resource 'VM_global_library.vm' in any resource loader.
> Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : error using  VM 
> library template VM_global_library.vm : 
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find 
> resource 'VM_global_library.vm'

Is this important?

> Fri Nov 14 14:12:56 EST 2003  [error] Exception rendering #parse( 
> user_appl.vm )  : java.io.IOException: Connection reset by peer

Gotta go with Geir; what's in the template?

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Yoel Spotts <yo...@secured-services.com>.
Again, thanks to all who responded -- and especially Mr. Magnusson who 
was right on the money as its not a velocity issue. We just installed 
the latest service pack to the iplanet web server (which we should have 
done to begin with!) and that seems to have solved the problem. 
Apparently there was a bug with the iplanet servlet container! Again 
thanks to all and all was not lost I guess as I have learnt some 
important new things about velocity.

Yoel Spotts

Geir Magnusson Jr. wrote:

> 
> On Friday, November 14, 2003, at 02:46 PM, Yoel Spotts wrote:
> 
>> Fri Nov 14 14:12:56 EST 2003  [error] Exception rendering #parse(  
>> user_appl.vm )  : java.io.IOException: Connection reset by peer
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> com.netscape.server.http.servlet.NSServletSession.write(NSServletSessio 
>> n.java:178)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> com.netscape.server.http.servlet.NSServletOutputStream.write(NSServletO 
>> utputStream.java:252)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
>> org.apache.velocity.runtime.parser.node.ASTText.render(ASTText.java)
> 
> 
> Seems like your netscape servlet implementation is unhappy that the  
> client connection was dropped, and threw a IOException.
> 
> [SNIP]
> 
>> Fri Nov 14 14:12:57 EST 2003  [error] Exception rendering #parse(  
>> user_appl.vm )  : java.io.IOException: IO timeout error
>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
>> com.netscape.server.http.servlet.NSServletSession.write(NSServletSessio 
>> n.java:178)
>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
>> com.netscape.server.http.servlet.NSServletOutputStream.write(NSServletO 
>> utputStream.java:252)
>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
>> sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
>> sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
>> sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
>> java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
>> org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java)
> 
> 
> 
> Same thing - velocity is flushing bytes out down the OutputStream (the  
> servlet's output stream) and given that you are clicking fast in your  
> browser, the connection that you just had is no longer there.
> 
> I don't think this is a velocity issue per se - the implementation of  
> the servlet is sending bytes out to the client as we are flushing them  
> down the pipe.  I can't recall seeing this behavior before, but it's  
> not surprising.
> 
> Can someone get this to happen with tomcat or jetty?  I haven't seen it
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Yoel Spotts <yo...@secured-services.com>.

Geir Magnusson Jr. wrote:

> 
> On Nov 16, 2003, at 12:26 AM, Yoel Spotts wrote:
> 
>> Thank you everyone for your responses. I actually tried the suggestion 
>> offered below -- problem is that it seems that once the exception 
>> occurs -- no matter how we handle it, we have to restart iplanet -- it 
>> seems iplanet gets "stuck" in some sort of state. So it does seem to 
>> be something with iplanet or the java libraries they are using. 
>> Frustrating is all I can say (its much easier to get help with 
>> velocity than with iplanet :). Once again thank you everyone for your 
>> help --- it certainly has been a learning experience. Hopefully we can 
>> figure this out! If anyone has any other suggestions, they are 
>> certainly welcome.
> 
> 
> Have you considered Jetty or Tomcat or...

If it were up to me I certainly would, however the decision is not in my 
hands...

> 
> geir
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Nov 16, 2003, at 12:26 AM, Yoel Spotts wrote:

> Thank you everyone for your responses. I actually tried the suggestion 
> offered below -- problem is that it seems that once the exception 
> occurs -- no matter how we handle it, we have to restart iplanet -- it 
> seems iplanet gets "stuck" in some sort of state. So it does seem to 
> be something with iplanet or the java libraries they are using. 
> Frustrating is all I can say (its much easier to get help with 
> velocity than with iplanet :). Once again thank you everyone for your 
> help --- it certainly has been a learning experience. Hopefully we can 
> figure this out! If anyone has any other suggestions, they are 
> certainly welcome.

Have you considered Jetty or Tomcat or...

geir

>
> Yoel Spotts
>
> Will Glass-Husain wrote:
>
>> Hi,
>> I catch SocketException in my main request handler.  It occurs while 
>> you are
>> writing to a response if the user clicks out.
>> WILL
>>     protected void doRequest(HttpServletRequest request, 
>> HttpServletResponse
>> response )
>>          throws ServletException, IOException
>>     {
>>         Context context = createContext( request, response );
>>         try
>>         {
>>             Template template = handleRequest( request, response, 
>> context );
>>             if ( template == null )
>>             {
>>                 return;
>>             }
>>             mergeTemplate( template, context, response );
>>         } catch (java.net.SocketException e) {
>>             // do nothing - page stopped
>>         } catch (IOException e) {
>>             // typically a broken pipe
>>         }
>>         catch (Exception e)
>>         {
>>             /*
>>              *  call the error handler to let the derived class
>>              *  do something useful with this failure.
>>              */
>>             try {
>>                 error( request, response, e);
>>             } catch (Exception e2) {
>>             }
>>         }
>>         // make sure cleanup always happens, regardless of errors
>>         finally {
>>             try {
>>                 requestCleanup( request, response, context );
>>             } catch (Exception E) {
>>             }
>>         }
>>     }
>> ----- Original Message ----- From: "Geir Magnusson Jr." 
>> <ge...@optonline.net>
>> To: "Velocity Users List" <ve...@jakarta.apache.org>
>> Sent: Saturday, November 15, 2003 10:34 AM
>> Subject: Re: getting IOException when parsing template
>>> On Saturday, November 15, 2003, at 01:16 PM, Will Glass-Husain wrote:
>>>
>>>
>>>> Tomcat gives a SocketException (I think this is a subclass of
>>>> IOException),
>>>> which I usually catch quietly.
>>>
>>> where?
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Yoel Spotts <yo...@secured-services.com>.
Thank you everyone for your responses. I actually tried the suggestion 
offered below -- problem is that it seems that once the exception occurs 
-- no matter how we handle it, we have to restart iplanet -- it seems 
iplanet gets "stuck" in some sort of state. So it does seem to be 
something with iplanet or the java libraries they are using. Frustrating 
is all I can say (its much easier to get help with velocity than with 
iplanet :). Once again thank you everyone for your help --- it certainly 
has been a learning experience. Hopefully we can figure this out! If 
anyone has any other suggestions, they are certainly welcome.

Yoel Spotts

Will Glass-Husain wrote:

> Hi,
> 
> I catch SocketException in my main request handler.  It occurs while you are
> writing to a response if the user clicks out.
> 
> WILL
> 
> 
>     protected void doRequest(HttpServletRequest request, HttpServletResponse
> response )
>          throws ServletException, IOException
>     {
>         Context context = createContext( request, response );
> 
>         try
>         {
> 
>             Template template = handleRequest( request, response, context );
> 
>             if ( template == null )
>             {
>                 return;
>             }
>             mergeTemplate( template, context, response );
> 
>         } catch (java.net.SocketException e) {
> 
>             // do nothing - page stopped
> 
>         } catch (IOException e) {
> 
>             // typically a broken pipe
> 
>         }
>         catch (Exception e)
>         {
>             /*
>              *  call the error handler to let the derived class
>              *  do something useful with this failure.
>              */
>             try {
>                 error( request, response, e);
>             } catch (Exception e2) {
>             }
>         }
> 
>         // make sure cleanup always happens, regardless of errors
>         finally {
>             try {
>                 requestCleanup( request, response, context );
>             } catch (Exception E) {
>             }
>         }
>     }
> 
> 
> ----- Original Message ----- 
> From: "Geir Magnusson Jr." <ge...@optonline.net>
> To: "Velocity Users List" <ve...@jakarta.apache.org>
> Sent: Saturday, November 15, 2003 10:34 AM
> Subject: Re: getting IOException when parsing template
> 
> 
> 
>>On Saturday, November 15, 2003, at 01:16 PM, Will Glass-Husain wrote:
>>
>>
>>>Tomcat gives a SocketException (I think this is a subclass of
>>>IOException),
>>>which I usually catch quietly.
>>
>>where?
>>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Will Glass-Husain <wg...@forio.com>.
Hi,

I catch SocketException in my main request handler.  It occurs while you are
writing to a response if the user clicks out.

WILL


    protected void doRequest(HttpServletRequest request, HttpServletResponse
response )
         throws ServletException, IOException
    {
        Context context = createContext( request, response );

        try
        {

            Template template = handleRequest( request, response, context );

            if ( template == null )
            {
                return;
            }
            mergeTemplate( template, context, response );

        } catch (java.net.SocketException e) {

            // do nothing - page stopped

        } catch (IOException e) {

            // typically a broken pipe

        }
        catch (Exception e)
        {
            /*
             *  call the error handler to let the derived class
             *  do something useful with this failure.
             */
            try {
                error( request, response, e);
            } catch (Exception e2) {
            }
        }

        // make sure cleanup always happens, regardless of errors
        finally {
            try {
                requestCleanup( request, response, context );
            } catch (Exception E) {
            }
        }
    }


----- Original Message ----- 
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Saturday, November 15, 2003 10:34 AM
Subject: Re: getting IOException when parsing template


>
> On Saturday, November 15, 2003, at 01:16 PM, Will Glass-Husain wrote:
>
> > Tomcat gives a SocketException (I think this is a subclass of
> > IOException),
> > which I usually catch quietly.
>
> where?
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Saturday, November 15, 2003, at 01:16 PM, Will Glass-Husain wrote:

> Tomcat gives a SocketException (I think this is a subclass of  
> IOException),
> which I usually catch quietly.

where?

>
> WILL
>
> ----- Original Message -----
> From: "Geir Magnusson Jr." <ge...@optonline.net>
> To: "Velocity Users List" <ve...@jakarta.apache.org>
> Sent: Saturday, November 15, 2003 3:48 AM
> Subject: Re: getting IOException when parsing template
>
>
>>
>> On Friday, November 14, 2003, at 02:46 PM, Yoel Spotts wrote:
>>> Fri Nov 14 14:12:56 EST 2003  [error] Exception rendering #parse(
>>> user_appl.vm )  : java.io.IOException: Connection reset by peer
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> com.netscape.server.http.servlet.NSServletSession.write(NSServletSess 
>>> io
>>> n.java:178)
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> com.netscape.server.http.servlet.NSServletOutputStream.write(NSServle 
>>> tO
>>> utputStream.java:252)
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java 
>>> )
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
>>> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
>>> org.apache.velocity.runtime.parser.node.ASTText.render(ASTText.java)
>>
>> Seems like your netscape servlet implementation is unhappy that the
>> client connection was dropped, and threw a IOException.
>>
>> [SNIP]
>>
>>> Fri Nov 14 14:12:57 EST 2003  [error] Exception rendering #parse(
>>> user_appl.vm )  : java.io.IOException: IO timeout error
>>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
>>> com.netscape.server.http.servlet.NSServletSession.write(NSServletSess 
>>> io
>>> n.java:178)
>>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
>>> com.netscape.server.http.servlet.NSServletOutputStream.write(NSServle 
>>> tO
>>> utputStream.java:252)
>>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
>>> sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
>>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
>>> sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
>>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
>>> sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
>>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
>>> java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
>>> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
>>> org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java 
>>> )
>>
>>
>> Same thing - velocity is flushing bytes out down the OutputStream (the
>> servlet's output stream) and given that you are clicking fast in your
>> browser, the connection that you just had is no longer there.
>>
>> I don't think this is a velocity issue per se - the implementation of
>> the servlet is sending bytes out to the client as we are flushing them
>> down the pipe.  I can't recall seeing this behavior before, but it's
>> not surprising.
>>
>> Can someone get this to happen with tomcat or jetty?  I haven't seen  
>> it
>>
>>
>> -- 
>> Geir Magnusson Jr                                   203-247-1713(m)
>> geirm@optonline.net
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Will Glass-Husain <wg...@forio.com>.
Tomcat gives a SocketException (I think this is a subclass of IOException),
which I usually catch quietly.

WILL

----- Original Message ----- 
From: "Geir Magnusson Jr." <ge...@optonline.net>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Saturday, November 15, 2003 3:48 AM
Subject: Re: getting IOException when parsing template


>
> On Friday, November 14, 2003, at 02:46 PM, Yoel Spotts wrote:
> > Fri Nov 14 14:12:56 EST 2003  [error] Exception rendering #parse(
> > user_appl.vm )  : java.io.IOException: Connection reset by peer
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > com.netscape.server.http.servlet.NSServletSession.write(NSServletSessio
> > n.java:178)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > com.netscape.server.http.servlet.NSServletOutputStream.write(NSServletO
> > utputStream.java:252)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
> > Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:
> > org.apache.velocity.runtime.parser.node.ASTText.render(ASTText.java)
>
> Seems like your netscape servlet implementation is unhappy that the
> client connection was dropped, and threw a IOException.
>
> [SNIP]
>
> > Fri Nov 14 14:12:57 EST 2003  [error] Exception rendering #parse(
> > user_appl.vm )  : java.io.IOException: IO timeout error
> > Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
> > com.netscape.server.http.servlet.NSServletSession.write(NSServletSessio
> > n.java:178)
> > Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
> > com.netscape.server.http.servlet.NSServletOutputStream.write(NSServletO
> > utputStream.java:252)
> > Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
> > sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
> > Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
> > sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
> > Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
> > sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
> > Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
> > java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
> > Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:
> > org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java)
>
>
> Same thing - velocity is flushing bytes out down the OutputStream (the
> servlet's output stream) and given that you are clicking fast in your
> browser, the connection that you just had is no longer there.
>
> I don't think this is a velocity issue per se - the implementation of
> the servlet is sending bytes out to the client as we are flushing them
> down the pipe.  I can't recall seeing this behavior before, but it's
> not surprising.
>
> Can someone get this to happen with tomcat or jetty?  I haven't seen it
>
>
> -- 
> Geir Magnusson Jr                                   203-247-1713(m)
> geirm@optonline.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Friday, November 14, 2003, at 02:46 PM, Yoel Spotts wrote:
> Fri Nov 14 14:12:56 EST 2003  [error] Exception rendering #parse(  
> user_appl.vm )  : java.io.IOException: Connection reset by peer
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> com.netscape.server.http.servlet.NSServletSession.write(NSServletSessio 
> n.java:178)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> com.netscape.server.http.servlet.NSServletOutputStream.write(NSServletO 
> utputStream.java:252)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
> Fri Nov 14 14:12:56 EST 2003  [error] Stack trace:  
> org.apache.velocity.runtime.parser.node.ASTText.render(ASTText.java)

Seems like your netscape servlet implementation is unhappy that the  
client connection was dropped, and threw a IOException.

[SNIP]

> Fri Nov 14 14:12:57 EST 2003  [error] Exception rendering #parse(  
> user_appl.vm )  : java.io.IOException: IO timeout error
> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
> com.netscape.server.http.servlet.NSServletSession.write(NSServletSessio 
> n.java:178)
> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
> com.netscape.server.http.servlet.NSServletOutputStream.write(NSServletO 
> utputStream.java:252)
> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
> sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
> sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
> sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
> java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
> Fri Nov 14 14:12:57 EST 2003  [error] Stack trace:  
> org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java)


Same thing - velocity is flushing bytes out down the OutputStream (the  
servlet's output stream) and given that you are clicking fast in your  
browser, the connection that you just had is no longer there.

I don't think this is a velocity issue per se - the implementation of  
the servlet is sending bytes out to the client as we are flushing them  
down the pipe.  I can't recall seeing this behavior before, but it's  
not surprising.

Can someone get this to happen with tomcat or jetty?  I haven't seen it


-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Yoel Spotts <yo...@secured-services.com>.
Thanks to all who have looked into our issue!

I thought of that as well that the content of the template might have 
caused the Exception but really the template does very little -- just 
rendering some stuff which was placed in the context. Does not seem 
likely. I also should have mentioned we are using velocity within an 
iplanet web server.

I modified the velocity source so that it would print the full stack 
trace when we recieved this error, and here is what we got:

Fri Nov 14 14:11:56 EST 2003  [debug] AvalonLogSystem initialized using 
logfile '../logs/CHCSIIadmin.log'
Fri Nov 14 14:11:56 EST 2003   [info] 
**************************************************************
Fri Nov 14 14:11:56 EST 2003   [info] Starting Jakarta Velocity v1.3.1
Fri Nov 14 14:11:56 EST 2003   [info] RuntimeInstance initializing.
Fri Nov 14 14:11:56 EST 2003   [info] Default Properties File: 
org\apache\velocity\runtime\defaults\velocity.properties
Fri Nov 14 14:11:56 EST 2003   [info] Trying to use logger class 
org.apache.velocity.runtime.log.AvalonLogSystem
Fri Nov 14 14:11:56 EST 2003   [info] Using logger class 
org.apache.velocity.runtime.log.AvalonLogSystem
Fri Nov 14 14:11:56 EST 2003   [info] Default ResourceManager 
initializing. (class 
org.apache.velocity.runtime.resource.ResourceManagerImpl)
Fri Nov 14 14:11:56 EST 2003   [info] Resource Loader Instantiated: 
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Fri Nov 14 14:11:56 EST 2003   [info] ClasspathResourceLoader : 
initialization starting.
Fri Nov 14 14:11:56 EST 2003   [info] ClasspathResourceLoader : 
initialization complete.
Fri Nov 14 14:11:56 EST 2003   [info] ResourceCache : initialized. 
(class org.apache.velocity.runtime.resource.ResourceCacheImpl)
Fri Nov 14 14:11:56 EST 2003   [info] Default ResourceManager 
initialization complete.
Fri Nov 14 14:11:57 EST 2003   [info] Loaded System Directive: 
org.apache.velocity.runtime.directive.Literal
Fri Nov 14 14:11:57 EST 2003   [info] Loaded System Directive: 
org.apache.velocity.runtime.directive.Macro
Fri Nov 14 14:11:57 EST 2003   [info] Loaded System Directive: 
org.apache.velocity.runtime.directive.Parse
Fri Nov 14 14:11:57 EST 2003   [info] Loaded System Directive: 
org.apache.velocity.runtime.directive.Include
Fri Nov 14 14:11:57 EST 2003   [info] Loaded System Directive: 
org.apache.velocity.runtime.directive.Foreach
Fri Nov 14 14:11:58 EST 2003   [info] Created: 20 parsers.
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : initialization starting.
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : adding VMs from VM 
library template : VM_global_library.vm
Fri Nov 14 14:11:58 EST 2003  [error] ResourceManager : unable to find 
resource 'VM_global_library.vm' in any resource loader.
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : error using  VM 
library template VM_global_library.vm : 
org.apache.velocity.exception.ResourceNotFoundException: Unable to find 
resource 'VM_global_library.vm'
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro :  VM library template 
macro registration complete.
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : allowInline = true : 
VMs can be defined inline in templates
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : 
allowInlineToOverride = false : VMs defined inline may NOT replace 
previous VM definitions
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : allowInlineLocal = 
false : VMs defined inline will be  global in scope if allowed.
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : messages on  : VM 
system will output logging messages
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : autoload off  : VM 
system will not automatically reload global library macros
Fri Nov 14 14:11:58 EST 2003   [info] Velocimacro : initialization complete.
Fri Nov 14 14:11:58 EST 2003   [info] Velocity successfully started.

Fri Nov 14 14:12:56 EST 2003  [error] Exception rendering #parse( 
user_appl.vm )  : java.io.IOException: Connection reset by peer
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.NSServletSession.write(NSServletSession.java:178)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.NSServletOutputStream.write(NSServletOutputStream.java:252)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTText.render(ASTText.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.directive.Foreach.render(Foreach.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.directive.Foreach.render(Foreach.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.directive.Parse.render(Parse.java:232)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.Template.merge(Template.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.servlet.VelocityServlet.mergeTemplate(VelocityServlet.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:894)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.WebApplication.service(WebApplication.java:1127)
Fri Nov 14 14:12:56 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:956)

Fri Nov 14 14:12:57 EST 2003  [error] Exception rendering #parse( 
user_appl.vm )  : java.io.IOException: IO timeout error
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.NSServletSession.write(NSServletSession.java:178)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.NSServletOutputStream.write(NSServletOutputStream.java:252)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(StreamEncoder.java:334)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
sun.nio.cs.StreamEncoder$CharsetSE.implWrite(StreamEncoder.java:394)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
sun.nio.cs.StreamEncoder.write(StreamEncoder.java:134)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
java.io.OutputStreamWriter.write(OutputStreamWriter.java:191)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.io.VelocityWriter.flushBuffer(VelocityWriter.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.io.VelocityWriter.write(VelocityWriter.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTText.render(ASTText.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.directive.Foreach.render(Foreach.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.directive.Foreach.render(Foreach.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.directive.Parse.render(Parse.java:232)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.Template.merge(Template.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.servlet.VelocityServlet.mergeTemplate(VelocityServlet.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.servlet.VelocityServlet.doRequest(VelocityServlet.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServlet.java)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:894)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.WebApplication.service(WebApplication.java:1127)
Fri Nov 14 14:12:57 EST 2003  [error] Stack trace: 
com.netscape.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:956)


Geir Magnusson Jr. wrote:

> 
> On Thursday, November 13, 2003, at 05:07 PM, Yoel Spotts wrote:
> 
>> 2003-11-13 15:36:36,328 - Exception rendering #parse( user_appl.vm )  
>> : java.io.IOException: Connection reset by peer
>> 2003-11-13 15:36:36,437 - Exception rendering #parse( user_appl.vm )  
>> : java.io.IOException: IO timeout error
>> 2003-11-13 15:36:36,984 - Exception rendering #parse( user_appl.vm )  
>> : java.io.IOException: IO timeout error
>> 2003-11-13 15:36:37,593 - Exception rendering #parse( user_appl.vm )  
>> : java.io.IOException: Object state is improper for request.
> 
> 
> Bizarre.
> 
> What's in user-appl.vm, btw?  Anything that might throw an IOException 
> ?  :)
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Thursday, November 13, 2003, at 05:07 PM, Yoel Spotts wrote:
> 2003-11-13 15:36:36,328 - Exception rendering #parse( user_appl.vm )  
> : java.io.IOException: Connection reset by peer
> 2003-11-13 15:36:36,437 - Exception rendering #parse( user_appl.vm )  
> : java.io.IOException: IO timeout error
> 2003-11-13 15:36:36,984 - Exception rendering #parse( user_appl.vm )  
> : java.io.IOException: IO timeout error
> 2003-11-13 15:36:37,593 - Exception rendering #parse( user_appl.vm )  
> : java.io.IOException: Object state is improper for request.

Bizarre.

What's in user-appl.vm, btw?  Anything that might throw an IOException 
?  :)


-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Yoel Spotts <yo...@secured-services.com>.
Both machines are using the same JVM. Even with turning caching on, we 
are still getting the same error. Following is the complete 
velocity.properties:

resource.loader = class
resource.manager.logwhenfound=false
class.resource.loader.class = 
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
class.resource.loader.cache = true
runtime.log = ../logs/CHCSIIadmin.log
runtime.log.error.stacktrace = true
runtime.log.warn.stacktrace = true
runtime.log.info.stacktrace = true
runtime.log.invalid.references = true


And here is the complete log. Sorry I did not mention it before, but 
there are 4 successive IOExceptions generated by succesive clicking on 
the link which will cause the template to call the parse:

2003-11-13 15:35:45,781 - 
**************************************************************
2003-11-13 15:35:45,781 - Starting Jakarta Velocity v1.3-rc1
2003-11-13 15:35:45,781 - RuntimeInstance initializing.
2003-11-13 15:35:45,781 - Default Properties File: 
org\apache\velocity\runtime\defaults\velocity.properties
2003-11-13 15:35:45,781 - Trying to use logger class 
org.apache.velocity.runtime.log.AvalonLogSystem
2003-11-13 15:35:45,781 - Couldn't find class 
org.apache.velocity.runtime.log.AvalonLogSystem or necessary supporting 
classes in classpath. Exception : java.lang.NoClassDefFoundError: 
org/apache/log/format/Formatter
2003-11-13 15:35:45,781 - Trying to use logger class 
org.apache.velocity.runtime.log.SimpleLog4JLogSystem
2003-11-13 15:35:45,781 - Using logger class 
org.apache.velocity.runtime.log.SimpleLog4JLogSystem
2003-11-13 15:35:45,906 - Default ResourceManager initializing. (class 
org.apache.velocity.runtime.resource.ResourceManagerImpl)
2003-11-13 15:35:46,437 - Resource Loader Instantiated: 
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
2003-11-13 15:35:46,437 - ClasspathResourceLoader : initialization starting.
2003-11-13 15:35:46,437 - ClasspathResourceLoader : initialization complete.
2003-11-13 15:35:46,531 - ResourceCache : initialized. (class 
org.apache.velocity.runtime.resource.ResourceCacheImpl)
2003-11-13 15:35:46,531 - Default ResourceManager initialization complete.
2003-11-13 15:35:46,625 - Loaded System Directive: 
org.apache.velocity.runtime.directive.Literal
2003-11-13 15:35:46,671 - Loaded System Directive: 
org.apache.velocity.runtime.directive.Macro
2003-11-13 15:35:46,765 - Loaded System Directive: 
org.apache.velocity.runtime.directive.Parse
2003-11-13 15:35:46,859 - Loaded System Directive: 
org.apache.velocity.runtime.directive.Include
2003-11-13 15:35:46,906 - Loaded System Directive: 
org.apache.velocity.runtime.directive.Foreach
2003-11-13 15:35:48,109 - Created: 20 parsers.
2003-11-13 15:35:48,109 - Velocimacro : initialization starting.
2003-11-13 15:35:48,109 - Velocimacro : adding VMs from VM library 
template : VM_global_library.vm
2003-11-13 15:35:48,218 - ResourceManager : unable to find resource 
'VM_global_library.vm' in any resource loader.
2003-11-13 15:35:48,218 - Velocimacro : error using  VM library template 
VM_global_library.vm : 
org.apache.velocity.exception.ResourceNotFoundException: Unable to find 
resource 'VM_global_library.vm'
2003-11-13 15:35:48,218 - Velocimacro :  VM library template macro 
registration complete.
2003-11-13 15:35:48,218 - Velocimacro : allowInline = true : VMs can be 
defined inline in templates
2003-11-13 15:35:48,218 - Velocimacro : allowInlineToOverride = false : 
VMs defined inline may NOT replace previous VM definitions
2003-11-13 15:35:48,218 - Velocimacro : allowInlineLocal = false : VMs 
defined inline will be  global in scope if allowed.
2003-11-13 15:35:48,218 - Velocimacro : messages on  : VM system will 
output logging messages
2003-11-13 15:35:48,218 - Velocimacro : autoload off  : VM system will 
not automatically reload global library macros
2003-11-13 15:35:48,218 - Velocimacro : initialization complete.
2003-11-13 15:35:48,218 - Velocity successfully started.
2003-11-13 15:36:36,328 - Exception rendering #parse( user_appl.vm )  : 
java.io.IOException: Connection reset by peer
2003-11-13 15:36:36,437 - Exception rendering #parse( user_appl.vm )  : 
java.io.IOException: IO timeout error
2003-11-13 15:36:36,984 - Exception rendering #parse( user_appl.vm )  : 
java.io.IOException: IO timeout error
2003-11-13 15:36:37,593 - Exception rendering #parse( user_appl.vm )  : 
java.io.IOException: Object state is improper for request.

Thanks,

Yoel

Geir Magnusson Jr. wrote:


> 
> 
> Are you caching?  can you turn caching on?  What's wierd is that it's 
> NT4 and not 2K.  Makes me wonder about either JDK impl (are you using 
> the same JDK on both?) or the OS.  What it sounds like is some kind of 
> collision during I/O?
> 
> geir
> 
>>
>> Yoel Spotts
>>
>> Nathan Bubna wrote:
>>
>>> Yoel Spotts said:
>>> ...
>>>
>>>> We are getting a rather strange IOException when
>>>> rendering a template, speficially from a #parse directive. Here is the
>>>> error message reported in the lgo file:
>>>>
>>>> Exception rendering #parse( user_conf.vm )  : java.io.IOException:
>>>> Object state is improper for request.
>>>
>>> in your template, do you have #parse( user_conf.vm ) or #parse(
>>> "user_conf.vm" )?  i think the former should throw an exception during
>>> template parsing, but just in case it doesn't...
>>>
>>>> The strange thing is that this only happens sometimes -- most of the
>>>> time it works fine.
>>>
>>> ...
>>> blech. no fun. :(
>>>
>>>> Anyone have any ideas?
>>>
>>> well, this isn't much info to go on.  someone might be able to give 
>>> you some
>>> help if you post some configuration info.  particularly, your 
>>> resource loader
>>> config stuff from velocity.properties.  and it might not hurt to 
>>> mention the
>>> system/environment your working with (since it's an IOException).
>>> as far as investigating further on your own, you may want to run a 
>>> search
>>> through the source of the libraries you are using to see if you can 
>>> locate the
>>> exception message text. (i find it's the next best thing when i don't 
>>> have a
>>> stack trace)
>>> oh, and it never hurts to mention what version of velocity you are 
>>> using.
>>> Nathan Bubna
>>> nathan@esha.com
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On Thursday, November 13, 2003, at 02:05 PM, Yoel Spotts wrote:

> Thank you so much for the reply. Sorry I did not give enough 
> information. Here are some more details which I was able to determine:
>
> I now can re-produce it easily. I only need to click on a link which 
> will render the template which contains the #parse command quickly > more
> than once so that the 2nd request fire up before the 1st one finishes.
> I am also thinking this could be related to NT4 since I can't 
> duplicate it in 2K but everytime in NT4.
>
> In addition, I should note we are using velocity 1.3.1.
>
> I in fact had already tried chasing down that error message in the 
> source code and it took me to 
> org.apache.velocity.runtime.directive.Parse.java line 245. It appears 
> the IOException is thrown on line 232 at the render method of 
> SimpleNode. From there the trail gets more complex since I would 
> assume it could have been thrown by any one of several subclasses of 
> SimpleNode. I tried setting runtime.log.error.stacktrace=true in 
> velocity.properties hoping it would give me a full stack trace in the 
> log, but it did not.
>
> Finally here are the settings in velocity.properties for the resource 
> loader:
>
> resource.loader = class
> class.resource.loader.class = 
> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
> runtime.log = velocity.log
>
> If there is any other information which might be helpful to solving 
> this issue, please let me know. Thanks again anyone and everyone for 
> the help!

Are you caching?  can you turn caching on?  What's wierd is that it's 
NT4 and not 2K.  Makes me wonder about either JDK impl (are you using 
the same JDK on both?) or the OS.  What it sounds like is some kind of 
collision during I/O?

geir

>
> Yoel Spotts
>
> Nathan Bubna wrote:
>
>> Yoel Spotts said:
>> ...
>>> We are getting a rather strange IOException when
>>> rendering a template, speficially from a #parse directive. Here is 
>>> the
>>> error message reported in the lgo file:
>>>
>>> Exception rendering #parse( user_conf.vm )  : java.io.IOException:
>>> Object state is improper for request.
>> in your template, do you have #parse( user_conf.vm ) or #parse(
>> "user_conf.vm" )?  i think the former should throw an exception during
>> template parsing, but just in case it doesn't...
>>> The strange thing is that this only happens sometimes -- most of the
>>> time it works fine.
>> ...
>> blech. no fun. :(
>>> Anyone have any ideas?
>> well, this isn't much info to go on.  someone might be able to give 
>> you some
>> help if you post some configuration info.  particularly, your 
>> resource loader
>> config stuff from velocity.properties.  and it might not hurt to 
>> mention the
>> system/environment your working with (since it's an IOException).
>> as far as investigating further on your own, you may want to run a 
>> search
>> through the source of the libraries you are using to see if you can 
>> locate the
>> exception message text. (i find it's the next best thing when i don't 
>> have a
>> stack trace)
>> oh, and it never hurts to mention what version of velocity you are 
>> using.
>> Nathan Bubna
>> nathan@esha.com
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geirm@optonline.net


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Yoel Spotts <yo...@secured-services.com>.
Thank you so much for the reply. Sorry I did not give enough 
information. Here are some more details which I was able to determine:

I now can re-produce it easily. I only need to click on a link which 
will render the template which contains the #parse command quickly more
than once so that the 2nd request fire up before the 1st one finishes.
I am also thinking this could be related to NT4 since I can't duplicate 
it in 2K but everytime in NT4.

In addition, I should note we are using velocity 1.3.1.

I in fact had already tried chasing down that error message in the 
source code and it took me to 
org.apache.velocity.runtime.directive.Parse.java line 245. It appears 
the IOException is thrown on line 232 at the render method of 
SimpleNode. From there the trail gets more complex since I would assume 
it could have been thrown by any one of several subclasses of 
SimpleNode. I tried setting runtime.log.error.stacktrace=true in 
velocity.properties hoping it would give me a full stack trace in the 
log, but it did not.

Finally here are the settings in velocity.properties for the resource 
loader:

resource.loader = class
class.resource.loader.class = 
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
runtime.log = velocity.log

If there is any other information which might be helpful to solving this 
issue, please let me know. Thanks again anyone and everyone for the help!

Yoel Spotts

Nathan Bubna wrote:

> Yoel Spotts said:
> ...
> 
>>We are getting a rather strange IOException when
>>rendering a template, speficially from a #parse directive. Here is the
>>error message reported in the lgo file:
>>
>>Exception rendering #parse( user_conf.vm )  : java.io.IOException:
>>Object state is improper for request.
> 
> 
> in your template, do you have #parse( user_conf.vm ) or #parse(
> "user_conf.vm" )?  i think the former should throw an exception during
> template parsing, but just in case it doesn't...
> 
> 
>>The strange thing is that this only happens sometimes -- most of the
>>time it works fine.
> 
> ...
> 
> blech. no fun. :(
> 
> 
>>Anyone have any ideas?
> 
> 
> well, this isn't much info to go on.  someone might be able to give you some
> help if you post some configuration info.  particularly, your resource loader
> config stuff from velocity.properties.  and it might not hurt to mention the
> system/environment your working with (since it's an IOException).
> 
> as far as investigating further on your own, you may want to run a search
> through the source of the libraries you are using to see if you can locate the
> exception message text. (i find it's the next best thing when i don't have a
> stack trace)
> 
> oh, and it never hurts to mention what version of velocity you are using.
> 
> Nathan Bubna
> nathan@esha.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: getting IOException when parsing template

Posted by Nathan Bubna <na...@esha.com>.
Yoel Spotts said:
...
> We are getting a rather strange IOException when
> rendering a template, speficially from a #parse directive. Here is the
> error message reported in the lgo file:
>
> Exception rendering #parse( user_conf.vm )  : java.io.IOException:
> Object state is improper for request.

in your template, do you have #parse( user_conf.vm ) or #parse(
"user_conf.vm" )?  i think the former should throw an exception during
template parsing, but just in case it doesn't...

> The strange thing is that this only happens sometimes -- most of the
> time it works fine.
...

blech. no fun. :(

> Anyone have any ideas?

well, this isn't much info to go on.  someone might be able to give you some
help if you post some configuration info.  particularly, your resource loader
config stuff from velocity.properties.  and it might not hurt to mention the
system/environment your working with (since it's an IOException).

as far as investigating further on your own, you may want to run a search
through the source of the libraries you are using to see if you can locate the
exception message text. (i find it's the next best thing when i don't have a
stack trace)

oh, and it never hurts to mention what version of velocity you are using.

Nathan Bubna
nathan@esha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org