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

[WON'T FIX] Not properly recognizing Collections of generics as Action return type

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: core-1.2.0
    • Fix Version/s: 2.0.0-M3
    • Component/s: Isis Core
    • Labels:
      None

      Description

      Create a repository that inherits from a "generic" one, which implements a "generic" function like this:

      public abstract class MyAbstractDomainObjectRepositoryAndFactory<DO extends MyAbstractDomainObject>
      		extends AbstractFactoryAndRepository {
      
      	public List<DO> listAll() {
      		return this.allInstances(this.domainObjectClass);
      	}
      
      	...
      }
      

      Create a concrete implementation of the previous repository like this one, which introduces a new action/method:

      public class DomainEntityClassCustomRepository extends
      		AbstractMultiTenantEntityRepositoryAndFactory<DomainEntityClass> {
      
      	...
      
      	public List<RiskRegister> listAllRiskRegisters() {
      		return this.listAll();
      	}
      	...
      }
      

      And:
      DomainEntityClass inherits from MyAbstractDomainObject.

      If the "listAllRiskRegisters" action is invoked from the Wicket viewer it works perfectly, and a list of DomainEntityClass'es is shown.

      And if the list only contains 1 element, the "listAll" action also shows that element.

      But if the "listAll" action is invoked and the list contains more than 1 element the following exception is thrown:

      org.apache.wicket.WicketRuntimeException
      Can't instantiate page using constructor 'public org.apache.isis.viewer.wicket.ui.pages.action.ActionPage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument 'pageType=[ACTION], actionSingleResultsMode=[REDIRECT], objectOid=[com.company.DomainEntityClassCustomRepository:1], actionType=[USER], actionOwningSpec=[com.company.DomainEntityClassCustomRepository], actionId=[listAll()], pageTitle=[List All], actionMode=[RESULTS]'. Might be it doesn't exist, may be it is not visible (public).
      org.apache.wicket.session.DefaultPageFactory#newPage(DefaultPageFactory.java:193)
      org.apache.wicket.session.DefaultPageFactory#newPage(DefaultPageFactory.java:98)
      org.apache.wicket.DefaultMapperContext#newPageInstance(DefaultMapperContext.java:137)
      org.apache.wicket.core.request.handler.PageProvider#resolvePageInstance(PageProvider.java:268)
      org.apache.wicket.core.request.handler.PageProvider#getPageInstance(PageProvider.java:166)
      org.apache.wicket.request.handler.render.PageRenderer#getPage(PageRenderer.java:78)
      org.apache.wicket.request.handler.render.WebPageRenderer#renderPage(WebPageRenderer.java:94)
      org.apache.wicket.request.handler.render.WebPageRenderer#respond(WebPageRenderer.java:196)
      org.apache.wicket.core.request.handler.RenderPageRequestHandler#respond(RenderPageRequestHandler.java:165)
      org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor#respond(RequestCycle.java:854)
      org.apache.wicket.request.RequestHandlerStack#execute(RequestHandlerStack.java:64)
      org.apache.wicket.request.cycle.RequestCycle#execute(RequestCycle.java:254)
      org.apache.wicket.request.cycle.RequestCycle#processRequest(RequestCycle.java:211)
      org.apache.wicket.request.cycle.RequestCycle#processRequestAndDetach(RequestCycle.java:282)
      org.apache.wicket.protocol.http.WicketFilter#processRequestCycle(WicketFilter.java:259)
      org.apache.wicket.protocol.http.WicketFilter#processRequest(WicketFilter.java:201)
      org.apache.wicket.protocol.http.WicketFilter#doFilter(WicketFilter.java:282)
      org.eclipse.jetty.servlet.ServletHandler$CachedChain#doFilter(ServletHandler.java:1326)
      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:1326)
      org.eclipse.jetty.servlet.ServletHandler#doHandle(ServletHandler.java:479)
      org.eclipse.jetty.server.handler.ScopedHandler#handle(ScopedHandler.java:119)
      org.eclipse.jetty.security.SecurityHandler#handle(SecurityHandler.java:520)
      org.eclipse.jetty.server.session.SessionHandler#doHandle(SessionHandler.java:227)
      org.eclipse.jetty.server.handler.ContextHandler#doHandle(ContextHandler.java:940)
      org.eclipse.jetty.servlet.ServletHandler#doScope(ServletHandler.java:409)
      org.eclipse.jetty.server.session.SessionHandler#doScope(SessionHandler.java:186)
      org.eclipse.jetty.server.handler.ContextHandler#doScope(ContextHandler.java:874)
      org.eclipse.jetty.server.handler.ScopedHandler#handle(ScopedHandler.java:117)
      org.eclipse.jetty.server.handler.ContextHandlerCollection#handle(ContextHandlerCollection.java:250)
      org.eclipse.jetty.server.handler.HandlerCollection#handle(HandlerCollection.java:149)
      org.eclipse.jetty.server.handler.HandlerWrapper#handle(HandlerWrapper.java:110)
      org.eclipse.jetty.server.Server#handle(Server.java:349)
      org.eclipse.jetty.server.HttpConnection#handleRequest(HttpConnection.java:441)
      org.eclipse.jetty.server.HttpConnection$RequestHandler#headerComplete(HttpConnection.java:904)
      org.eclipse.jetty.http.HttpParser#parseNext(HttpParser.java:565)
      org.eclipse.jetty.http.HttpParser#parseAvailable(HttpParser.java:217)
      org.eclipse.jetty.server.AsyncHttpConnection#handle(AsyncHttpConnection.java:46)
      org.eclipse.jetty.io.nio.SelectChannelEndPoint#handle(SelectChannelEndPoint.java:545)
      org.eclipse.jetty.io.nio.SelectChannelEndPoint$1#run(SelectChannelEndPoint.java:43)
      org.eclipse.jetty.util.thread.QueuedThreadPool#runJob(QueuedThreadPool.java:598)
      org.eclipse.jetty.util.thread.QueuedThreadPool$3#run(QueuedThreadPool.java:533)
      java.lang.Thread#run(Thread.java:680)
      java.lang.reflect.InvocationTargetException
      sun.reflect.NativeConstructorAccessorImpl#newInstance0(NativeConstructorAccessorImpl.java:-2)
      sun.reflect.NativeConstructorAccessorImpl#newInstance(NativeConstructorAccessorImpl.java:39)
      sun.reflect.DelegatingConstructorAccessorImpl#newInstance(DelegatingConstructorAccessorImpl.java:27)
      java.lang.reflect.Constructor#newInstance(Constructor.java:513)
      org.apache.wicket.session.DefaultPageFactory#newPage(DefaultPageFactory.java:170)
      org.apache.wicket.session.DefaultPageFactory#newPage(DefaultPageFactory.java:98)
      org.apache.wicket.DefaultMapperContext#newPageInstance(DefaultMapperContext.java:137)
      org.apache.wicket.core.request.handler.PageProvider#resolvePageInstance(PageProvider.java:268)
      org.apache.wicket.core.request.handler.PageProvider#getPageInstance(PageProvider.java:166)
      org.apache.wicket.request.handler.render.PageRenderer#getPage(PageRenderer.java:78)
      org.apache.wicket.request.handler.render.WebPageRenderer#renderPage(WebPageRenderer.java:94)
      org.apache.wicket.request.handler.render.WebPageRenderer#respond(WebPageRenderer.java:196)
      org.apache.wicket.core.request.handler.RenderPageRequestHandler#respond(RenderPageRequestHandler.java:165)
      org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor#respond(RequestCycle.java:854)
      org.apache.wicket.request.RequestHandlerStack#execute(RequestHandlerStack.java:64)
      org.apache.wicket.request.cycle.RequestCycle#execute(RequestCycle.java:254)
      org.apache.wicket.request.cycle.RequestCycle#processRequest(RequestCycle.java:211)
      org.apache.wicket.request.cycle.RequestCycle#processRequestAndDetach(RequestCycle.java:282)
      org.apache.wicket.protocol.http.WicketFilter#processRequestCycle(WicketFilter.java:259)
      org.apache.wicket.protocol.http.WicketFilter#processRequest(WicketFilter.java:201)
      org.apache.wicket.protocol.http.WicketFilter#doFilter(WicketFilter.java:282)
      org.eclipse.jetty.servlet.ServletHandler$CachedChain#doFilter(ServletHandler.java:1326)
      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:1326)
      org.eclipse.jetty.servlet.ServletHandler#doHandle(ServletHandler.java:479)
      org.eclipse.jetty.server.handler.ScopedHandler#handle(ScopedHandler.java:119)
      org.eclipse.jetty.security.SecurityHandler#handle(SecurityHandler.java:520)
      org.eclipse.jetty.server.session.SessionHandler#doHandle(SessionHandler.java:227)
      org.eclipse.jetty.server.handler.ContextHandler#doHandle(ContextHandler.java:940)
      org.eclipse.jetty.servlet.ServletHandler#doScope(ServletHandler.java:409)
      org.eclipse.jetty.server.session.SessionHandler#doScope(SessionHandler.java:186)
      org.eclipse.jetty.server.handler.ContextHandler#doScope(ContextHandler.java:874)
      org.eclipse.jetty.server.handler.ScopedHandler#handle(ScopedHandler.java:117)
      org.eclipse.jetty.server.handler.ContextHandlerCollection#handle(ContextHandlerCollection.java:250)
      org.eclipse.jetty.server.handler.HandlerCollection#handle(HandlerCollection.java:149)
      org.eclipse.jetty.server.handler.HandlerWrapper#handle(HandlerWrapper.java:110)
      org.eclipse.jetty.server.Server#handle(Server.java:349)
      org.eclipse.jetty.server.HttpConnection#handleRequest(HttpConnection.java:441)
      org.eclipse.jetty.server.HttpConnection$RequestHandler#headerComplete(HttpConnection.java:904)
      org.eclipse.jetty.http.HttpParser#parseNext(HttpParser.java:565)
      org.eclipse.jetty.http.HttpParser#parseAvailable(HttpParser.java:217)
      org.eclipse.jetty.server.AsyncHttpConnection#handle(AsyncHttpConnection.java:46)
      org.eclipse.jetty.io.nio.SelectChannelEndPoint#handle(SelectChannelEndPoint.java:545)
      org.eclipse.jetty.io.nio.SelectChannelEndPoint$1#run(SelectChannelEndPoint.java:43)
      org.eclipse.jetty.util.thread.QueuedThreadPool#runJob(QueuedThreadPool.java:598)
      org.eclipse.jetty.util.thread.QueuedThreadPool$3#run(QueuedThreadPool.java:533)
      java.lang.Thread#run(Thread.java:680)
      
      java.lang.NullPointerException
      org.apache.isis.viewer.wicket.model.models.EntityCollectionModel#createStandalone(EntityCollectionModel.java:152)
      org.apache.isis.viewer.wicket.ui.components.actions.ActionPanel$ResultType$2#addOrReplaceCollectionResultsPanel(ActionPanel.java:361)
      org.apache.isis.viewer.wicket.ui.components.actions.ActionPanel$ResultType$2#addResults(ActionPanel.java:357)
      org.apache.isis.viewer.wicket.ui.components.actions.ActionPanel#executeActionOnTargetAndProcessResults(ActionPanel.java:186)
      org.apache.isis.viewer.wicket.ui.components.actions.ActionPanel#executeActionAndProcessResults(ActionPanel.java:138)
      org.apache.isis.viewer.wicket.ui.components.actions.ActionPanel#buildGui(ActionPanel.java:96)
      org.apache.isis.viewer.wicket.ui.components.actions.ActionPanel#<init>(ActionPanel.java:89)
      org.apache.isis.viewer.wicket.ui.components.actions.ActionPanelFactory#createComponent(ActionPanelFactory.java:49)
      org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract#createComponent(ComponentFactoryAbstract.java:82)
      org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault#createComponent(ComponentFactoryRegistryDefault.java:120)
      org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault#addOrReplaceComponent(ComponentFactoryRegistryDefault.java:105)
      org.apache.isis.viewer.wicket.ui.pages.PageAbstract#addComponent(PageAbstract.java:266)
      org.apache.isis.viewer.wicket.ui.pages.PageAbstract#addChildComponents(PageAbstract.java:261)
      org.apache.isis.viewer.wicket.ui.pages.action.ActionPage#<init>(ActionPage.java:54)
      sun.reflect.NativeConstructorAccessorImpl#newInstance0(NativeConstructorAccessorImpl.java:-2)
      sun.reflect.NativeConstructorAccessorImpl#newInstance(NativeConstructorAccessorImpl.java:39)
      sun.reflect.DelegatingConstructorAccessorImpl#newInstance(DelegatingConstructorAccessorImpl.java:27)
      java.lang.reflect.Constructor#newInstance(Constructor.java:513)
      org.apache.wicket.session.DefaultPageFactory#newPage(DefaultPageFactory.java:170)
      org.apache.wicket.session.DefaultPageFactory#newPage(DefaultPageFactory.java:98)
      org.apache.wicket.DefaultMapperContext#newPageInstance(DefaultMapperContext.java:137)
      org.apache.wicket.core.request.handler.PageProvider#resolvePageInstance(PageProvider.java:268)
      org.apache.wicket.core.request.handler.PageProvider#getPageInstance(PageProvider.java:166)
      org.apache.wicket.request.handler.render.PageRenderer#getPage(PageRenderer.java:78)
      org.apache.wicket.request.handler.render.WebPageRenderer#renderPage(WebPageRenderer.java:94)
      org.apache.wicket.request.handler.render.WebPageRenderer#respond(WebPageRenderer.java:196)
      org.apache.wicket.core.request.handler.RenderPageRequestHandler#respond(RenderPageRequestHandler.java:165)
      org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor#respond(RequestCycle.java:854)
      org.apache.wicket.request.RequestHandlerStack#execute(RequestHandlerStack.java:64)
      org.apache.wicket.request.cycle.RequestCycle#execute(RequestCycle.java:254)
      org.apache.wicket.request.cycle.RequestCycle#processRequest(RequestCycle.java:211)
      org.apache.wicket.request.cycle.RequestCycle#processRequestAndDetach(RequestCycle.java:282)
      org.apache.wicket.protocol.http.WicketFilter#processRequestCycle(WicketFilter.java:259)
      org.apache.wicket.protocol.http.WicketFilter#processRequest(WicketFilter.java:201)
      org.apache.wicket.protocol.http.WicketFilter#doFilter(WicketFilter.java:282)
      org.eclipse.jetty.servlet.ServletHandler$CachedChain#doFilter(ServletHandler.java:1326)
      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:1326)
      org.eclipse.jetty.servlet.ServletHandler#doHandle(ServletHandler.java:479)
      org.eclipse.jetty.server.handler.ScopedHandler#handle(ScopedHandler.java:119)
      org.eclipse.jetty.security.SecurityHandler#handle(SecurityHandler.java:520)
      org.eclipse.jetty.server.session.SessionHandler#doHandle(SessionHandler.java:227)
      org.eclipse.jetty.server.handler.ContextHandler#doHandle(ContextHandler.java:940)
      org.eclipse.jetty.servlet.ServletHandler#doScope(ServletHandler.java:409)
      org.eclipse.jetty.server.session.SessionHandler#doScope(SessionHandler.java:186)
      org.eclipse.jetty.server.handler.ContextHandler#doScope(ContextHandler.java:874)
      org.eclipse.jetty.server.handler.ScopedHandler#handle(ScopedHandler.java:117)
      org.eclipse.jetty.server.handler.ContextHandlerCollection#handle(ContextHandlerCollection.java:250)
      org.eclipse.jetty.server.handler.HandlerCollection#handle(HandlerCollection.java:149)
      org.eclipse.jetty.server.handler.HandlerWrapper#handle(HandlerWrapper.java:110)
      org.eclipse.jetty.server.Server#handle(Server.java:349)
      org.eclipse.jetty.server.HttpConnection#handleRequest(HttpConnection.java:441)
      org.eclipse.jetty.server.HttpConnection$RequestHandler#headerComplete(HttpConnection.java:904)
      org.eclipse.jetty.http.HttpParser#parseNext(HttpParser.java:565)
      org.eclipse.jetty.http.HttpParser#parseAvailable(HttpParser.java:217)
      org.eclipse.jetty.server.AsyncHttpConnection#handle(AsyncHttpConnection.java:46)
      org.eclipse.jetty.io.nio.SelectChannelEndPoint#handle(SelectChannelEndPoint.java:545)
      org.eclipse.jetty.io.nio.SelectChannelEndPoint$1#run(SelectChannelEndPoint.java:43)
      org.eclipse.jetty.util.thread.QueuedThreadPool#runJob(QueuedThreadPool.java:598)
      org.eclipse.jetty.util.thread.QueuedThreadPool$3#run(QueuedThreadPool.java:533)
      java.lang.Thread#run(Thread.java:680)
      

      So it seems that Isis is not properly recognizing the type enclosed on the List represented by <DO>.

        Attachments

          Activity

            People

            • Assignee:
              danhaywood Daniel Keir Haywood
              Reporter:
              obou Oscar Bou
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: