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

Addon module isis-module-settings is not working after upgrade to Isis 1.15.0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.15.0
    • Fix Version/s: 1.15.1
    • Component/s: Core
    • Labels:
      None

      Description

      Here the mail thread describing the issue: https://www.mail-archive.com/users@isis.apache.org/msg05286.html

      How to reproduce

      • Integrate addon with simpleapp
      • Try to create an Application Settings "New String"

      Exception

      07:45:49,678  [RequestCycleExtra    qtp942986815-17 WARN ]  Handling the
      following exception
      org.apache.wicket.WicketRuntimeException: Method onRequest of interface
      org.apache.wicket.behavior.IBehaviorListener targeted at
      org.apache.wicket.ajax.markup.html.form.AjaxButton$1@302b1c47 on component
      [IndicatingAjaxButton [Component id = okButton]] threw an exception
      at
      org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
      at
      org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
      at
      org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
      at
      org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
      at
      org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:895)
      at
      org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
      at
      org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
      at
      org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
      at
      org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
      at
      org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:261)
      at
      org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203)
      at
      org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284)
      at
      org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
      at
      org.apache.isis.core.webapp.diagnostics.IsisLogOnExceptionFilter.doFilter(IsisLogOnExceptionFilter.java:52)
      at
      org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
      at
      org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
      at
      org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
      at
      org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
      at
      org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
      at
      org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
      at
      org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
      at
      org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
      at
      org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
      at
      org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
      at
      org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at
      org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
      at
      org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
      at
      org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
      at
      org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at
      org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
      at
      org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at
      org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
      at org.eclipse.jetty.server.Server.handle(Server.java:524)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
      at
      org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
      at
      org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
      at
      org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
      at
      org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
      at
      org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
      at
      org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
      at
      org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
      at
      org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at
      org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
      ... 44 more
      Caused by: java.lang.RuntimeException: java.lang.NumberFormatException: For
      input string: "dd"
      at
      org.apache.isis.core.metamodel.adapter.mgr.AdapterManager$ConcurrencyChecking.executeWithConcurrencyCheckingDisabled(AdapterManager.java:90)
      at
      org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponseType.toEntityPage(ActionResultResponseType.java:159)
      at
      org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponseType.access$200(ActionResultResponseType.java:46)
      at
      org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponseType$1.interpretResult(ActionResultResponseType.java:51)
      at
      org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponseType.determineAndInterpretResult(ActionResultResponseType.java:178)
      at
      org.apache.isis.viewer.wicket.ui.components.actions.ActionFormExecutorStrategy.redirectTo(ActionFormExecutorStrategy.java:79)
      at
      org.apache.isis.viewer.wicket.ui.panels.FormExecutorDefault.redirectTo(FormExecutorDefault.java:520)
      at
      org.apache.isis.viewer.wicket.ui.panels.FormExecutorDefault.executeAndProcessResults(FormExecutorDefault.java:166)
      at
      org.apache.isis.viewer.wicket.ui.panels.PromptFormAbstract.onOkSubmittedOf(PromptFormAbstract.java:228)
      at
      org.apache.isis.viewer.wicket.ui.panels.PromptFormAbstract.access$000(PromptFormAbstract.java:60)
      at
      org.apache.isis.viewer.wicket.ui.panels.PromptFormAbstract$1.onSubmit(PromptFormAbstract.java:122)
      at
      org.apache.wicket.ajax.markup.html.form.AjaxButton$1.onSubmit(AjaxButton.java:113)
      at
      org.apache.wicket.ajax.form.AjaxFormSubmitBehavior$AjaxFormSubmitter.onSubmit(AjaxFormSubmitBehavior.java:215)
      at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1307)
      at org.apache.wicket.markup.html.form.Form.process(Form.java:976)
      at
      org.apache.isis.viewer.wicket.ui.panels.FormAbstract.process(FormAbstract.java:77)
      at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:797)
      at
      org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:171)
      at
      org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:155)
      at
      org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:601)
      ... 49 more
      Caused by: java.lang.NumberFormatException: For input string: "dd"
      at
      java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.lang.Integer.parseInt(Integer.java:580)
      at java.lang.Integer.parseInt(Integer.java:615)
      at
      org.isisaddons.module.settings.dom.SettingAbstract.parseValueAsInt(SettingAbstract.java:89)
      at
      org.isisaddons.module.settings.dom.SettingAbstract.getValueAsInt(SettingAbstract.java:147)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at
      org.apache.isis.core.commons.lang.MethodExtensions.invoke(MethodExtensions.java:53)
      at
      org.apache.isis.core.commons.lang.MethodExtensions.invoke(MethodExtensions.java:47)
      at
      org.apache.isis.core.metamodel.adapter.ObjectAdapter$InvokeUtils.invoke(ObjectAdapter.java:373)
      at
      org.apache.isis.core.metamodel.facets.properties.accessor.PropertyAccessorFacetViaAccessor.getProperty(PropertyAccessorFacetViaAccessor.java:76)
      at
      org.apache.isis.core.metamodel.specloader.specimpl.OneToOneAssociationDefault.get(OneToOneAssociationDefault.java:146)
      at
      org.apache.isis.viewer.wicket.model.models.ScalarModel$Kind$1.reset(ScalarModel.java:293)
      at
      org.apache.isis.viewer.wicket.model.models.ScalarModel$Kind$1.init(ScalarModel.java:283)
      at
      org.apache.isis.viewer.wicket.model.models.ScalarModel.init(ScalarModel.java:683)
      at
      org.apache.isis.viewer.wicket.model.models.ScalarModel.<init>(ScalarModel.java:677)
      at
      org.apache.isis.viewer.wicket.model.models.EntityModel.getPropertyModel(EntityModel.java:357)
      at
      org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup.addPropertyToForm(PropertyGroup.java:204)
      at
      org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup.buildGui(PropertyGroup.java:104)
      at
      org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup.<init>(PropertyGroup.java:78)
      at
      org.apache.isis.viewer.wicket.ui.components.layout.bs3.col.Col.buildGui(Col.java:243)
      at
      org.apache.isis.viewer.wicket.ui.components.layout.bs3.col.Col.<init>(Col.java:79)
      at
      org.apache.isis.viewer.wicket.ui.components.layout.bs3.row.Row.buildGui(Row.java:69)
      at
      org.apache.isis.viewer.wicket.ui.components.layout.bs3.row.Row.<init>(Row.java:53)
      at
      org.apache.isis.viewer.wicket.ui.components.layout.bs3.BS3GridPanel.buildGui(BS3GridPanel.java:53)
      at
      org.apache.isis.viewer.wicket.ui.components.layout.bs3.BS3GridPanel.<init>(BS3GridPanel.java:42)
      at
      org.apache.isis.viewer.wicket.ui.components.entity.selector.links.EntityLinksSelectorPanelFactory.createComponent(EntityLinksSelectorPanelFactory.java:57)
      at
      org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract.createComponent(ComponentFactoryAbstract.java:98)
      at
      org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault.createComponent(ComponentFactoryRegistryDefault.java:121)
      at
      org.apache.isis.viewer.wicket.viewer.registries.components.ComponentFactoryRegistryDefault.addOrReplaceComponent(ComponentFactoryRegistryDefault.java:106)
      at
      org.apache.isis.viewer.wicket.ui.pages.PageAbstract.addComponent(PageAbstract.java:404)
      at
      org.apache.isis.viewer.wicket.ui.pages.PageAbstract.addChildComponents(PageAbstract.java:399)
      at
      org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage.buildPage(EntityPage.java:182)
      at
      org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage.<init>(EntityPage.java:115)
      at
      org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage.<init>(EntityPage.java:83)
      at
      org.apache.isis.viewer.wicket.ui.pages.entity.EntityPage.<init>(EntityPage.java:95)
      at
      org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponseType$9.call(ActionResultResponseType.java:162)
      at
      org.apache.isis.viewer.wicket.ui.actionresponse.ActionResultResponseType$9.call(ActionResultResponseType.java:160)
      at
      org.apache.isis.core.metamodel.adapter.mgr.AdapterManager$ConcurrencyChecking.executeWithConcurrencyCheckingDisabled(AdapterManager.java:88)
      ... 68 more
      07:45:49,684  [RequestCycleExtra    qtp942986815-17 WARN ]
      

      Here the fork with simpleapp and addon:
      https://github.com/niv0/isis/tree/simpleapp-with-settings-addon

        Activity

        Hide
        niv Vladimir Nisevic added a comment - - edited

        Hi Dan, I have done some analysis and found next behaviour

        in the org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup you filter out the properties which are hidden...

        private ImmutableList<ObjectAssociation> getObjectAssociations(
                final List<PropertyLayoutData> properties,
                final ObjectAdapter adapter) {
        
            //
            // previously we filtered out any invisible properties.
            // However, the inline prompt/don't redirect logic introduced in 1.15.0 means that we keep the same page,
            // and it may be that individual properties start out as invisible but then become visible later.
            //
            // therefore the responsibility of determining whether an individual property's component should be visible
            // or not moves to ScalarPanelAbstract2#onConfigure(...)
            //
        
            return FluentIterable.from(properties)
                        .filter(new Predicate<PropertyLayoutData>() {
                            @Override
                            public boolean apply(final PropertyLayoutData propertyLayoutData) {
                                return propertyLayoutData.getMetadataError() == null;
                            }
                        })
                        .transform(new Function<PropertyLayoutData, ObjectAssociation>() {
                            @Override
                            public ObjectAssociation apply(final PropertyLayoutData propertyLayoutData) {
                                ObjectSpecification adapterSpecification = adapter.getSpecification();
                                try {
                                    // this shouldn't happen, but has been reported (https://issues.apache.org/jira/browse/ISIS-1574),
                                    // suggesting that in some cases the GridService can get it wrong.  This is therefore a hack...
                                    return adapterSpecification.getAssociation(propertyLayoutData.getId());
                                } catch (ObjectSpecificationException e) {
                                    return null;
                                }
                            }
                        })
                    .filter(new Predicate<ObjectAssociation>() {
                        @Override public boolean apply(@Nullable final ObjectAssociation objectAssociation) {
                            if(objectAssociation == null) {
                                return false;
                            }
                            final HiddenFacet facet = objectAssociation.getFacet(HiddenFacet.class);
                            if(facet != null && !facet.isNoop()) {
                                // static invisible.
                                if(facet.where() == Where.EVERYWHERE || facet.where() == Where.OBJECT_FORMS) {
                                    return false;
                                }
                            }
                            return true;
                        }
                    })
                        .toList();
        }
        
        

        but in the case of org.isisaddons.module.settings.dom.SettingAbstract , in property e.g. getValueAsInt() decision of hidden is done by supporting method

        @Property(
                hidden = Where.ALL_TABLES
        )
        public Integer getValueAsInt() {
            return parseValueAsInt();
        }
        public boolean hideValueAsInt() {
            return typeIsNot(SettingType.INT);
        }
        

        this is not honoured by the filter method above and therefore all getValueAsXxx are still there and evaluated when building the GUI.

        Not sure if I am on right path...

        BR,Vladimir

        Show
        niv Vladimir Nisevic added a comment - - edited Hi Dan, I have done some analysis and found next behaviour in the org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup you filter out the properties which are hidden... private ImmutableList<ObjectAssociation> getObjectAssociations( final List<PropertyLayoutData> properties, final ObjectAdapter adapter) { // // previously we filtered out any invisible properties. // However, the inline prompt/don't redirect logic introduced in 1.15.0 means that we keep the same page, // and it may be that individual properties start out as invisible but then become visible later. // // therefore the responsibility of determining whether an individual property's component should be visible // or not moves to ScalarPanelAbstract2#onConfigure(...) // return FluentIterable.from(properties) .filter( new Predicate<PropertyLayoutData>() { @Override public boolean apply( final PropertyLayoutData propertyLayoutData) { return propertyLayoutData.getMetadataError() == null ; } }) .transform( new Function<PropertyLayoutData, ObjectAssociation>() { @Override public ObjectAssociation apply( final PropertyLayoutData propertyLayoutData) { ObjectSpecification adapterSpecification = adapter.getSpecification(); try { // this shouldn't happen, but has been reported (https://issues.apache.org/jira/browse/ISIS-1574), // suggesting that in some cases the GridService can get it wrong. This is therefore a hack... return adapterSpecification.getAssociation(propertyLayoutData.getId()); } catch (ObjectSpecificationException e) { return null ; } } }) .filter( new Predicate<ObjectAssociation>() { @Override public boolean apply(@Nullable final ObjectAssociation objectAssociation) { if (objectAssociation == null ) { return false ; } final HiddenFacet facet = objectAssociation.getFacet(HiddenFacet.class); if (facet != null && !facet.isNoop()) { // static invisible. if (facet.where() == Where.EVERYWHERE || facet.where() == Where.OBJECT_FORMS) { return false ; } } return true ; } }) .toList(); } but in the case of org.isisaddons.module.settings.dom.SettingAbstract , in property e.g. getValueAsInt() decision of hidden is done by supporting method @Property( hidden = Where.ALL_TABLES ) public Integer getValueAsInt() { return parseValueAsInt(); } public boolean hideValueAsInt() { return typeIsNot(SettingType.INT); } this is not honoured by the filter method above and therefore all getValueAsXxx are still there and evaluated when building the GUI. Not sure if I am on right path... BR,Vladimir
        Hide
        danhaywood Dan Haywood added a comment -

        fixed in incode platform, 1.15.0 release

        Show
        danhaywood Dan Haywood added a comment - fixed in incode platform, 1.15.0 release

          People

          • Assignee:
            danhaywood Dan Haywood
            Reporter:
            niv Vladimir Nisevic
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development