TitleUploadAttachmentPopupStaysBlankWithNonDefaultTemplate
Date08-Sep-2005 12:54:11 EEST
Version2.2.28
Submitter194.109.220.83
Bug criticalityBadBug
Browser versionFirefox
Bug statusClosedBug
PageProvider usedFileSystemProvider
Servlet ContainerTomcat4
Operating SystemLinux Server/XP client
URLUpload.jsp?page=
Java version1.5 (sun)

When using another template then default, in this case using 'redman' the upload functionality seems to stop working. The upload popup shows up empty and no error logging is found in the jspwiki.log

In the tomcat4 log I found:

java.lang.IllegalAccessError: tried to access method
com.ecyrd.jspwiki.WikiContext.<init>(Lcom/ecyrd/jspwiki/WikiEngine;Ljava/lang/String;)V
from class org.apache.jsp.Error_jsp

I made the constructor with second parameter String public again in WikiContext, cause it is used from the Error.jsp page.

Then I found this in the jspwiki.log:

java.lang.NullPointerException
        at org.apache.jasper.runtime.JspRuntimeLibrary.getContextRelativePath(JspRuntimeLibrary.java:720)
        at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:765)
        at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:359)
        at com.ecyrd.jspwiki.tags.IncludeTag.doEndTag(IncludeTag.java:68)
        at org.apache.jsp.Upload_jsp._jspService(Upload_jsp.java:111)

Then I added some debug logging to the findJSP() method:

    	log.debug("Called findJSP with parameters: " + 
    			"pageContext [" + pageContext + "] " +
    			"template [" + template + "] " +
    			"name [" + name + "] ");

Then it shows in the log:

Called findJSP with parameters: 
pageContext [org.apache.jasper.runtime.PageContextImpl@1c486f2] 
template [default] 
name [templates/redman/UploadTemplate.jsp]

Two strange things here:

  • the template is default instead of redman
  • the location of the jsp is already resolved

To fix this bug I updated the Upload.jsp from:

<wiki:Include page="<%=contentPage%>" />

to:

<wiki:Include page="UploadTemplate.jsp" />

This seems to work, because the include tag does its own findJSP()

PeterPaulBakker


Closing, because we've overhauled this part completely in 2.4.

-- JanneJalkanen, 24-Sep-2006

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-5) was last changed on 24-Sep-2006 17:26 by JanneJalkanen