Something wrong with processPositionExpression method of Mod

Hello,
I always have problems with jsp pages containing loops and ElementAction insert buttons.
Although I have a registered loop in the page I recieve exceptions.
I think there are some serious problems with the processPositionExpression method of ModuleTag. It causes exceptions very often and unpredictabley. It sometimes work fine sometimes causes exception.

Here is an example of the exception I got.
I am sending my xml schema and the jsp page as an attacment. Can someone tell me why I get this exception ?

Dear Harald and Christian : I would be glad if you check the processPositionExpression method of ModuleTag.

Hata mesaji: 999: Application Error! Please contact the X-Application-Team.
Yardim mesaji: Please send a copy of the stack trace and of the error page to the development team in order to solve this problem immediately.
Hata Turu: ApplicationException
Hata Bilgisi :


ApplicationException: 999: Application Error! Please contact the X-Application-Team.
com.softwareag.xtools.xapplication.common.AssertionFailed
no registered page for cursor with name ‘/Hasta/Vaka/Yatis/Ameliyat/Form/t0’ within expression ‘/Hasta/Vaka,0,/Hasta/Vaka/Yatis,0,/Hasta/Vaka/Yatis/Ameliyat,0,/Hasta/Vaka/Yatis/Ameliyat/Form/t0,0’
at com.softwareag.xtools.xapplication.jsp.taglib.ModuleTag.processPositionExpression(ModuleTag.java:874)
at com.softwareag.xtools.xapplication.jsp.taglib.ModuleTag.processInsertAction(ModuleTag.java:684)
at com.softwareag.xtools.xapplication.jsp.taglib.ModuleTag.processElementAction(ModuleTag.java:634)
at com.softwareag.xtools.xapplication.jsp.taglib.ModuleTag.doStartTagCore(ModuleTag.java:118)
at hitit.HModuleTag.doStartTagCore(HModuleTag.java:57)
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(JspTag.java:120)
at _form.mDeneme_1._jspService(mDeneme_1.java:188)
at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
at org.apache.tomcat.core.Handler.invoke(Unknown Source)
at org.apache.tomcat.core.Handler.service(Unknown Source)
at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
at org.apache.tomcat.core.ContextManager.service(Unknown Source)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:484)
tsd.zip (4.03 KB)

Hello,

I checked you JSP mDeneme.jsp. It has 4 nested loops. The error is caused by the elementaction of type insert. I guess that the problem occurs because


  • the element action for the loop of the fourth level is used out side the third loop level.
  • the remove action within the 4 level refers to a non-existing loop.


I did not run your page, but I hope the following corrections will solve your problem. I marked it with comments.

<BR><BR>...<BR><bdm:loop module="bdProp" select="Form" iterate="t0" base="/Hasta/Vaka/Yatis/Ameliyat" targetbase="/Hasta/Vaka/Yatis/Ameliyat/Form/t0" document="currentHasta">	<BR>      <tr> <BR>      <td><font> <BR>        <bdm:display select="$POS"/><BR>        . t0</font> <BR>        <!-- I changed the attribute base --><BR>        <bdm:elementaction type="remove" form="form1" base="/Hasta/Vaka/Yatis/Ameliyat/Form/t0"><BR>        <a href="javascript:document.forms['form1'].action='mDeneme.jsp';document.forms['form1'].submit();"> <BR>        <img src="../img/delete.gif"  border="0"/> </a> <BR>        </bdm:elementaction><BR>      </td><BR><td><bdm:HEdit form="Deneme" select="hh"><input type="text"/></bdm:HEdit></td><BR><BR>    </tr><BR>    </bdm:loop><BR>  </table><BR>  <!&&ENDT0&&-->    <BR>  <BR>  <!-- I moved this code into the third level loop --><BR>  <!&&STARTET0&&--><BR>  <bdm:elementaction type="insert" form="form1" base="/Hasta/Vaka/Yatis/Ameliyat/Form/t0"><BR>  <a href="javascript:document.forms['form1'].action='mDeneme.jsp';document.forms['form1'].submit();"> <BR>  <img src="../img/addButton.gif"  border="0"/> </a> <BR>  </bdm:elementaction><BR>  t0 <BR>  <!&&ENDET0&&--><BR><BR>  </bdm:loop><BR>  </bdm:loop><BR>  </bdm:loop><BR><BR>...<BR>



Remark: You can use the insert action also inside a loop. It inserts an element before the current element. Outside the loop, it appends a new entry behind the last element which is displayed.

Bye,
Christian.
X-Application Version: 3.1.2, 3.1.1
Tamino Version : 3.1.1
Platform : NT, Win2k, Solaris, …
WebContainer : Tomcat 3.3
JDK Version : 1.3.1

Dear Christian,
I have made the changes you mentioned in my jsp file but it did not solve my problem.
I still get the same exception.
Can you think of any other reasons?
Thanks for your interest.

Hi Christian,
This is another problem I have usually.
When I try to open this view page (vPersonel) I recieve the following exception.
I am sending the page and the schema definition as an attachment.
Can you think of its reason ?

Ps: We are going to install our project to our customer in a few weeks time and I need to solve these loop and node insertion problems ASAP.
I would be glad if you can check their reasons.

ApplicationException: 999: Application Error! Please contact the X-Application-Team.
com.softwareag.xtools.xapplication.common.PreconditionViolation
the node ‘/Personel’ does not contain a sub-node identified by the content ‘Role’
at com.softwareag.xtools.xapplication.businessdocument.BusinessNodeImpl.iterate(BusinessNodeImpl.java:645)
at com.softwareag.xtools.xapplication.jsp.taglib.LoopTag.getIterationNode(LoopTag.java:506)
at com.softwareag.xtools.xapplication.jsp.taglib.LoopTag.createNewPage(LoopTag.java:433)
at com.softwareag.xtools.xapplication.jsp.taglib.LoopTag.doStartTagCore(LoopTag.java:183)
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(JspTag.java:120)
at vPersonel_3._jspService(vPersonel_3.java:925)
at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
at org.apache.tomcat.core.Handler.invoke(Unknown Source)
at org.apache.tomcat.core.Handler.service(Unknown Source)
at org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
at org.apache.tomcat.core.ContextManager.internalService(Unknown Source)
at org.apache.tomcat.core.ContextManager.service(Unknown Source)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:484)
X-Application Version: 3.1.2, 3.1.1
Tamino Version : 3.1.1
Platform : NT, Win2k, Solaris, …
WebContainer : Tomcat 3.3
JDK Version : 1.3.1
personel.zip (2.39 KB)

Hello,

I checked your application by using the X-Application’s Generator. It created the jsp pages. They contain the loop for ‘Role’ as you use it within your page.

I checked create, display and modify scenario without receiving your error message.

Then, I invoked your page (after eliminating bdm:HCombo, because I have not the source for this tag) with the following URL

http://localhost:8080/Personel/vPersonel.jsp?:action=read&:docid=/Personel[@ino:id=1]&:document=currentPersonel

(The document with ino:id=1 I created before using the generated application)

It also runs without exception.

To find out, what is wrong with our environment:


  • Check your application by generating a new temporary application with the generator. It is very fast. Use the existin schema within you database.

  • Check your schema stored within Tamino. According to the error message, the application uses a schema where Role is not defined as a sub-element of Personel.


I hope with this two steps you find out the reason for your problem.

Bye,
Christian.

Hello,

I used your schema Hasta.tsd and generated a small create page (used the generator, edited structure file, restarted generation). The page contains the four nested loops as your file mDeneme.jsp. When creating the document and inserting new nodes for Form/t0, I could not reproduce your exception.

If you have changed the code as described, I have no idea why the exception occurs. The exception tells us that the innermost cursor is not available. This occurs if the innermost loop tag is not executed. This occurs if the third level loop (/Hasta/Vaka/Yatis/Ameliyat) is empty. Since you moved the insert element action into this loop, the action would not be displayed in this case.

Strange!

Did you use the Back button?

If you click back to the same page where the insert button exists, but the current document on server side has no Ameliyat element then this exception could occur.

Tips I could give you:


  • Use the diagnose mode (see documentation) and check the tag structure of your pages.

  • Send us the complete application and describe us which links / buttons we have how often to click to reproduce your exception. If you don?t like to post the application to the community. You can send it to TaminoCommunity@softwareag.com.


Bye,
Christian.