Error with directcomand for XApplication 313 with variable

I got an error when using direct command

<bdm:directcommand type=“query” document=“searchList” arg="/myDoc[Field1~=’${tmpQuery$}’ or Field2~=’${tmpQuery$}’]" />

The error message as follows
2002-08-20 16:10:14 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
javax.servlet.ServletException: No looping variable assignments allowed! Current sequence until loop detected: (tmpQuery)(tmpQuery)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:463)
at org.apache.jsp.list$jsp._jspService(list$jsp.java:1560)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at hkul.jsp.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)
----- Root Cause -----
XJspException:
id = 245 arg[0] = (tmpQuery)(tmpQuery)
at com.softwareag.xtools.xapplication.plugin.VariablesHandler.replaceVariables(VariablesHandler.java:337)
at com.softwareag.xtools.xapplication.plugin.VariablesHandler.evaluatingReplace(VariablesHandler.java:236)
at com.softwareag.xtools.xapplication.plugin.StandardWorkspacePlugin.queryDocuments(StandardWorkspacePlugin.java:341)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.softwareag.xtools.xapplication.plugin.Action.invoke(Action.java:180)
at com.softwareag.xtools.xapplication.plugin.Dispatcher.execute(Dispatcher.java:158)
at com.softwareag.xtools.xapplication.jsp.SessionContext.processWorkspaceAction(SessionContext.java:389)
at com.softwareag.xtools.xapplication.jsp.taglib.DirectCommandTag.processAction(DirectCommandTag.java:192)
at com.softwareag.xtools.xapplication.jsp.taglib.CommandTag.doAfterBodyCore(CommandTag.java:122)
at com.softwareag.xtools.xapplication.jsp.JspTag.doAfterBody(JspTag.java:188)
at org.apache.jsp.list$jsp._jspService(list$jsp.java:254)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:202)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at hkul.jsp.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:536)

Thanks.

[This message was edited by Christian Freytag on 21 Mar 2003 at 09:03.]

Hi,

indeed it’s a bug.
For the moment we can not offer you a perfect solution, but a quick workaround:

Instead of using a certain variable - with it’s value - more often within an other variable/expression, you need to define different variables names for each occurrence of the former variables/values.

Examples:

Previous:

<BR><bdm:setvar name="tmpQuery" value="something"/><BR><bdm:directcommand type="query" document="searchList" arg="/myDoc[Field1~='${tmpQuery$}' or Field2~='${tmpQuery$}']" /><BR></pre><BR><BR>Workaround:<BR><BR><pre class="ip-ubbcode-code-pre"><BR><bdm:setvar name="tmpQuery" value="something"/><BR><bdm:setvar name="tmpQuery2" value="something"/><BR><bdm:directcommand type="query" document="searchList" arg="/myDoc[Field1~='${tmpQuery$}' or Field2~='${tmpQuery2$}']" /><BR>



If ‘tmpQuery’ repesents an input-field in your JavaServer Page and therefore it is not defined by using ‘setvar’, you need to
duplicate it too, e.g. using Java Script.

OK, this seems not convenient, but I hope it will help you right now.

Cheers
Thorsten

[This message was edited by Thorsten Raab on 20 Aug 2002 at 10:27.]

Hi,

I attached a zip file containing to classes, which should solve your problem.

Would you please testing it? Thank you.

With this solution should be able to use the same variable more then once within an expression.

The following lines show how to install:

Installation:


1. Setting up the new classes within Tamino X-Application
2. Integrating the new classes into an Existing Web Application

Ad 1. Setting up the new classes within Tamino X-Application

Important Recommendation:
Create a backup copy of your Tamino X-Application source folder because changes you have previously made may be overwritten, and that you still have the opportunity to reject the modifications.

Unzip the file in your Tamino X-Application environment on top level.

Execute the command script build.cmd to rebuild Tamino X-Application.

Execute the command script build examples.jsp to rebuild the JSP examples.

Execute the command script build demos.jsp to rebuild the JSP demos.

Execute the command script build generator to rebuild the Tamino X-Application Generator.

Tip:
Delete the content of your Tomcat work directory to prevent irritations concerning Tomcat.

Ad 2. Integrating the new classes into an Existing Web Application

Proceed with the steps as described in the above section Setting up the new classes within Tamino X-Application.

Copy the file xapplication\lib\debug\xapplication.jar into the directory yourWebApplication\Web-Inf\lib\xapplication.jar.


Hope this will help you

Bye
Thorsten
xapplication_313_variables.zip (5.91 KB)

Hello,

this solution is part of X-Application 4.1.1.

Bye,
Christian.