wcm-io / io.wcm.wcm.ui.granite

Granite UI Components for AEM Touch UI.
Apache License 2.0
0 stars 3 forks source link

DummyJspWriter#write throws UnsupportedOperationException #8

Closed henrykuijpers closed 7 months ago

henrykuijpers commented 9 months ago
06.02.2024 09:14:53.270 *WARN* [[0:0:0:0:0:0:0:1] [1707207293254] GET /mnt/overlay/wcm-io/wcm/ui/granite/content/form/pathfield/picker.html HTTP/1.1] org.apache.sling.models.impl.ModelAdapterFactory Could not adapt to model
org.apache.sling.models.factory.PostConstructException: Post-construct method has thrown an exception for model class io.wcm.wcm.ui.granite.components.pathfield.ColumnView
    at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:763) [org.apache.sling.models.impl:1.4.16.B0002]
    at org.apache.sling.models.impl.ModelAdapterFactory.internalCreateModel(ModelAdapterFactory.java:428) [org.apache.sling.models.impl:1.4.16.B0002]
    at org.apache.sling.models.impl.ModelAdapterFactory.getAdapter(ModelAdapterFactory.java:270) [org.apache.sling.models.impl:1.4.16.B0002]
    at org.apache.sling.adapter.internal.AdapterManagerImpl.getAdapter(AdapterManagerImpl.java:143) [org.apache.sling.adapter:2.1.10]
    at org.apache.sling.engine.impl.SlingMainServlet.adaptTo(SlingMainServlet.java:625)
    at org.apache.sling.engine.impl.request.RequestData.adaptTo(RequestData.java:703)
    at org.apache.sling.engine.impl.SlingHttpServletRequestImpl.adaptTo(SlingHttpServletRequestImpl.java:89)
    at org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper.adaptTo(SlingHttpServletRequestWrapper.java:148) [org.apache.sling.api:2.22.0.B002]
    at org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper.adaptTo(SlingHttpServletRequestWrapper.java:148) [org.apache.sling.api:2.22.0.B002]
    at org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper.adaptTo(SlingHttpServletRequestWrapper.java:148) [org.apache.sling.api:2.22.0.B002]
    at org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper.adaptTo(SlingHttpServletRequestWrapper.java:148) [org.apache.sling.api:2.22.0.B002]
    at org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper.adaptTo(SlingHttpServletRequestWrapper.java:148) [org.apache.sling.api:2.22.0.B002]
    at org.apache.jsp.apps.wcm_002dio.wcm.ui.granite.components.form.pathfield.columnview.columnview_jsp._jspService(columnview_jsp.java:147)
        ...
Caused by: java.lang.UnsupportedOperationException: null
    at io.wcm.wcm.ui.granite.pathfield.impl.util.DummyJspWriter.write(DummyJspWriter.java:166) [io.wcm.wcm.ui.granite:1.9.14]
    at java.base/java.io.Writer.write(Writer.java:290)
    at java.base/java.io.PrintWriter.write(PrintWriter.java:542)
    at java.base/java.io.PrintWriter.write(PrintWriter.java:559)
    at com.adobe.acs.tools.wcm.debug.SlingComponentDebugFilter.filterResponse(SlingComponentDebugFilter.java:132) [com.adobe.acs.acs-aem-tools-bundle:1.0.2]
    at com.adobe.acs.tools.wcm.debug.SlingComponentDebugFilter.doFilter(SlingComponentDebugFilter.java:104) [com.adobe.acs.acs-aem-tools-bundle:1.0.2]
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:138)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:78)
        ...
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:84)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:283)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:323)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:211)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:104)
    at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:516)
    at com.adobe.granite.ui.components.impl.SlingIncludeObjectFactory.get(SlingIncludeObjectFactory.java:118) [com.adobe.granite.ui.commons:5.10.15.CQ650-B0014]
    at com.adobe.granite.ui.components.impl.BaseComponentHelper.asDataSource(BaseComponentHelper.java:486) [com.adobe.granite.ui.commons:5.10.15.CQ650-B0014]
    at com.adobe.granite.ui.components.ComponentHelper.asDataSource(ComponentHelper.java:429) [com.adobe.granite.ui.commons:5.10.15.CQ650-B0014]
    at io.wcm.wcm.ui.granite.components.pathfield.ColumnView.getDataSource(ColumnView.java:210) [io.wcm.wcm.ui.granite:1.9.14]
    at io.wcm.wcm.ui.granite.components.pathfield.ColumnView.activate(ColumnView.java:143) [io.wcm.wcm.ui.granite:1.9.14]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.apache.sling.models.impl.ModelAdapterFactory.invokePostConstruct(ModelAdapterFactory.java:962) [org.apache.sling.models.impl:1.4.16.B0002]
    at org.apache.sling.models.impl.ModelAdapterFactory.createObject(ModelAdapterFactory.java:761) [org.apache.sling.models.impl:1.4.16.B0002]
    ... 357 common frames omitted

Seems to be an edge-case, but it would be nice to fix it nonetheless. :)

stefanseifert commented 8 months ago

yes, this is rather obscure - but i've provided PR #9 which should fix the problem. can you give it a try?

henrykuijpers commented 8 months ago

In case of the ACS AEM Commons filter, it actually puts useful data there, isn't it possible to forward that data to the original writer?

stefanseifert commented 8 months ago

you're right - please give a try with alternative PR #10

stefanseifert commented 7 months ago

@henrykuijpers can you take a look at the new PR #10?

henrykuijpers commented 7 months ago

Sorry, yes, this is working well for us! Thanks!