Issue with the Moqui Wiki Servicies (In rebuilding wiki screen using Quasar)

I already have a Simple Screen wiki page. For example, refer to the below link.

Wiki spaces: Webroot - Login
Wiki detail: Webroot - Login

I am trying to rebuild this screen and the wiki detail screen in Quasar. For the new page, I want to use the services written in WikiServices.xml file which is located at “framework/service/org/moqui/impl” location.

Basically I want the API which returns me the wiki space content. So I thought of using the “WikiPageInfo” or “WikiPageInfoById” service.

I am logging in using the John Doe user and when I am calling the above-mentioned APIs, it is giving me the below issue.

com.fasterxml.jackson.databind.JsonMappingException: User john.doe is not authorized for View on Entity moqui.resource.DbResourceFileHistory (through reference chain: java.util.HashMap["pageReference"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"])

Please help me resolve the above issue.

Basically, my new page will have an almost similar structure to Moqui wiki. Tree on the left-hand side for pages and content in the main section. To build the tree on the left-hand side section, I am thinking to use the below API. Please correct me if I am wrong.

UserSpaceWikiPages present in “WikiServices.xml”.

Please let me know if my approach is correct and please help me resolve above issues.

Any issues would be greatly appreciated.

Thank you,
Mayank Patel

Which version of Moqui are you using? IIRC there was an authorization change related to DbResource a while back (more specifically to disable authz checks in some of the DbResource ResourceReference code).

More generally to track this down we’d need to review how you are calling these services from the client (make sure session cookie and session token are passed, etc), how you are calling services in the server (screen transition, REST API XML file, etc), and what the authorization config is like (ArtifactAuthz). There may be more, but those are the most direct relevant bits that come to mind.

I have written the REST API below.

<resource name="getWikiPageInfoById">
        <method type="get"><service name="org.moqui.impl.WikiServices.get#WikiPageInfoById"/>. 
        </method>
</resource>

From the “.qvue” file, I am calling this API like below.

var allParams = $.extend({ wikiPageId:'zzwrt_client',
                moquiSessionToken:$("#confMoquiSessionToken").val() }, {});
          $.ajax({ type:'GET', dataType:'json', url: "/rest/s1/wm/getWikiPageInfoById", headers:{Accept:'application/json'}, data:allParams,
              error:moqui.handleAjaxError, success:function(resp) {
                  self.wiki_space_list = resp.spaceList;
              }
          });

Please find the specifications below

  • Moqui Framework version 3.0.0
  • Java 11.0.15

I am passing the Moqui session token “moquiSessionToken” in the header. The same set of headers is working for getting page tree information in API “UserSpaceWikiPages” but not working for API “WikiPageInfoById”.

Please find the stack trace below.

WARN 280603381-68 .moqui.i.c.ArtifactExecutionFacadeImpl Artifact authorization failed: User john.doe is not authorized for View on Entity moqui.resource.DbResourceFileHistory
Current artifact info: [name:'moqui.resource.DbResourceFileHistory', type:'AT_ENTITY', action:'AUTHZA_VIEW', required: true, granted:false, user:'null', authz:'null', authAction:'null', inheritable:false, runningTime:0', txId:null]
Current artifact stack:
[name:'component://webroot/screen/webroot/rest.xml/s1', type:'AT_XML_SCREEN_TRANS', action:'AUTHZA_VIEW', required: false, granted:false, user:'null', authz:'null', authAction:'null', inheritable:false, runningTime:0', txId:28]
[name:'component://webroot/screen/webroot/rest.xml', type:'AT_XML_SCREEN', action:'AUTHZA_VIEW', required: false, granted:false, user:'null', authz:'null', authAction:'null', inheritable:false, runningTime:0', txId:28]
[name:'component://webroot/screen/webroot.xml', type:'AT_XML_SCREEN', action:'AUTHZA_VIEW', required: false, granted:false, user:'null', authz:'null', authAction:'null', inheritable:false, runningTime:0', txId:28]
22:48:56.944  WARN 280603381-68              o.moqui.i.c.WebFacadeImpl Error thrown in Service REST API (500): com.fasterxml.jackson.databind.JsonMappingException: User john.doe is not authorized for View on Entity moqui.resource.DbResourceFileHistory (through reference chain: java.util.HashMap["pageReference"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"])
com.fasterxml.jackson.databind.JsonMappingException: User john.doe is not authorized for View on Entity moqui.resource.DbResourceFileHistory (through reference chain: java.util.HashMap["pageReference"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"])
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:392) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:351) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:316) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:782) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:808) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:764) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:720) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:35) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4568) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3821) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at org.moqui.impl.context.WebFacadeImpl.sendJsonResponseInternal(WebFacadeImpl.groovy:712) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.context.WebFacadeImpl.sendJsonResponse(WebFacadeImpl.groovy:675) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.context.WebFacadeImpl.handleServiceRestCall(WebFacadeImpl.groovy:1101) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.context.WebFacade$handleServiceRestCall$0.call(Unknown Source) ~[?:?]
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[moqui_temp7664012221786799732WEB-INF_lib_groovy-3.0.9.jar.:3.0.9]
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) ~[moqui_temp7664012221786799732WEB-INF_lib_groovy-3.0.9.jar.:3.0.9]
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139) ~[moqui_temp7664012221786799732WEB-INF_lib_groovy-3.0.9.jar.:3.0.9]
	at component___webroot_screen_webroot_rest_xml_transition_s1_actions.run(component___webroot_screen_webroot_rest_xml_transition_s1_actions:8) ~[?:?]
	at org.moqui.impl.actions.XmlAction.run(XmlAction.java:67) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenDefinition$TransitionItem.run(ScreenDefinition.groovy:987) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:749) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:745) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:454) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:170) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.webapp.MoquiServlet.service(MoquiServlet.groovy:118) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) ~[moqui_temp1884441722353780067WEB-INF_lib_javax.servlet-api-4.0.1.jar.:4.0.1]
	at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1410) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1630) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:170) ~[moqui_temp16630471860013520900execlib_websocket-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1600) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.moqui.impl.webapp.ElasticRequestLogFilter.doFilter(ElasticRequestLogFilter.groovy:110) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1600) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:506) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578) ~[moqui_temp11290260822798419691execlib_jetty-security-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1571) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1378) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:463) ~[moqui_temp12536653258790161165execlib_jetty-servlet-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1544) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1300) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:717) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.Server.handle(Server.java:562) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:505) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:762) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:497) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282) ~[moqui_temp17774993586448775592execlib_jetty-server-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319) ~[moqui_temp10082043518030888000WEB-INF_lib_jetty-io-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100) ~[moqui_temp10082043518030888000WEB-INF_lib_jetty-io-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53) ~[moqui_temp10082043518030888000WEB-INF_lib_jetty-io-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:412) ~[moqui_temp8319158251517742005WEB-INF_lib_jetty-util-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:381) ~[moqui_temp8319158251517742005WEB-INF_lib_jetty-util-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:268) ~[moqui_temp8319158251517742005WEB-INF_lib_jetty-util-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.lambda$new$0(AdaptiveExecutionStrategy.java:138) ~[moqui_temp8319158251517742005WEB-INF_lib_jetty-util-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:407) ~[moqui_temp8319158251517742005WEB-INF_lib_jetty-util-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894) ~[moqui_temp8319158251517742005WEB-INF_lib_jetty-util-10.0.9.jar.:10.0.9]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038) ~[moqui_temp8319158251517742005WEB-INF_lib_jetty-util-10.0.9.jar.:10.0.9]
	at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: org.moqui.context.ArtifactAuthorizationException: User john.doe is not authorized for View on Entity moqui.resource.DbResourceFileHistory
	at org.moqui.impl.context.ArtifactExecutionFacadeImpl.pushInternal(ArtifactExecutionFacadeImpl.groovy:97) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.entity.EntityFindBase.one(EntityFindBase.groovy:717) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.context.reference.DbResourceReference.getVersion(DbResourceReference.groovy:307) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.context.reference.DbResourceReference.getCurrentVersion(DbResourceReference.groovy:313) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:808) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:764) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:720) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:35) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4568) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3821) ~[moqui_temp15101864355248074568WEB-INF_lib_jackson-databind-2.13.3.jar.:2.13.3]
	at org.moqui.impl.context.WebFacadeImpl.sendJsonResponseInternal(WebFacadeImpl.groovy:712) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.context.WebFacadeImpl.sendJsonResponse(WebFacadeImpl.groovy:675) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.context.WebFacadeImpl.handleServiceRestCall(WebFacadeImpl.groovy:1101) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at component___webroot_screen_webroot_rest_xml_transition_s1_actions.run(component___webroot_screen_webroot_rest_xml_transition_s1_actions:8) ~[?:?]
	at org.moqui.impl.actions.XmlAction.run(XmlAction.java:67) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenDefinition$TransitionItem.run(ScreenDefinition.groovy:987) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:749) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:745) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:454) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:170) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at org.moqui.impl.webapp.MoquiServlet.service(MoquiServlet.groovy:118) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) ~[moqui_temp1884441722353780067WEB-INF_lib_javax.servlet-api-4.0.1.jar.:4.0.1]
	at org.moqui.impl.webapp.ElasticRequestLogFilter.doFilter(ElasticRequestLogFilter.groovy:110) ~[moqui_temp13352039190518385678WEB-INF_lib_moqui-framework-3.0.0.jar.:3.0.0]

There may be other authz related issues as I didn’t try to trace through what might be happening end-to-end, but for the DbResourceReference issue I disabled authz checks for all entity and service operations where it was not already disabled in this commit:

The reasoning is the DbResource is like a filesystem and code above it should manage authz and access controls just like would be done for a file. The downside to this is as a developer you need to keep that in mind, ie that DbResource operations will be done like filesystem operations regardless of user authorization so other things above it need to protect that. In short that usually means watch public/open endpoints to make sure that it’s really okay that anyone can call those at any time with any parameters.

1 Like

Instead of this approach for getting the current session token the better way is to use the value in the moqui.webrootVue object, like: moqui.webrootVue.moquiSessionToken or in a Vue component this.$root.moquiSessionToken (two ways of getting to the same JS object).

This value in the webrootVue object gets updated on re-login with the new code, the value in the original HTML from the server in $("#confMoquiSessionToken") is not update in the current code (it could be, but better to use the internal value to avoid dependency on the current way user and other data comes from the server in these hidden fields).

Hey,

I have upgraded the Moqui version. Also, I have used the session token as you suggested. Now the older error gone away and it is giving me the different error. I am trying to run the below API.

<resource name="getWikiPageInfoById">
    <method type="get"><service name="org.moqui.impl.WikiServices.get#WikiPageInfoById"/>. 
    </method>
</resource>

Please find below. Please let me know if I am doing anything wrong.

"com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: org.moqui.impl.context.reference.DbResourceReference[“currentVersion”]->org.moqui.resource.ResourceReference$Version[“ref”]->org.moqui.impl.context.reference.DbResourceReference[“currentVersion”]->org.moqui.resource.ResourceReference$Version[“ref”]->org.moqui.impl.context.reference.DbResourceReference[“currentVersion”]->org.moqui.resource.ResourceReference$Version[“ref”]->org.moqui.impl.context.reference.DbResourceReference[“currentVersion”]->org.moqui.resource.ResourceReference$Version[“ref”]->org.moqui.impl.context.reference.DbResourceReference[“currentVersion”]->org.moqui.resource.ResourceReference$Version[“ref”]->org.moqui.impl.context.reference.DbResourceReference[“currentVersion”]->org.moqui.resource.ResourceReference$Version[“ref”]->org.moqui.impl.context.reference.DbResourceReference[“currentVersion”]->org.moqui.resource.ResourceReference$Version[“ref”]->org.moqui.impl.context.reference.DbResourceReference[“currentVersion”]-

Sorry, this isn’t enough info for me to do anything with… maybe thinking of it in terms of steps to reproduce would help? In this case that could include parameters passed to the service, relevant DbResource* records (this is what the code is looking at in the DB), and generally a stack trace that isn’t a FULL stack trace is not all that helpful (especially for infinite recursion issues, also common that people miss “caused by” sections when looking at stack traces).

Please find the Payload below. Basically the query parameters to the GET request.

wikiPageId=zzwr_templates&moquiSessionToken=xxxxxxxtokenxxxxxxx

The caused by in stack trace is:

Caused by: java.lang.StackOverflowError

Full stack trace (Still truncated due to character limit).

Error thrown in Service REST API (500): com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"]->org.moqui.impl.context.reference.DbResourceReference["currentVersion"]->org.moqui.resource.ResourceReference$Version["ref"])
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:789) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]

Some more stack trace log around caused by

at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
Caused by: java.lang.StackOverflowError
	at org.moqui.impl.entity.EntityQueryBuilder.executeQuery(EntityQueryBuilder.java:148) ~[moqui_temp14109247488222407078WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
	at org.moqui.impl.entity.EntityFindImpl.oneExtended(EntityFindImpl.java:83) ~[moqui_temp14109247488222407078WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
	at org.moqui.impl.entity.EntityFindBase.oneInternal(EntityFindBase.groovy:941) ~[moqui_temp14109247488222407078WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
	at org.moqui.impl.entity.EntityFindBase.one(EntityFindBase.groovy:720) ~[moqui_temp14109247488222407078WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
	at org.moqui.impl.context.reference.DbResourceReference.getVersion(DbResourceReference.groovy:315) ~[moqui_temp14109247488222407078WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
	at org.moqui.impl.context.reference.DbResourceReference.getCurrentVersion(DbResourceReference.groovy:322) ~[moqui_temp14109247488222407078WEB-INF_lib_moqui-framework-3.1.0-rc1.jar.:3.1.0-rc1]
	at jdk.internal.reflect.GeneratedMethodAccessor120.invoke(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:774) ~[moqui_temp12349355297699635472WEB-INF_lib_jackson-databind-2.13.4.2.jar.:2.13.4.2]

What I have noticed is that the API which is performing some operation on the below entity is causing the issue.

org.moqui.content.ResourceReference

It looks like the problem is that when sending the service out parameters the serialization to JSON had an issue because Jackson Databind (used for serializing to JSON) tried to serialize the entire object graph referenced by the ResourceReference. To fix that, for stack overflow due to object graph loops and because Jackson doesn’t serialize a number of other objects (ie even if there are no object graph loops), I added a Jackson Databind serializer for all ResourceReference instances, just gets some basic data about the resource.

I tested this with one new wiki endpoints, and ended up playing with a little add on to the REST API functionality so that an id element has an allow-extra-path attribute just like a XML Screen, which is used in one of the new wiki endpoints (in moqui-framework) to get a published wiki page by its path with the path in the URL rather than in a parameter or something.

Those changes are now pushed to moqui-framework.

Hey, this resolved the issue. Thank you.

However, after making more progress, I came across one more problem. The issue happens when we create the new space with the wiki type as “html”. Then try to edit the page and save.

Please find steps to reproduce the issue. This is happening with Moqui Demo website as well.

  • Go to Webroot - Login link

  • Click New Space, give input, and for Wiki Type, select “html” and hit Create Space

  • Now click “View Pages” for newly created space

  • Hit Edit on Space Detail page, add some content and hit “Update Page”. It gives the below error.

“Cannot get property ‘jsoup’ on null object”

This issue is happening with “Wiki Type” as “html”. For “md”, it is working fine.

Please guide me on the resolution of the above mentioned issue.

I was able to reproduce this yesterday and committed a fix, was an issue with the wrong JSoup class being referenced… which is a problem with scripts that are only tested by running them (and in this case with a specific configuration option) vs compiled code which will at least catch invalid class names like this (even if Groovy sometimes, like this, gives you horrible error messages because when it can’t find the named class it treats it as an expression, ie as if ‘org’ in the FQCN is supposed to be a variable referring to an object with something called ‘jsoup’ in it, which doesn’t exist).

Anyway, the short story is a while back there was a trend of breaking code to avoid using certain combinations of characters that people consider offensive (ie conflating different word definitions to demonize words and people who use them). JSoup joined in that trend and changed the class name “Whitelist” to “Safelist”, which breaks everything using the class. Just like nearly all others who joined in with this trend, this change was not considered a breaking change or non-backward compatible and did not involve a major version bump.

For this particular case I caught the one in the ParameterInfo class but not in this wiki service which is the other main place that JSoup is used (the service disables the ServiceFacade html filter/clean so it can do it conditionally based on the ProductStore setting). The commit is now in there that fixes this (just changes the class name).

3 Likes

Hey, thanks for fixing the issue. Now it is working fine. Took a pull and it is working fine.