Uploaded image for project: 'Isis'
  1. Isis
  2. ISIS-1412

Actions annotated with SemanticsOf.IDEMPOTENT_ARE_YOU_SURE throw a NullPointerException when invoked through the REST API

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 1.13.0
    • Labels:
      None
    • Environment:
      1.13.0-SNAPSHOT

      Description

      I have an action delete() annotated with @Action(semantics = SemanticsOf.IDEMPOTENT_ARE_YOU_SURE).

      This is the resulting stack trace after invoking the action through the REST API:

      {
        "className" : "java.lang.NullPointerException",
        "message" : "java.lang.NullPointerException",
        "stackTrace" : [ "org.apache.isis.viewer.restfulobjects.rendering.domainobjects.AbstractObjectMemberReprRenderer.addLinkFor(AbstractObjectMemberReprRenderer.java:219)", "org.apache.isis.viewer.restfulobjects.rendering.domainobjects.ObjectActionReprRenderer.addMutatorLinksIfEnabled(ObjectActionReprRenderer.java:97)", "org.apache.isis.viewer.restfulobjects.rendering.domainobjects.AbstractObjectMemberReprRenderer.renderMemberContent(AbstractObjectMemberReprRenderer.java:186)", "org.apache.isis.viewer.restfulobjects.rendering.domainobjects.ObjectActionReprRenderer.render(ObjectActionReprRenderer.java:58)", "org.apache.isis.viewer.restfulobjects.rendering.Responses.ofOk(Responses.java:70)", "org.apache.isis.viewer.restfulobjects.rendering.Responses.ofOk(Responses.java:41)", "org.apache.isis.viewer.restfulobjects.rendering.service.conneg.ContentNegotiationServiceForRestfulObjectsV1_0.buildResponse(ContentNegotiationServiceForRestfulObjectsV1_0.java:193)", "org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceContentNegotiator$4.apply(RepresentationServiceContentNegotiator.java:137)", "org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceContentNegotiator$4.apply(RepresentationServiceContentNegotiator.java:134)", "org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceContentNegotiator.buildResponse(RepresentationServiceContentNegotiator.java:195)", "org.apache.isis.viewer.restfulobjects.rendering.service.RepresentationServiceContentNegotiator.actionPrompt(RepresentationServiceContentNegotiator.java:134)", "org.apache.isis.viewer.restfulobjects.server.resources.DomainResourceHelper.actionPrompt(DomainResourceHelper.java:296)", "org.apache.isis.viewer.restfulobjects.server.resources.DomainObjectResourceServerside.actionPrompt(DomainObjectResourceServerside.java:417)", "sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)", "sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)", "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)", "java.lang.reflect.Method.invoke(Method.java:497)", "org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:139)", "org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:295)", "org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:249)", "org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:236)", "org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:395)", "org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)", "org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)", "org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)", "org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)", "javax.servlet.http.HttpServlet.service(HttpServlet.java:668)", "org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)", "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1685)", "org.apache.isis.viewer.restfulobjects.server.webapp.IsisTransactionFilterForRestfulObjects.doFilter(IsisTransactionFilterForRestfulObjects.java:46)", "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)", "org.apache.isis.core.webapp.IsisSessionFilter.doFilter(IsisSessionFilter.java:341)", "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)", "org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter.doFilter(IsisLogOnExceptionFilter.java:52)", "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)", "org.togglz.servlet.TogglzFilter.doFilter(TogglzFilter.java:100)", "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)", "org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)", "org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)", "org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)", "org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)", "org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)", "org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)", "org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)", "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)", "org.ebaysf.web.cors.CORSFilter.handleNonCORS(CORSFilter.java:438)", "org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:173)", "org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)", "org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)", "org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)", "org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)", "org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)", "org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)", "org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)", "org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)", "org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)", "org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)", "org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)", "org.eclipse.jetty.server.Server.handle(Server.java:517)", "org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:308)", "org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)", "org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)", "org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)", "org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)", "org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)", "org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)", "org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)", "org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)", "java.lang.Thread.run(Thread.java:745)" ],
        "causedBy" : null
      }
      

      Without the ARE_YOU_SURE semantics, the action can be invoked as expected.

        Activity

        Hide
        danhaywood Dan Haywood added a comment -

        Using the swagger-ui, I invoked the simpleapp's SimpleObject#delete action, annotated with ARE YOU SURE; seemed to work fine. Some when changed (temporarily) to IDEMPOTENT.

            @Action(
               semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE
            )
            public void delete() {
                repositoryService.remove(this);
            }
        

        Therefore closing as non-reproduceable.

        Show
        danhaywood Dan Haywood added a comment - Using the swagger-ui, I invoked the simpleapp's SimpleObject#delete action, annotated with ARE YOU SURE; seemed to work fine. Some when changed (temporarily) to IDEMPOTENT. @Action( semantics = SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE ) public void delete() { repositoryService.remove( this ); } Therefore closing as non-reproduceable.

          People

          • Assignee:
            danhaywood Dan Haywood
            Reporter:
            sginn Sander Ginn
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development