Home Forums Development Sorting on columns throws unexpected error

Viewing 3 reply threads
  • Author
    Posts
    • #15795
      Mark De CarvalhoMark De Carvalho
      Participant

      <p>Here is the trace I get for 2 columns where the metadata validates fine but in runtime we get these errors:</p><p> </p><p>; 13:25:27,094 ERROR [GenericServer] (http-nio-7080-exec-6) Request(namespace=null, version=null, async=false, commit=true, locale=en_CA, timeZone=America/New_York)<br />invocations(2):<br />TO<SysReader’read,, @1498383936>(<br />associations=(),<br />offset=0,<br />orderBy=(((@ touchStatusCaption) . #t)),<br />where=(= (@ userPerson) (user-person)),<br />class=EntityTouch,<br />parents=(),<br />attributes=((touchType (currentLocalization caption)) nextTouchDate lastName firstName (entity (serviceLevel (currentLocalization caption))) fullName (tier caption) (touchType updatable) (touchType caption) (entityTouchTypeDate (entityTouchTypeInterval updatable)) (entityTouchTypeDate (entityTouchTypeInterval intervalCaption)) touchStatusCaption (entity (serviceLevel updatable)) (entity (serviceLevel caption)) displayedNextTouchDate lastTouchDate daysUntilTouch),<br />count=10<br />)<br />TO<SysReader’totalCount,, @1707940275>(<br />class=EntityTouch,<br />parents=(collection<br />REF:TO<SysReader’read,, @1498383936><br />)<br />)<br />filters(0):<br />correlator=()</p><p>; 13:25:27,094 ERROR [GenericServer] (http-nio-7080-exec-6) Server invocation exception<br />nexj.core.persistence.InvalidQueryException: The expression is not supported by the data source. (err.persistence.unsupportedExpression)<br />at nexj.core.persistence.Query.createOperator(Query.java:3128)<br />at nexj.core.persistence.Query$33.create(Query.java:1518)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$31.create(Query.java:1340)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$34.create(Query.java:1560)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$UnaryOperatorFactory.create(Query.java:7283)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$33.create(Query.java:1497)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$31.create(Query.java:1340)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query.addOrderBy(Query.java:4637)<br />at nexj.core.persistence.Query.createRead(Query.java:7202)<br />at nexj.core.runtime.sys.SysObject.read(SysObject.java:53)<br />at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)<br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<br />at java.lang.reflect.Method.invoke(Unknown Source)<br />at nexj.core.scripting.JavaAction.invoke(JavaAction.java:67)<br />at scheme.loop(syslibrary:scheme:1252)<br />at EntityTouch.read(attributes,where,orderBy,count,offset,xlock)(class:EntityTouch.read(attributes,where,orderBy,count,offset,xlock):1)<br />at Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock(class:Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock:6)<br />at —.—(—:0)<br />at nexj.core.scripting.Machine.invoke(Machine.java:828)<br />at nexj.core.meta.Event.invoke(Event.java:1631)<br />at nexj.core.meta.Metaclass.invoke(Metaclass.java:4274)<br />at nexj.core.runtime.sys.SysReader.read(SysReader.java:700)<br />at sun.reflect.GeneratedMethodAccessor297.invoke(Unknown Source)<br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<br />at java.lang.reflect.Method.invoke(Unknown Source)<br />at nexj.core.scripting.JavaAction.invoke(JavaAction.java:67)<br />at SysReader.read()(class:SysReader.read():1)<br />at —.—(—:0)<br />at nexj.core.scripting.Machine.invoke(Machine.java:776)<br />at nexj.core.meta.Event.invoke(Event.java:1614)<br />at nexj.core.rpc.GenericServer.invoke(GenericServer.java:588)<br />at nexj.core.rpc.http.RESTHTTPServer.invoke(RESTHTTPServer.java:463)<br />at nexj.core.rpc.http.GenericHTTPServer.invoke(GenericHTTPServer.java:1706)<br />at nexj.core.rpc.http.GenericHTTPServlet.service(GenericHTTPServlet.java:211)<br />at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />at nexj.core.rpc.http.GZipFilter.doFilter(GZipFilter.java:146)<br />at nexj.core.rpc.http.GZipFilter.doFilter(GZipFilter.java:109)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />at nexj.core.rpc.http.session.SessionManager.intercept(SessionManager.java:1385)<br />at nexj.core.rpc.http.session.PersistenceFilter.doFilter(PersistenceFilter.java:55)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />at nexj.core.rpc.http.PartitionOverrideFilter.doFilter(PartitionOverrideFilter.java:28)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />at nexj.core.rpc.http.LoggerFilter.doFilter(LoggerFilter.java:54)<br />at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)<br />at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)<br />at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)<br />at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)<br />at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)<br />at nexj.core.container.platform.teee.JNDIContextValve.invoke(JNDIContextValve.java:67)<br />at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)<br />at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)<br />at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)<br />at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)<br />at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)<br />at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)<br />at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)<br />at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)<br />at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)<br />at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)<br />at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)<br />at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)<br />at java.lang.Thread.run(Unknown Source)<br />Caused by: nexj.core.scripting.ScriptingException: Undefined variable “begin”. (err.scripting.undefVar)<br />at nexj.core.scripting.GlobalEnvironment.getVariable(GlobalEnvironment.java:393)<br />at nexj.core.scripting.GlobalEnvironment.getVariable(GlobalEnvironment.java:390)<br />at nexj.core.scripting.Machine.eval(Machine.java:1437)<br />at nexj.core.persistence.Query.createOperator(Query.java:3089)<br />at nexj.core.persistence.Query$33.create(Query.java:1518)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$31.create(Query.java:1340)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$34.create(Query.java:1560)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$UnaryOperatorFactory.create(Query.java:7283)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$33.create(Query.java:1497)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query$31.create(Query.java:1340)<br />at nexj.core.persistence.Query.createOperator(Query.java:3054)<br />at nexj.core.persistence.Query.addOrderBy(Query.java:4637)<br />at nexj.core.persistence.Query.createRead(Query.java:7202)<br />at nexj.core.runtime.sys.SysObject.read(SysObject.java:53)<br />at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)<br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<br />at java.lang.reflect.Method.invoke(Unknown Source)<br />at nexj.core.scripting.JavaAction.invoke(JavaAction.java:67)<br />at EntityTouch.read(attributes,where,orderBy,count,offset,xlock)(class:EntityTouch.read(attributes,where,orderBy,count,offset,xlock):1)<br />at Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock(class:Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock:6)<br />at —.—(—:0)<br />at nexj.core.scripting.Machine.invoke(Machine.java:828)<br />at nexj.core.meta.Event.invoke(Event.java:1631)<br />at nexj.core.meta.Metaclass.invoke(Metaclass.java:4274)<br />at nexj.core.runtime.sys.SysReader.read(SysReader.java:700)<br />at sun.reflect.GeneratedMethodAccessor297.invoke(Unknown Source)<br />at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<br />at java.lang.reflect.Method.invoke(Unknown Source)<br />at nexj.core.scripting.JavaAction.invoke(JavaAction.java:67)<br />at scheme.loop(syslibrary:scheme:1252)<br />at EntityTouch.read(attributes,where,orderBy,count,offset,xlock)(class:EntityTouch.read(attributes,where,orderBy,count,offset,xlock):1)<br />at Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock(class:Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock:6)<br />… 41 more<br />; 13:25:27,101 ERROR [JSONHTTPServer] (http-nio-7080-exec-6) Error processing the JSON request (reference id 2ds6qa)</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p>invocations(2):<br />TO<SysReader’read,, @390981633>(<br />associations=(),<br />offset=0,<br />orderBy=(((@ daysUntilTouch) . #t)),<br />where=(= (@ userPerson) (user-person)),<br />class=EntityTouch,<br />parents=(),<br />attributes=(touchType nextTouchDate fullName (tier caption) (touchType updatable) (touchType caption) (entityTouchTypeDate (entityTouchTypeInterval updatable)) (entityTouchTypeDate (entityTouchTypeInterval intervalCaption)) touchStatusCaption (entity (serviceLevel updatable)) (entity (serviceLevel caption)) displayedNextTouchDate lastTouchDate daysUntilTouch)<br />)<br />TO<SysReader’totalCount,, @1746345662>(<br />class=EntityTouch,<br />parents=(collection<br />REF:TO<SysReader’read,, @390981633><br />)<br />)<br />filters(0):<br />correlator=()<br />Caused by: nexj.core.scripting.ScriptingException: Undefined variable “begin”. (err.scripting.undefVar)<br />nexj.core.persistence.InvalidQueryException: The expression is not supported by the data source. (err.persistence.unsupportedExpression)</p><p> </p>

      0
    • #15803

      Hi Mark,

      Can you provide us more details? Which attribute you are sorting on? Whats the definition of the attribute in .metadata? How is it persisted etc?

       

      Also in the bottom of the stack trace i also see below error. Can you please confirm that is not the root cause?

      Caused by: nexj.core.scripting.ScriptingException: Undefined variable “begin”. (err.scripting.undefVar)

      0
    • #16122
      Mark De CarvalhoMark De Carvalho
      Participant

      Sorry looks like my original post got mangled, lets try again:

       

      This is for sorting touchStatusCaption and daysUntilTouch (both partial traces below). The Undefined variable error only shows when sorting on those columns, I believe that is part of root case but its framework error, nothing we did.

       

      ORIGINAL POST:

      Here is the trace I get for 2 columns where the metadata validates fine but in runtime we get these errors:

       

      ; 13:25:27,094 ERROR [GenericServer] (http-nio-7080-exec-6) Request(namespace=null, version=null, async=false, commit=true, locale=en_CA, timeZone=America/New_York)
      invocations(2):
      TO<sysreader’read,, @1498383936=””>(
      associations=(),
      offset=0,
      orderBy=(((@ touchStatusCaption) . #t)),
      where=(= (@ userPerson) (user-person)),
      class=EntityTouch,
      parents=(),
      attributes=((touchType (currentLocalization caption)) nextTouchDate lastName firstName (entity (serviceLevel (currentLocalization caption))) fullName (tier caption) (touchType updatable) (touchType caption) (entityTouchTypeDate (entityTouchTypeInterval updatable)) (entityTouchTypeDate (entityTouchTypeInterval intervalCaption)) touchStatusCaption (entity (serviceLevel updatable)) (entity (serviceLevel caption)) displayedNextTouchDate lastTouchDate daysUntilTouch),
      count=10
      )
      TO<sysreader’totalcount,, @1707940275=””>(
      class=EntityTouch,
      parents=(collection
      REF:TO<sysreader’read,, @1498383936=””>
      )
      )
      filters(0):
      correlator=()</sysreader’read,,></sysreader’totalcount,,></sysreader’read,,>

      ; 13:25:27,094 ERROR [GenericServer] (http-nio-7080-exec-6) Server invocation exception
      nexj.core.persistence.InvalidQueryException: The expression is not supported by the data source. (err.persistence.unsupportedExpression)
      at nexj.core.persistence.Query.createOperator(Query.java:3128)
      at nexj.core.persistence.Query$33.create(Query.java:1518)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$31.create(Query.java:1340)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$34.create(Query.java:1560)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$UnaryOperatorFactory.create(Query.java:7283)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$33.create(Query.java:1497)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$31.create(Query.java:1340)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query.addOrderBy(Query.java:4637)
      at nexj.core.persistence.Query.createRead(Query.java:7202)
      at nexj.core.runtime.sys.SysObject.read(SysObject.java:53)
      at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at nexj.core.scripting.JavaAction.invoke(JavaAction.java:67)
      at scheme.loop(syslibrary:scheme:1252)
      at EntityTouch.read(attributes,where,orderBy,count,offset,xlock)(class:EntityTouch.read(attributes,where,orderBy,count,offset,xlock):1)
      at Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock(class:Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock:6)
      at —.—(—:0)
      at nexj.core.scripting.Machine.invoke(Machine.java:828)
      at nexj.core.meta.Event.invoke(Event.java:1631)
      at nexj.core.meta.Metaclass.invoke(Metaclass.java:4274)
      at nexj.core.runtime.sys.SysReader.read(SysReader.java:700)
      at sun.reflect.GeneratedMethodAccessor297.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at nexj.core.scripting.JavaAction.invoke(JavaAction.java:67)
      at SysReader.read()(class:SysReader.read():1)
      at —.—(—:0)
      at nexj.core.scripting.Machine.invoke(Machine.java:776)
      at nexj.core.meta.Event.invoke(Event.java:1614)
      at nexj.core.rpc.GenericServer.invoke(GenericServer.java:588)
      at nexj.core.rpc.http.RESTHTTPServer.invoke(RESTHTTPServer.java:463)
      at nexj.core.rpc.http.GenericHTTPServer.invoke(GenericHTTPServer.java:1706)
      at nexj.core.rpc.http.GenericHTTPServlet.service(GenericHTTPServlet.java:211)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at nexj.core.rpc.http.GZipFilter.doFilter(GZipFilter.java:146)
      at nexj.core.rpc.http.GZipFilter.doFilter(GZipFilter.java:109)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at nexj.core.rpc.http.session.SessionManager.intercept(SessionManager.java:1385)
      at nexj.core.rpc.http.session.PersistenceFilter.doFilter(PersistenceFilter.java:55)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at nexj.core.rpc.http.PartitionOverrideFilter.doFilter(PartitionOverrideFilter.java:28)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at nexj.core.rpc.http.LoggerFilter.doFilter(LoggerFilter.java:54)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)
      at nexj.core.container.platform.teee.JNDIContextValve.invoke(JNDIContextValve.java:67)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
      at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
      at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
      at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
      at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
      at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Unknown Source)
      Caused by: nexj.core.scripting.ScriptingException: Undefined variable “begin”. (err.scripting.undefVar)
      at nexj.core.scripting.GlobalEnvironment.getVariable(GlobalEnvironment.java:393)
      at nexj.core.scripting.GlobalEnvironment.getVariable(GlobalEnvironment.java:390)
      at nexj.core.scripting.Machine.eval(Machine.java:1437)
      at nexj.core.persistence.Query.createOperator(Query.java:3089)
      at nexj.core.persistence.Query$33.create(Query.java:1518)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$31.create(Query.java:1340)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$34.create(Query.java:1560)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$UnaryOperatorFactory.create(Query.java:7283)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$33.create(Query.java:1497)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query$31.create(Query.java:1340)
      at nexj.core.persistence.Query.createOperator(Query.java:3054)
      at nexj.core.persistence.Query.addOrderBy(Query.java:4637)
      at nexj.core.persistence.Query.createRead(Query.java:7202)
      at nexj.core.runtime.sys.SysObject.read(SysObject.java:53)
      at sun.reflect.GeneratedMethodAccessor131.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at nexj.core.scripting.JavaAction.invoke(JavaAction.java:67)
      at EntityTouch.read(attributes,where,orderBy,count,offset,xlock)(class:EntityTouch.read(attributes,where,orderBy,count,offset,xlock):1)
      at Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock(class:Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock:6)
      at —.—(—:0)
      at nexj.core.scripting.Machine.invoke(Machine.java:828)
      at nexj.core.meta.Event.invoke(Event.java:1631)
      at nexj.core.meta.Metaclass.invoke(Metaclass.java:4274)
      at nexj.core.runtime.sys.SysReader.read(SysReader.java:700)
      at sun.reflect.GeneratedMethodAccessor297.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at nexj.core.scripting.JavaAction.invoke(JavaAction.java:67)
      at scheme.loop(syslibrary:scheme:1252)
      at EntityTouch.read(attributes,where,orderBy,count,offset,xlock)(class:EntityTouch.read(attributes,where,orderBy,count,offset,xlock):1)
      at Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock(class:Object.read(attributes,where,orderBy,count,offset,xlock)$beginTransactionIfXLock:6)
      … 41 more
      ; 13:25:27,101 ERROR [JSONHTTPServer] (http-nio-7080-exec-6) Error processing the JSON request (reference id 2ds6qa)

       

       

       

       

       

       

      invocations(2):
      TO<sysreader’read,, @390981633=””>(
      associations=(),
      offset=0,
      orderBy=(((@ daysUntilTouch) . #t)),
      where=(= (@ userPerson) (user-person)),
      class=EntityTouch,
      parents=(),
      attributes=(touchType nextTouchDate fullName (tier caption) (touchType updatable) (touchType caption) (entityTouchTypeDate (entityTouchTypeInterval updatable)) (entityTouchTypeDate (entityTouchTypeInterval intervalCaption)) touchStatusCaption (entity (serviceLevel updatable)) (entity (serviceLevel caption)) displayedNextTouchDate lastTouchDate daysUntilTouch)
      )
      TO<sysreader’totalcount,, @1746345662=””>(
      class=EntityTouch,
      parents=(collection
      REF:TO<sysreader’read,, @390981633=””>
      )
      )
      filters(0):
      correlator=()
      Caused by: nexj.core.scripting.ScriptingException: Undefined variable “begin”. (err.scripting.undefVar)
      nexj.core.persistence.InvalidQueryException: The expression is not supported by the data source. (err.persistence.unsupportedExpression)</sysreader’read,,></sysreader’totalcount,,></sysreader’read,,>

      0
    • #16131
      Trevor BallTrevor Ball
      Participant

      These are both calculated attributes. While the framework will still try to sort by calculated attributes (which is why it doesn’t fail validation) the “expression is not supported by the data source” error indicates that the calculations for these attributes are too complex for the framework to interpret into an order-by clause.

      I think your main options would be to remove the sort or sort by other attributes instead, or alternatively to try to simplify the underlying calculations (presumably in new attributes in an augment). (For example, looking at touchStatusCaption, I believe from experience that using cond will not allow the attribute to be sorted by, but if you rewrite the calculation as a set of ifs, it probably would allow for it to be sorted by.)

      Another thing to keep in mind is performance. In particular, looking at daysUntilTouch I can see that even if you could rewrite that into an expression the framework could turn into an order-by clause, it would surely include some heavy date/time calculations. Instead, you might want to consider ordering by something else, such as nextTouchDate, which I would think would achieve the same result much more simply.

      0
Viewing 3 reply threads
  • You must be logged in to reply to this topic.