I get Exception When I try to run a query

Hello
I recieve the following Exception when I try to run a query

the qstr is : for $x in input()/Combo return $x
this query runs without problem from Interactive Interface

attached file is the log of perl

Hitit.java :

BusinessDocumentWorkspace ws = new BusinessDocumentWorkspace(store);
AnchorCursor docCursor = ws.xquery(null,“Ortopedi”,qstr,10); // line 102 of Hitit.java




StoreException: id = 160 arg[0] = Local transaction mode could not be establishe
d. Falling back to autocommit mode!
NestedException:NestedException:Tamino access failure (INOXME8554, No message re
ceived)
Nested Exception (com.softwareag.tamino.db.API.accessor.TAccessorException, tag:
$Name: JavaTaminoAPI_4_1_2_41 $) stacktrace:

Nested Exception (com.softwareag.tamino.db.API.common.TAccessFailureException, t
ag: $Name: JavaTaminoAPI_4_1_2_41 $) stacktrace:

Tamino access failure (INOXME8554, No message received)
at com.softwareag.tamino.db.API.accessor.TAccessFailureVerifier.newAccessFailureException(TAccessFailureVerifier.java:126)
at com.softwareag.tamino.db.API.accessor.TAccessFailureVerifier.verify(TAccessFailureVerifier.java:113)
at com.softwareag.tamino.db.API.accessor.TGenericAccessorImpl.execute(TGenericAccessorImpl.java:56)
at com.softwareag.tamino.db.API.accessor.TGenericAccessorImpl.execute(TGenericAccessorImpl.java:76)
at com.softwareag.tamino.db.API.connection.TLocalTransactionMode.begin(TLocalTransactionMode.java:53)
at com.softwareag.tamino.db.API.connection.TTransactionModeCoordinator.useLocalTransactionMode(TTransactionModeCoordinator.java:101)
at com.softwareag.tamino.db.API.connection.TConnectionImpl.useLocalTransactionMode(TConnectionImpl.java:248)
at com.softwareag.xtools.xapplication.store.TaminoStoreV4.xquery(TaminoStoreV4.java:790)
at com.softwareag.xtools.xapplication.businessdocument.AnchorCursor.load(AnchorCursor.java:353)
at com.softwareag.xtools.xapplication.businessdocument.AnchorCursor.load(AnchorCursor.java:343)
at com.softwareag.xtools.xapplication.businessdocument.AnchorCursor.(AnchorCursor.java:79)
at com.softwareag.xtools.xapplication.businessdocument.BusinessDocumentWorkspace.processQuery(BusinessDocumentWorkspace.java:560)
at com.softwareag.xtools.xapplication.businessdocument.BusinessDocumentWorkspace.xquery(BusinessDocumentWorkspace.java:196)
at hitit.Hitit.fillVector(Hitit.java:102)
at hitit.Hitit.fillCombos(Hitit.java:353)
at hitit.Hitit.hititStartCore(Hitit.java:445)


I am using Tomcat 4.1.18
My database is version 4.1.1
my JAVA_HOME environment variable is set to jdk 1.3.1



X-Application Version: 4.1.1
Tamino Version : 4.1.1
Platform : Win2k
WebContainer : Tamocat 4.1.1
JDK Version : 1.3.1
installrequests.txt (8.68 KB)

Hello,

I had a look into the sniffer protocol. The user agent is still reporting that it is Java1.3.0.

Could change the JDK version also for this program to 1.3.1_07 and try it again?

Many thanks.

Bye,
Christian.

Hello,
I downloaded JDK 1.4.0 and now the query runs.
Now I have another problem. I try to access the BusinessNodes of the BusinessDocument but I recieve an exception saying there is no schema.
The source code and the exception is as follows :

qstr = “for $x in input()/Combo return $x”
Vector docVector = new Vector();
AnchorCursor docCursor = ws.xquery(null,“Ortopedi”,qstr,10);
int counter = 0;
while (docCursor.hasNextPage()) {
BusinessDocument docList = docCursor.getPage();
for (int i = 0; i < docList.length; i++) {
BusinessDocument doc = docList[i];
counter++;
System.out.println( docType+ “: " + doc.getNodeLocation().getId());
docVector.add(doc);
}
docCursor.nextPage();
}

BusinessDocument bd = (BusinessDocument) docVector.get(0);
String ss = bd.selectAttribute(”/Combo/@Tur").getValue(); // this line works ok…
BusinessNode bnroot = bd.getRoot(); // this line causes the exception…

This code recieves this exception :

reconditionViolation: cannot create BusinessNode without schema

com.softwareag.xtools.xapplication.common.PreconditionViolation
cannot create BusinessNode without schema

at com.softwareag.xtools.xapplication.businessdocument.BusinessDocument.getBusinessNode(BusinessDocument.java:660)

at com.softwareag.xtools.xapplication.businessdocument.BusinessDocument.getRoot(BusinessDocument.java:421)

Hello,

The new concept of X-Application is that we are using BusinessNode only when Schema information is required. This is only useful when anonymous structure like nested sequences have to be addressed or choices have to be flipped.

The common way should be to work on the document model, in this case JDOM.

To your exception:

AnchorCursor docCursor = ws.xquery(null, "Ortopedi", qstr, 10);
</pre><BR><BR>The documents you get from the cursor do not relate to a schema since the doctype information is 'null'. <BR><BR>You have two alternatives:<BR><BR>1) Work without BusinessNode objects. I would use this way if I have not to deal with nested sequences and do not need the switching of choices. In this case, don't use <BR><BR><pre class="ip-ubbcode-code-pre">
BusinessNode root = doc.getRoot();
</pre><BR><BR>but <BR><BR><pre class="ip-ubbcode-code-pre">
Element root = doc.selectElement("/Combo");
</pre><BR><BR>2) Assign a schema to your documents. A to be done, load the schema containing the element definition of 'Combo' to your workspace, e.g. by<BR><BR><pre class="ip-ubbcode-code-pre">
workspace.getSchemaSet().add(SchemaFactory.forTamino(store, collection, "schema's name"));
</pre><BR><BR>Then, use<BR><BR><pre class="ip-ubbcode-code-pre">
AnchorCursor docCursor = ws.xquery("Combo", "Ortopedi", qstr, 10);



Bye,
Christian.

Hello,
I get this exception on tomcat from this code

BusinessDocumentWorkspace ws = new BusinessDocumentWorkspace(store);
System.out.println(“ws initialized”); //this line is written on Tomcat console
ws.getSchemaSet().add(SchemaFactory.forTamino((TaminoStore)store, “Ortopedi”, “XTitle”)); //this line causes the exception
System.out.println(“XTitle added to schemaset”); //this line is NOT written on Tomcat console
Same code runs when I run from JDeveloper and its debugger but not on tomcat…

HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:484)


root cause

javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:188)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:204)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
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 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:484)

Hello,

the problem with Tomcat 4.1.18 that the root exception is wrapped and the stacktrace is printed out for the wrapped exception.

Do you have also a Tomcat 3.3.1 installed. When I find a problem I start my application with Tomcat 3.3.1 to get a better exception message.

Another possibility is to provide an error.jsp page where you print out explicitely the stacktrace of the exception.

An example for such an error.jsp is used by the generator

…\xapplication_4_1_1_4\src\com\softwareag\xtools\xapplication\generator\resources\style\template\Error.jsp

You can simplify this page: Just print out the stacktrace

exception.printStackTrace(new java.io.PrintWriter(out));

Bye,
Christian.

Hello,
I formed the Error.jsp and got the exception.
It is a similar exception to the previous one as you can guess.
I have tried same thing with both jdk1.3.1 and jdk 1.4.1


java.lang.ExceptionInInitializerError: Wrapped exception java.io.IOException: reading schema Ortopedi XTitle failed: NestedException:Tamino access failure (INOXME8554, No message received) at com.softwareag.xtools.xapplication.schema.TaminoURIConverter.read(TaminoURIConverter.java:179) at com.softwareag.xtools.xapplication.schema.TaminoURIConverter.createInputStream(TaminoURIConverter.java:110) at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:752) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:220) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:286) at com.softwareag.xtools.xapplication.schema.SchemaFactory.forLocation(SchemaFactory.java:180) at com.softwareag.xtools.xapplication.schema.SchemaFactory.forTamino(SchemaFactory.java:151) at hitit.Hitit.fillTitle(Hitit.java:469)

Hello,

could you make a sniffer protocol and look for the user agent that is used.

The no message received error occured when you were using JDK 1.3.0.

If Java4.1.1_01 is used as client post the protocol to the community. Then, we can get more information and analyze the problem.

Many thanks,
bye Christian.

Hello,
Tomcat was using JDK 1.3
I set it to run with JDK 1.3.1 and solved the problem.
Thanks
Server