Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1361

BeanEditForm will throw NullPointerException if its object parameter is bound to null

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      • java.lang.NullPointerException

      Stack trace
      o org.apache.tapestry.corelib.components.BeanEditForm.onPrepareFromForm(BeanEditForm.java:205)
      o org.apache.tapestry.corelib.components.BeanEditForm.handleComponentEvent(BeanEditForm.java)
      o org.apache.tapestry.internal.structure.ComponentPageElementImpl.handleEvent(ComponentPageElementImpl.java:895)
      o org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerEvent(ComponentPageElementImpl.java:1002)
      o org.apache.tapestry.internal.structure.InternalComponentResourcesImpl.triggerEvent(InternalComponentResourcesImpl.java:140)
      o org.apache.tapestry.corelib.components.Form.onAction(Form.java:323)
      o org.apache.tapestry.corelib.components.Form.handleComponentEvent(Form.java)
      o org.apache.tapestry.internal.structure.ComponentPageElementImpl.handleEvent(ComponentPageElementImpl.java:903)
      o org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerEvent(ComponentPageElementImpl.java:1002)
      o org.apache.tapestry.internal.services.ActionLinkHandlerImpl.handle(ActionLinkHandlerImpl.java:100)
      o org.apache.tapestry.internal.services.ActionLinkHandlerImpl.handle(ActionLinkHandlerImpl.java:53)
      o org.apache.tapestry.internal.services.ComponentActionDispatcher.dispatch(ComponentActionDispatcher.java:115)
      o org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:1201)
      o org.example.survey.services.AppModule$1.service(AppModule.java:52)
      o org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:43)
      o org.apache.tapestry.services.TapestryModule$3.service(TapestryModule.java:736)
      o org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:63)
      o org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:91)
      o org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:82)
      o org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
      o org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:104)
      o org.apache.tapestry.services.TapestryModule$11.service(TapestryModule.java:1179)
      o org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:115)
      o org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
      o org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:471)
      o org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
      o org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
      o org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
      o org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
      o org.mortbay.http.HttpServer.service(HttpServer.java:909)
      o org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
      o org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
      o org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
      o org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
      o org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
      o org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

      boolean onPrepareFromForm()
      {
      // Fire a new prepare event to be consumed by the container. This is the container's
      // chance to ensure that there's an object to edit.

      _resources.triggerEvent(Form.PREPARE, null, null);

      if (_model == null)

      { Class<? extends Object> beanType = _object.getClass(); // line 205 _model = _modelSource.create(beanType, true, _resources.getContainerResources()); }

      return true; // abort the form's prepare event
      }

      It should fail with a reasonable message and/or implement TAPESTRY-1359.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hlship Howard Lewis Ship
                Reporter:
                hlship Howard Lewis Ship
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: