Tapestry
  1. Tapestry
  2. TAPESTRY-1308

Exceptions while building services are poorly reported

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.3
    • Component/s: tapestry-ioc
    • Labels:
      None

      Description

      Take the sample app built by tapestry-simple, and change buildTimingFilter to:

      public RequestFilter buildTimingFilter(final Log log, final @InjectService("Test") Object test)

      ... body unchanged ...

      Add:

      public static Object buildTest()

      { throw new RuntimeException("Bang"); }

      When you run this, you get a 500 page:

      HTTP ERROR: 500

      INTERNAL_SERVER_ERROR
      RequestURI=/myapp/start

      Caused by:

      java.lang.NullPointerException
      at $Request_1110563691a.getContextPath($Request_1110563691a.java)
      at $Request_111056368ca.getContextPath($Request_111056368ca.java)
      at org.apache.tapestry.internal.services.RequestRenderer.render(RequestRenderer.java:34)
      at org.apache.tapestry.internal.services.RequestRenderer.render(RequestRenderer.java:24)
      at $ObjectRenderer_11105636919.render($ObjectRenderer_11105636919.java)
      at $ObjectRenderer_111056368c7.render($ObjectRenderer_111056368c7.java)
      at org.apache.tapestry.corelib.components.RenderObject.beginRender(RenderObject.java:37)
      at org.apache.tapestry.corelib.components.RenderObject.beginRender(RenderObject.java)
      at org.apache.tapestry.internal.structure.ComponentPageElementImpl$10$1.run(ComponentPageElementImpl.java:334)
      at org.apache.tapestry.internal.structure.ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:931)
      at org.apache.tapestry.internal.structure.ComponentPageElementImpl.access$100(ComponentPageElementImpl.java:68)
      at org.apache.tapestry.internal.structure.ComponentPageElementImpl$10.render(ComponentPageElementImpl.java:338)
      at org.apache.tapestry.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:57)
      at org.apache.tapestry.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:40)
      at $PageMarkupRenderer_11105636915.renderPageMarkup($PageMarkupRenderer_11105636915.java)
      at org.apache.tapestry.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:45)
      at $PageResponseRenderer_111056368da.renderPageResponse($PageResponseRenderer_111056368da.java)
      at org.apache.tapestry.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:56)
      at $RequestExceptionHandler_111056368b1.handleRequestException($RequestExceptionHandler_111056368b1.java)
      at org.apache.tapestry.services.TapestryModule$6.service(TapestryModule.java:523)
      at $RequestHandler_111056368ee.service($RequestHandler_111056368ee.java)
      at org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:56)
      at $RequestHandler_111056368ee.service($RequestHandler_111056368ee.java)
      at org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:43)
      at $RequestHandler_111056368ee.service($RequestHandler_111056368ee.java)
      at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:91)
      at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:82)
      at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
      at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:104)
      at $RequestHandler_111056368ee.service($RequestHandler_111056368ee.java)
      at $RequestHandler_111056368e8.service($RequestHandler_111056368e8.java)
      at org.apache.tapestry.services.TapestryModule$3.service(TapestryModule.java:402)
      at $HttpServletRequestHandler_111056368e7.service($HttpServletRequestHandler_111056368e7.java)
      at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:114)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:690)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:401)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
      at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      at org.mortbay.jetty.Server.handle(Server.java:285)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

      The logs are no more informative.

      1. tapestry-1308.patch
        3 kB
        Tom Davies
      2. log.txt
        16 kB
        Tom Davies

        Activity

        Tom Davies created issue -
        Tom Davies made changes -
        Field Original Value New Value
        Attachment log.txt [ 12352190 ]
        Tom Davies made changes -
        Attachment tapestry-1308.patch [ 12352294 ]
        Howard M. Lewis Ship made changes -
        Fix Version/s 5.0.3 [ 12312338 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Howard M. Lewis Ship [ hlship ]
        Mark Thomas made changes -
        Workflow jira [ 12398376 ] Default workflow, editable Closed status [ 12569229 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12569229 ] jira [ 12590484 ]

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Tom Davies
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development