Update error, MODIFY page

X-Application Version: 4.1.1
Tamino Version : 4.1.4
Platform : Win2k,
WebContainer : Tamcat 4.1.18
JDK Version : 1.4.1_02

I receive MajorEnvironmentException when committing an update on MODIFY page, but the error only occurs for documents that was included in Tamino with Tamino Interactive Interface, the documents created with X-application CREATE page updates without problems.

The problem occur with applications generated with GENERATOR or created manually using Tag Library (based on the LoopModify Example).



The following is message error:


!Error!
An error occurred in the application program. Please report the following problem to your webmaster.
Error message: StoreException occurred: could not request the last modified date for object ‘declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction” declare namespace itf = “http://namespaces.softwareag.com/tamino/InternalTaminoFunction” declare namespace xapp = “http://www.softwareag.com/xtools/xapplication/result” for $wrapper in input()/Nota_Fiscal where tf:getInoId($wrapper)=47 return element xapp:Result { element xapp:NodeLocation {attribute id {tf:getInoId($wrapper)}, attribute nodeId {itf:getNodeId($wrapper)}, element doctype{itf:getDoctype($wrapper)}, element collection{tf:getCollection($wrapper)}, element timestamp{tf:getLastModified(root($wrapper))}} , element xapp:Body {$wrapper}}’
Help message: An administrator should have a look to the stack trace to analyze the error.
Exception id: 161
Exception Type: MajorEnvironmentException
Stacktrace:


XException: id = 215 arg[0] = com.softwareag.xtools.xapplication.plugin.StandardWorkspacePlugin.commitDocumentList arg[1] = commit
Nested Exception (com.softwareag.tamino.db.api.invocation.TInvocationRetryHandlerException, tag: Name: JavaTaminoAPI_4_1_2_41 ) stacktrace:

Nested Exception (com.softwareag.tamino.db.api.connection.TTransactionModeUpdateException, tag: Name: JavaTaminoAPI_4_1_2_41 ) stacktrace:

Nested Exception (com.softwareag.tamino.db.api.common.TAccessFailureException, tag: Name: JavaTaminoAPI_4_1_2_41 ) stacktrace:

Tamino access failure.
at com.softwareag.tamino.db.api.connection.TTransactionMode.update(TTransactionMode.java:65)
at com.softwareag.tamino.db.api.connection.TTransactionModeCoordinator.updateModeFrom(TTransactionModeCoordinator.java:295)
at com.softwareag.tamino.db.api.invocation.TAbstractInvocation.doTemplateInvoke(TAbstractInvocation.java:317)
at com.softwareag.tamino.db.api.invocation.TAbstractInvocation.invoke(TAbstractInvocation.java:119)
at com.softwareag.tamino.db.api.accessor.TAbstractAccessor.invoke(TAbstractAccessor.java:202)
at com.softwareag.tamino.db.api.accessor.TStreamAccessorImpl.xquery(TStreamAccessorImpl.java:735)
at com.softwareag.tamino.db.api.accessor.TXMLObjectAccessorImpl.xquery(TXMLObjectAccessorImpl.java:258)
at com.softwareag.xtools.xapplication.store.TaminoStoreV4.getLastUpdateTime(TaminoStoreV4.java:1204)
at com.softwareag.xtools.xapplication.store.TaminoStore.update(TaminoStore.java:604)
at com.softwareag.xtools.xapplication.businessdocument.BusinessDocument.updateDocument(BusinessDocument.java:905)
at com.softwareag.xtools.xapplication.businessdocument.state.Modifiable.quasiCommit(Modifiable.java:84)
at com.softwareag.xtools.xapplication.businessdocument.BusinessDocument.commitAll(BusinessDocument.java:1092)
at com.softwareag.xtools.xapplication.businessdocument.BusinessDocumentWorkspace.commitAll(BusinessDocumentWorkspace.java:404)
at com.softwareag.xtools.xapplication.plugin.StandardWorkspacePlugin.commitDocumentList(StandardWorkspacePlugin.java:218)
at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
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:147)
at com.softwareag.xtools.xapplication.plugin.Dispatcher.execute(Dispatcher.java:153)
at com.softwareag.xtools.xapplication.jsp.SessionContext.processWorkspaceAction(SessionContext.java:376)
at com.softwareag.xtools.xapplication.jsp.taglib.ModuleTag.processDocumentAction(ModuleTag.java:291)
at com.softwareag.xtools.xapplication.jsp.taglib.ModuleTag.doStartTagCore(ModuleTag.java:95)
at com.softwareag.xtools.xapplication.jsp.JspTag.doStartTag(JspTag.java:132)
at org.apache.jsp.view_jsp._jspx_meth_xapp_module_0(view_jsp.java:109)
at org.apache.jsp.view_jsp._jspService(view_jsp.java:87)
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:536)

[This message was edited by Christian Freytag on 19 January 2004 at 12:15.]

Hello,

the timestamp that could not requested is a meta-information for documents. X-Application requires meta-data (as timestamp, collection, ino:id, …) to store documents within Tamino.

To get the meta-information a request for a document (in your case, the document with ino:id=47) the response is wrapped.

The query is

declare namespace tf = "http://namespaces.softwareag.com/tamino/TaminoFunction" 
declare namespace itf = "http://namespaces.softwareag.com/tamino/InternalTaminoFunction" 
declare namespace xapp = "http://www.softwareag.com/xtools/xapplication/result" 

for $wrapper in input()/Nota_Fiscal 
	where tf:getInoId($wrapper)=47 
return element xapp:Result { 
	element xapp:NodeLocation {
		attribute id {tf:getInoId($wrapper)}, 
		attribute nodeId {itf:getNodeId($wrapper)}, 
		element doctype{itf:getDoctype($wrapper)}, 
		element collection{tf:getCollection($wrapper)}, 
		element timestamp{tf:getLastModified(root($wrapper))}
	}, 
	element xapp:Body {$wrapper}
}



I have no idea why this query works not for documents load via Tamino Interactive Interface while there is not problem with documents created via X-Application.

To analyze the error we need more information. To get this information you could

(1) Process the query above via Tamino Interactive Interface and post the resulting response to the community. Just copy the query to your XQuery input field.

(2) Initialize a sniffer that protocols the data transfer between X-Application and Tamino. You could send a zipped version of the created protocol file to the community. How to use a sniffer is described in the Topic

Protocolling the HTTP transfer between Tamino and X-Application

Many thanks.

Bye,
Christian.

Hi Christian,
Thanks for your attention

Sorry for the delay on this post.

I made a mistake when I sad that error occurs for documents loaded with Tamino Interactive Interface, and works fine otherwise (documents create by X-application).

The application runs fine (Update Documents) for all documents, documents loaded with any tool and documents created by X-application.

Sometimes the error still occurs, but I do not know why. I use application and sometimes the error may occur.

After the error (could not request the last modified date for object) I can execute the query to get the meta-information in Tamino Interactive Interface for the specified ino:id, without problem.


The attached files (in Sniffer.zip) are the screen error and http sniffed logs:

outOk.txt - http log of a normal Update transaction without error.

Error1.txt and outERROR1.txt - Screen error and http log of an Update error (StoreException occurred: could not request the last modified date for object)

Error2.txt and outERROR2.txt - Screen error and http log of an Update error
(Error message: Could not rollback transaction after exception could not change to autocommit mode after rollback exception)

Many thanks,

Fábio Decile
Sniffer.zip (46.5 KB)

Hello,

when I try to download your zip file, I receive a gif image.

Are you sure that you have posted the correct file?

If not, could you send the zip file again?

Many thanks.
Bye,
Christian.

Hi Christian,

Are you logged on?

I tried to download it without log on the forum and receive the security gif, but after had log on I can look the file.

Fábio.


Hello,

Thanks for your tip: Yes, I was logged out, but I did not recognize this because I am normally logged in.

I checked the zip file containing the error output. There is a session ID that is used for a request although another request is still running. This situation may occur if X-Application starts a request, uses the stream model of the Tamino API, but does not close the stream. Instead, it starts a new request.

For X-Application 4.1.1 I know that X-Application uses the stream model, to analyze the response for updates of XML document. Therefore, we will check the code. I hope we can contribute a Java class that solves this Bug for you can compile a new xapplication.jar.

Many thanks for tracing the communication between X-Application and Tamino.

Bye,
Christian.

Hello,

I checked the code of the class ‘TaminoStoreV4’ and your stacktrace.

There is the method ‘lockDocument’. The task of this method is to set a lock a document by sending a request for this document. To implement the lock a xquery is send. Since the output is not relevant, the TStream is ignored. I am sure, that this causes your problem.

Currently, I cannot access the CVS to get the version 4.1.4 of the file TaminoStoreV4.java. Therefore, I please to change the code as described and to compile the jar file:

(1) Please replace the code of the method ‘lockDocument’ of the source file
…\src\com\softwareag\xtools\xapplication\store\TaminoStoreV4.java

	public void lockDocument(Element root, NodeLocation nodeLocation) throws StoreException {
		if (root == null) {
			throw new PreconditionViolation("root element 'root' must not be null");
		}
		if (!inTransaction()) {
			throw new PreconditionViolation("lock must be invoked within transaction");
		}
		if (nodeLocation.getId() == null) {
			throw new PreconditionViolation("ino id of the root element must be defined");
		}
		
		//        String collectionName = getRegisteredDoctypeCollection(root.getName());
		String collectionName = nodeLocation.getCollection();
		TStreamAccessor accessor = connection.newStreamAccessor(TAccessLocation.newInstance(collectionName));
		
		TInputStream is = null;
		try {
			String lockQuery = assembleLockQuery(root, nodeLocation);
			is = accessor.xquery(TXQuery.newInstance(lockQuery));
		} catch (TAccessorException e) {
			throw new StoreException("could not lock document by query " + getIdQuery(root.getName(), nodeLocation), e);
		} finally {
			try {
				if (is != null) {
					is.close();
				}
			} catch (IOException e) {
				throw new StoreException("could not close input stream for query " + getIdQuery(root.getName(), nodeLocation), e);
			}
		}
	}		



(2) compile a new jar file
(2 a) open a console
(2 b) change to your X-Application installation directory
(2 c) invoke “build quick”

(3) copy the new jar file …\lib\debug\xapplication.jar into the WEB-INF\lib directory of your application.


I hope this solves your error.

Bye,
Christian.

Hi Christian,

I´ve just received an error when invoke “build quick”.

C:\xapplication_411>build quick > saida.txt
[javac] C:\xapplication_411\src\com\softwareag\xtools\xapplication\common\Ut
il.java:178: warning: decode(java.lang.String) in java.net.URLDecoder has been d
eprecated
[javac] str = URLDecoder.decode(str); // ’ ’ might be encoded by %20
on windows
[javac] ^
[javac] C:\xapplication_411\src\com\softwareag\xtools\xapplication\generator
\webui\Catalina.java:104: warning: encode(java.lang.String) in java.net.URLEncod
er has been deprecated
[javac] sb.append(URLEncoder.encode(path));
[javac] ^
[javac] C:\xapplication_411\src\com\softwareag\xtools\xapplication\store\Tam
inoStoreV4.java:1062: cannot resolve symbol
[javac] symbol : class IOException
[javac] location: class com.softwareag.xtools.xapplication.store.TaminoStore
V4
[javac] } catch (IOException e) {
[javac] ^
[javac] 1 error
[javac] 2 warnings

BUILD FAILED
file:./compileLib.xml:57: Compile failed; see the compiler error output for deta
ils.

Total time: 30 seconds
Compile.zip (1.13 KB)

Hello,

add

import java.io.IOException;



to the TaminoStoreV4.java

Bye,
Christian.