[SAK-15736] NPE when trying to preview portfolios when running in tomcat 5.5.27 and websphere Created: 20-Feb-2009  Updated: 22-Jun-2016  Resolved: 05-May-2009

Status: CLOSED
Project: Sakai
Component/s: OSP: Portfolios
Affects Version/s: 2.6.0
Fix Version/s: 2.6.0, 2.7.0

Type: Bug Priority: Critical
Reporter: Charles Hedrick Assignee: John Bush
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File 15736.diff    
Issue Links:
Relate
relates to SAK-15985 Portfolios: viewing portfolio breaks ... CLOSED

 Description   

Site with a matrix, several wizards and two templates. I filled out one form in the wizard. I went into the portfolio and tried to view it. I had created the portfolio but not put any content in it. I'm assuming that is the problem.

org.sakaiproject.portal.api.PortalHandlerException: org.sakaiproject.tool.api.ToolException: /WEB-INF/jsp/presentation/renderPresentation.jsp(6,14) Attribute value request.getAttribute("renderer") is quoted with " which must be escaped when used within the value
at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:768)
caused by: org.sakaiproject.tool.api.ToolException: /WEB-INF/jsp/presentation/renderPresentation.jsp(6,14) Attribute value request.getAttribute("renderer") is quoted with " which must be escaped when used within the value
at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1216)
caused by: org.apache.jasper.JasperException: /WEB-INF/jsp/presentation/renderPresentation.jsp(6,14) Attribute value request.getAttribute("renderer") is quoted with " which must be escaped when used within the value
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
at org.apache.jasper.compiler.Parser.parseQuoted(Parser.java:307)
at org.apache.jasper.compiler.Parser.parseAttributeValue(Parser.java:250)
at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:211)
at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:149)
at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1350)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1589)
at org.apache.jasper.compiler.Parser.parse(Parser.java:132)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)



 Comments   
Comment by Charles Hedrick [ 20-Feb-2009 ]

fix. What's going on? I'd think this would have shown up the first time someone tried to view a portfolio.

Comment by Beth Kirschner [ 02-Mar-2009 ]

Charles, it would really help if you can attach some matrix/wizard/templates to help us reproduce this and/or specify a Sakai QA Server where the problem exists. If we can't reproduce this, we can't fix it. Thanks!

Comment by Peter A. Knoop [ 02-Mar-2009 ]

[Bulk Comment] This is issue is currently scheduled to be resolved for inclusion in the Sakai 2.6.0 release, however, it is still unresolved. If you still planning on resolving it, please reply with a comment indicating when you expect to have it resolved. If you don't think you will be able to address this issue in time for the release, please reply with a comment indicating such; particularly if this issue is Blocker or Critical priority. If the resolution of this issue is to be delayed until a future release (i.e., 2.7), then please update the Fix Version accordingly.

Comment by Beth Kirschner [ 02-Mar-2009 ]

Unable to reproduce – changing to Major priority for now

Comment by Charles Hedrick [ 02-Mar-2009 ]

This appears to be a problem with tomcat 5.5.27 and later. I have been unable to find any QA servers running more recent than 26. The install instructions for 2.6 say it has been tested under 5.5.27. I doubt that you want to be locked into 26, since it will cause trouble if there are any security patches. I strongly suggest fixing this problem – which is the only one we've seen under 27, and change the QA servers to 27, as the release notes suggest.

Comment by Beth Kirschner [ 03-Mar-2009 ]

This is a problem with Tomcat 5.5.27 – the current workaround is to set the JAVA_OPTS at startup:

-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

The discussion is available at http://www.nabble.com/tomcat-5.5.27-td19416358.html

The release docs will be updated accordingly

Comment by John Bush [ 05-May-2009 ]

see https://issues.apache.org/bugzilla/show_bug.cgi?id=45015

A quick note to anyone being bitten by this bug fix: you can easily search
which of your JSPs (.jsp) need to be updated with the following regular
expression (take a deep breath):

<\w+:[^>]="[^<"]<%=[^%]"|<\w:[^>]+='[^<']<%=[^%]'

I think we should run this in osp and find all the place and fix, its easy enough to deal with, forcing people to use the tomcat option is a workaround but not really a solution

Comment by John Bush [ 05-May-2009 ]

committed a fix for this, there was also a problem in the wizard template

Comment by John Bush [ 06-May-2009 ]

this is a blocker issue for websphere, there is no workaround there

Comment by John Bush [ 06-May-2009 ]

I put the wrong ticket in the commit the fixed revision is 61872

Macintosh-10:osp jbush$ svn diff -c 61872 .
Index: wizard/tool/src/webapp/WEB-INF/jsp/template.jsp
===================================================================
— wizard/tool/src/webapp/WEB-INF/jsp/template.jsp (revision 61871)
+++ wizard/tool/src/webapp/WEB-INF/jsp/template.jsp (revision 61872)
@@ -48,7 +48,7 @@
<body onload="loaded();">
<div class="portletBody">
<c:if test="${not empty requestScope.panelId}"><div class="ospEmbedded"></c:if>

  • <jsp:include page="<%= (String)request.getAttribute("_body")%>" />
    + <jsp:include page="<%= (String)request.getAttribute(\"_body\")%>" />
    <c:if test="${not empty requestScope.panelId}"></div></c:if>
    </div>
    </body>
    Index: presentation/tool/src/webapp/WEB-INF/jsp/viewPresTemplate.jsp
    ===================================================================
      • presentation/tool/src/webapp/WEB-INF/jsp/viewPresTemplate.jsp (revision 61871)
        +++ presentation/tool/src/webapp/WEB-INF/jsp/viewPresTemplate.jsp (revision 61872)
        @@ -28,7 +28,7 @@
        <body onload="loaded();">
        <div class="portletBody">
        <c:if test="${not empty requestScope.panelId}"><div class="ospEmbedded"></c:if>
  • <jsp:include page="<%= (String)request.getAttribute("_body")%>" />
    + <jsp:include page="<%= (String)request.getAttribute(\"_body\")%>" />
    <c:if test="${not empty requestScope.panelId}"></div></c:if>
    </div>
    </body>
    Macintosh-10:osp jbush$
Comment by John Bush [ 06-May-2009 ]

we have verified this fix on tomcat 5.5.27

Comment by Anthony Whyte [ 07-May-2009 ]

The fix was applied per SAK-15985 to both the 2.6.x and 2.6.0 branches.

Generated at Wed Sep 18 13:40:26 CDT 2019 using Jira 8.0.3#800011-sha1:073e8b433c2c0e389c609c14a045ffa7abaca10d.