I have one application directory Hasta and have different jsp files in this directory to work on different schema’s.
All my schema’s are defined in the web.xml file.
Does the order of schema’s in this file differ ?
Since I get exceptions unless I work the jsp files in wrong order.
Can somebody help me about my problem?
The first jsp I call always works fine.
My web.xml file is the atached file.
Forexample if I run Hasta jsp first I recieve such an error when I try to use Personel Jsp :
XJspException:
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:798)
at com.softwareag.xtools.xapplication.jsp.taglib.LoopTag.getIterationNode(LoopTag.java:513)
at com.softwareag.xtools.xapplication.jsp.taglib.LoopTag.createNewPage(LoopTag.java:439)
at com.softwareag.xtools.xapplication.jsp.taglib.LoopTag.doStartTagCore(LoopTag.java:185)
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(JspTag.java:142)
at cPersonel_2._jspService(cPersonel_2.java:1019)
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)
If I run Personel jsp s first it works fine without problem
But this time the Servis jsp gives this exception at the search page :
XJspException:
com.softwareag.xtools.xapplication.common.PreconditionViolation
parent type node ‘element’ must be complex type
at com.softwareag.xtools.xapplication.businessdocument.Schema.lookupElement(Schema.java:503)
at com.softwareag.xtools.xapplication.businessdocument.PathFragment.isValidForOptionals(PathFragment.java:499)
at com.softwareag.xtools.xapplication.businessdocument.Path.isValidPathForOptionals(Path.java:316)
at com.softwareag.xtools.xapplication.businessdocument.Path.touchDescendant(Path.java:212)
at com.softwareag.xtools.xapplication.businessdocument.BusinessNodeImpl.touchDescendants(BusinessNodeImpl.java:507)
at com.softwareag.xtools.xapplication.jsp.taglib.ContextTag.getElementValue(ContextTag.java:193)
at com.softwareag.xtools.xapplication.jsp.taglib.FieldTag.doStartTagCore(FieldTag.java:100)
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(JspTag.java:142)
at cServis_1._jspService(cServis_1.java:286)
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.3
Tamino Version : 3.1.1
Platform : Win2k
WebContainer : Tomcat 3.3
JDK Version : 1.3.1
[This message was edited by Christian Freytag on 09 Aug 2002 at 09:40.]
web.xml (3.8 KB)
Hello,
does the element ‘Personel’ contain eleemnts with name ‘Role’?
If yes, it could be a bug of the loop tag implementation and I would please you to post the schema which defines ‘Personel’ and the JSP page, to the Community or to to me.
Many thanks,
Christian.
Hello,
The schema contains the Role Element.
And the jsp works fine if I run them just after I start tomcat. It gives this exception if I run jsp of Hasta schema before these jsp pages.
I wish I have been able to tell you my problem.
I will mail the schema and pages to you to
Thanks for reply.
Server
I just had a look at our schema-loading code …
Do you have multiple schemas defining the same doctype?
If yes, we should dig into this direction, X-Application might use the wrong schema.
Michael
Software AG Germany, Darmstadt
My application does not contain any schemas with multiple doctype’s.
All my schema’s contain only ONE doctype with the same name as the schema name.
Hello,
I had a short look at your JSP pages you sent me via email. I am not sure, but your page ?dPersonel.jsp? contains a loop tag for iterating the sub-element ?Role? without ?document? attribute.
The problem is: I checked the code of the loop tag a found out that context tags (e.g. loop, browse, form) does not inherit the document context of their enclosing context tag. If they don?t have an own document attribute defining the document context, they use ?current? instead.
Therefore,
<BR><xapp:form document=?currentPersonel?><BR>...<BR><xapp:loop select=?/Personel? iterate=?Role? targetbase=?roles?><BR>...<BR></xapp:loop><BR>...<BR></xapp:form><BR>
is problematic, because the loop does not refer the document ?currentPersonel? as you may expect it.
In your case, it could be that you define a document ?current? with doctype ?Hasta? when invoking the Hasta JSPs. Than, the loop of the Personel page access to a document with the wrong doctype.
Could you add the attribute document=?currentPersonel? to your loop and check if the error still occurs?
<xapp:loop select=“/Personel” iterate=“Role” targetbase=“/Personel/Role” document=?currentPersonel?>
I hope, this solve your problem.
Do you think we should change the behavior of the loop tag for a next version of X-Application?
Bye,
Christian.
Hello,
I have added the document attribute to the loop in the delete page but it did not sove my problem. I still recieve an exception.
(In fact I would be surprised if it would solve my problem since I get this exception when I try to make a search or at create page not at the delete page.)
We are going to open our project to production in a few weeks but these problems make us think about it.
Can you please deal with this problem ?
Many thanks
Hello,
we found out that the problem MehmetServer describes is a bug within X-Application 3.1.2 and 3.1.3. It occurs when working with multiple schemas
Let’s assume you have two schemas:
- first schema has doctype X and defines the elements X, A and B.
- the second schema has doctype A.
Then, the access to the documents is relevant. If documents of type A are accessed before documents of type X, X-Application works.
But, when accessing documents of type X, documents of type A will get a wrong type for their root element A. X-Application takes the element definition defined within the first schema instead of requesting the second schema.
Bye,
Christian.