problems with Tomcat 7

Issue #38 resolved
Robert Jäschke created an issue

When running BibSonomy on a Tomcat 7 we very frequently get the following exception:

Caused by: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: javax.el.ELException: Error invoking function 'mtl:encodeURI'
        at org.apache.jsp.tag.webresources.bibtexs_tagx$Helper.invoke(bibtexs_tagx.java:575)
        at org.apache.jsp.tag.webresources.common.list_tagx$Helper.invoke1(list_tagx.java:710)
        at org.apache.jsp.tag.webresources.common.list_tagx$Helper.invoke(list_tagx.java:751)
        ... 136 more
Caused by: javax.servlet.jsp.JspException: javax.el.ELException: Error invoking function 'mtl:encodeURI'
        at org.apache.jsp.tag.webresources.bibtex.actions_tagx.doTag(actions_tagx.java:216)
        at org.apache.jsp.tag.webresources.bibtexs_tagx._jspx_meth_bib_005factions_005f0(bibtexs_tagx.java:477)
        at org.apache.jsp.tag.webresources.bibtexs_tagx.access$2(bibtexs_tagx.java:463)
        at org.apache.jsp.tag.webresources.bibtexs_tagx$Helper.invoke2(bibtexs_tagx.java:525)
        at org.apache.jsp.tag.webresources.bibtexs_tagx$Helper.invoke(bibtexs_tagx.java:561)
Caused by: javax.el.ELException: Error invoking function 'mtl:encodeURI'
        at de.odysseus.el.tree.impl.ast.AstFunction.eval(AstFunction.java:51)
        at de.odysseus.el.tree.impl.ast.AstEval.eval(AstEval.java:42)
        at de.odysseus.el.tree.impl.ast.AstComposite.eval(AstComposite.java:35)
        at de.odysseus.el.tree.impl.ast.AstNode.getValue(AstNode.java:28)
        at de.odysseus.el.TreeValueExpression.getValue(TreeValueExpression.java:121)
        at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:1026)
        at org.apache.jsp.tag.webresources.bibtex.actions_tagx._jspx_meth_c_005fwhen_005f8(actions_tagx.java:2289)
        at org.apache.jsp.tag.webresources.bibtex.actions_tagx._jspx_meth_c_005fchoose_005f8(actions_tagx.java:2258)
        at org.apache.jsp.tag.webresources.bibtex.actions_tagx._jspx_meth_c_005fif_005f8(actions_tagx.java:2062)
        at org.apache.jsp.tag.webresources.bibtex.actions_tagx.doTag(actions_tagx.java:201)
        ... 142 more
Caused by: java.lang.NullPointerException

Comments (8)

  1. Former user Account Deleted

    Invoking mtl:encodeURI, a NullPointerException may be thrown, if the argument is the return of another function call; for example (tags/resources/bibtex/actions.tagx:206):

    ${mtl:encodeURI(mtl:extractDOI(post.resource.miscFields['doi']))}

    When the doi is invalid, the return of mtl:extractDOI is empty and mtl:encodeURI fails. This could be void using

    <c:when test="${[...] and not empty mtl:extractDOI(post.resource.miscFields['doi'])}">

    However, these has to be done for each call to encodeURI with nested function call.

  2. Former user Account Deleted

    Seems to be too obvious... By the way, why does the extractDOI return a NullPointer, if there is no DOI? Should rather return an empty string, shouldn't it?

  3. Log in to comment