Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-1060

Field displayer raise NullPointerException when object field has never been set

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1 M4
    • Fix Version/s: 1.1 RC1
    • Component/s: {Unused} Core
    • Labels:
      None
    • Environment:
      Seen on B3 and B6
    • keywords:
      document, display, null, nullpointer
    • Similar issues:

      Description

      When trying to display an object field that never been set
      For example :

      $doc.newObject("XWiki.XWikiUsers")
      $doc.save()
      $doc.use("XWiki.XWikiUsers")
      $doc.display("blogfeed","view","")

      A Null pointer exception is throw :

      XWikiDocument:display:1305 - Exception showing field blogfeed
      java.lang.NullPointerException
      	at com.xpn.xwiki.objects.classes.PropertyClass.displayView(PropertyClass.java:150)
      	at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1280)
      	at com.xpn.xwiki.doc.XWikiDocument.display(XWikiDocument.java:1260)
      	at com.xpn.xwiki.api.Document.display(Document.java:855)
      	at sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:585)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:248)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
      	at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:419)
      	at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:73)
      	at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:125)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:240)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:143)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:91)
      	at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:229)
      	at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:161)
      	at com.xpn.xwiki.XWiki.include(XWiki.java:2996)
      	at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1299)
      	at com.xpn.xwiki.api.XWiki.includeForm(XWiki.java:1265)
      	at sun.reflect.GeneratedMethodAccessor175.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:585)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:248)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
      	at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      	at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:240)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:143)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.render(XWikiVelocityRenderer.java:91)
      	at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:229)
      	at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:161)
      	at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderText(DefaultXWikiRenderingEngine.java:132)
      	at com.xpn.xwiki.render.DefaultXWikiRenderingEngine.renderDocument(DefaultXWikiRenderingEngine.java:124)
      	at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:351)
      	at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:336)
      	at sun.reflect.GeneratedMethodAccessor160.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:585)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:248)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
      	at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:240)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:143)
      	at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1223)
      	at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1202)
      	at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:489)
      	at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:585)
      	at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:295)
      	at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:248)
      	at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:203)
      	at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      	at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:194)
      	at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:170)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:88)
      	at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:74)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      	at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:107)
      	at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:240)
      	at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:143)
      	at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1223)
      	at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1202)
      	at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:98)
      	at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:159)
      	at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
      	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
      	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
      	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      	at com.xpn.xwiki.web.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:121)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
      	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
      	at java.lang.Thread.run(Thread.java:595)
      

      The bug increase response time

        Attachments

          Activity

            People

            • Assignee:
              sdumitriu Sergiu Dumitriu
              Reporter:
              jerome Jerome Velociter
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: