[ http://jira.codehaus.org/browse/DISPL-314?page=comments#action_80785 ] 
            
Gabriel Guerrero commented on DISPL-314:
----------------------------------------

Hi, we think that we found the problem for this issue, it is really hard to 
duplicate, the only way we could is as follows

First we are using OC4J 9.0.4.2 (we also deployed the application in tomcat an 
we could not duplicate it), struts1.1 using tiles and JDK 1.4.1.2

To duplicate it in the system we have a side bar that has few links that lead 
to different lists with a lot of results (ex. 100.000 rows) or very heavy 
queries. What we did is to click fast between two of the links, the idea is to 
not let the server to respond. Doing this several times we saw in the logs the 
broken pipe error (it happens when the server cannot finish the processing of a 
user request at least in OC4J. I have not seen this in Tomcat), then stop and 
go to one of the list;   you'll see a message like this:  " [ServletExecption 
in:/yourList.jsp] null  "  instead of your list. Also remember, before start 
trying to duplicate that you shouldn't have seen none of the list pages before, 
preferably restart the server before trying this, its not 100% guaranteed that 
you'll be able to replicate the error using the previous steps. You have to try 
several times, but ones its happens the first time it will always occur in the 
followings request of the list, that is how we co
 uld debug it.

After a lot of debugging, this is what we found. First to see the full 
exception you have to active in your log4j the log for the tiles like this:
log4j.logger.org.apache.struts.taglib.tiles=DEBUG

I attached one example of the exception

The tiles: insert tag was swallowing the exception thrown by the display tag,  

After a lot of debugging of the display tag we conclude that the exception is 
just a consequence of the real problem, what is happening is that the OC4J 
creates a pool for the org.dysplaytag.tags.TableTag class, and when the server 
can't finish the processing of a request normally, the method doEndTag is not 
called.  Inside this method exist a call to cleanUp() method that reset the 
local variables of the instance to default values, so when the doEndTag is not 
called the instance will stay in the pool without been reseted, when the pool 
is full of corrupted objects you'll start to see the error of this issue.

 To fix this we try to call the cleanUp() in the doStartTag method of the 
TableTag and it didn't work so we guess that we were reseting to much 
variables, so instead of calling that method we add this line to the begin of 
the doStartTag method

this.rowNumber=1;

the method look like this 

public int doStartTag() {
 this.rowNumber=1;
 .
 .
 .
That's the fix just adding that line, with the debug we identified that the 
rowNumber variable was not reseted, causing that when a new list needs to be 
processed by the TableTag it will start from the wrong line and if the number 
is greater that the number of rows it will cause a NullPointerException in the 
line 161 of the org.dysplaytag.model.Column, and the rowNumber will not be 
reseted so it will grow each time the exception occurs.

We ran all the test of the Displaytag with maven and they pass also we have 
been testing the fix in our application , and until now is working fine but 
I'll like to know what do you think about the fix, if it could affect something 
else, or if some other variables should also be reseted.

Thanks Gabriel Guerrero

> Displaytag breaks rendering in jsp without logging exceptions
> -------------------------------------------------------------
>
>                 Key: DISPL-314
>                 URL: http://jira.codehaus.org/browse/DISPL-314
>             Project: DisplayTag
>          Issue Type: Bug
>          Components: Tag Library
>    Affects Versions: 1.1
>            Reporter: Tonis
>             Fix For: 1.1
>
>
> I use displaytag library  in jsp like:
>  <display:table>
> <core:if test="${printFormat!='true'}" >
> <core:choose>
>  .....
> </core:choose>
> </core:if>
> </display:table>
>   And generating HTML fails probably because of errors during accessing beans 
> in <display:table> implemention. But nothing is logged by displaytag,
>   no jsp error is generated but all HTML rendering after <display:table>  tag 
> is stopped.
>  Main issue is that it is so hard to find cause of the problem. Displaytag 
> should log some error at least, I have spent hours finding out where the 
> problem is. :(

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to