IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Tamino access failure (INOXQE6352)

  • 1.  Tamino access failure (INOXQE6352)

    Posted Sun September 14, 2003 12:07 PM

    X-Application Version: 4.1.1
    Tamino Version : 4.1.4.1
    Platform : WinXP Professional
    WebContainer : Tomcat 4.1.24
    JDK Version : 1.4.1

    Hello,

    I would like to replace an element using XQuery update replace.
    Example XQuery:

    update replace input()/designPattern/name[. = ‘Adjusted Winner’ ]
    with Adjusted Winner neu

    This update query works fine with the Tamino Interactive Interface but if I use this query inside a java program I get the following
    Exceptions:

    StoreException: id = 161 arg[0] = xquery failed

    Tamino access failure (INOXQE6352, XQuery parsing error, Syntax error at line 1, column 691: update replace input()/designPattern/name[. = 'Adjusted Winn)

    I have attached the sample java code and the complete error message.
    I have tried serveral different queries and I get always the same XQuery parsing error at line 1 column 691 although the queries were different.

    Is is possible to use XQuery update within java at all or only with the Tamino Interactive Interface?

    I need this functionality not only for simple updates with one element but also for updates where one element and its complete subtree should be replaced. Because of that I can’t just
    use methods like
    doc.selectElement(“/designPattern/name”).setText(“Adjusted Winner neu”);
    because it would be very laborious to adapt this method calls to the different subtree structures Additional I perhaps get problems with the order of the elements if I delete or insert new child elements.

    Best regards,

    Samer Al-Hunaty


    java method
    -----------
    public static void updateReplaceTest() {
    String updateQuery = "update replace input()/designPattern/name[. = ‘Adjusted Winner’ ] " +
    “with Adjusted Winner neu”;

    System.out.println("query: " + updateQuery);
    Element jDomElement = null;

    try {
    // initialize the workspace
    Store store = TaminoStore.createStore(DATABASE_URI);
    BusinessDocumentWorkspace workspace = new BusinessDocumentWorkspace(store);

    // create a cursor
    AnchorCursor docCursor = workspace.xquery(
    null,
    COLLECTION,
    updateQuery,
    10);
    }
    catch (StoreException se) {
    System.out.println("StoreException: " + se.getMessage());
    se.printStackTrace();
    }
    catch (XException xe) {
    System.out.println("XException: " + xe.getMessage());
    xe.printStackTrace();
    }
    }

    Stacktrace:
    -----------
    query: update replace input()/designPattern/name[. = ‘Adjusted Winner’ ] with Adjusted Winner neu
    StoreException: id = 161 arg[0] = xquery failed: declare namespace xapp = “404” declare namespace xf = “W3C XQuery 1.0 and XPath 2.0 Functions and Operators” declare namespace tsd = “http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” declare namespace xq = “http://namespaces.softwareag.com/tamino/XQuery/result” declare namespace xs = “XML Schema” declare namespace xql = “XQL FAQ (XML Query Language - Frequently Asked Questions)” declare namespace itf = “http://namespaces.softwareag.com/tamino/InternalTaminoFunction” declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction” declare namespace ino = “http://namespaces.softwareag.com/tamino/response2” for $wrapper in (update replace input()/designPattern/name[. = ‘Adjusted Winner’ ] with Adjusted Winner neu)[xf:position()>= 1 and xf:position() <=10] 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}}: NestedException:Tamino access failure (INOXQE6352, XQuery parsing error, Syntax error at line 1, column 691: update replace input()/designPattern/name[. = 'Adjusted Winn)
    Nested Exception (com.softwareag.tamino.db.API.common.TAccessFailureException, tag: $Name: JavaTaminoAPI_4_1_2_41 $) stacktrace:

    Tamino access failure (INOXQE6352, XQuery parsing error, Syntax error at line 1, column 691: update replace input()/designPattern/name[. = 'Adjusted Winn)
    at com.softwareag.tamino.db.API.accessor.TAccessFailureVerifier.newAccessFailureException(TAccessFailureVerifier.java:126)
    at com.softwareag.tamino.db.API.accessor.TAccessFailureVerifier.verify(TAccessFailureVerifier.java:113)StoreException: id = 161 arg[0] = xquery failed: declare namespace xapp = “404” declare namespace xf = “W3C XQuery 1.0 and XPath 2.0 Functions and Operators” declare namespace tsd = “http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition” declare namespace xq = “http://namespaces.softwareag.com/tamino/XQuery/result” declare namespace xs = “XML Schema” declare namespace xql = “XQL FAQ (XML Query Language - Frequently Asked Questions)” declare namespace itf = “http://namespaces.softwareag.com/tamino/InternalTaminoFunction” declare namespace tf = “http://namespaces.softwareag.com/tamino/TaminoFunction” declare namespace ino = “http://namespaces.softwareag.com/tamino/response2” for $wrapper in (update replace input()/designPattern/name[. = ‘Adjusted Winner’ ] with Adjusted Winner neu)[xf:position()>= 1 and xf:position() <=10] 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}}: NestedException:Tamino access failure (INOXQE6352, XQuery parsing error, Syntax error at line 1, column 691: update replace input()/designPattern/name[. = 'Adjusted Winn)
    NestedException: NestedException:Tamino access failure (INOXQE6352, XQuery parsing error, Syntax error at line 1, column 691: update replace input()/designPattern/name[. = 'Adjusted Winn)

    at com.softwareag.tamino.db.API.accessor.TAccessFailureVerifier.verifyXQueryResponse(TAccessFailureVerifier.java:80)
    at com.softwareag.tamino.db.API.accessor.TXMLObjectAccessorImpl.xquery(TXMLObjectAccessorImpl.java:364)
    at com.softwareag.xtools.xapplication.store.TaminoStoreV4.xquery(TaminoStoreV4.java:805)
    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 de.tum.in.ibis.designpatternlibrary.XApplicationPrototype.updateReplaceTest(XApplicationPrototype.java:46)
    at de.tum.in.ibis.designpatternlibrary.XApplicationPrototype.main(XApplicationPrototype.java:27)


    #webMethods
    #API-Management
    #Tamino


  • 2.  RE: Tamino access failure (INOXQE6352)

    Posted Mon September 15, 2003 08:26 AM

    Hello,

    The base functionality of the X-Application Store class does only support XQuery expression for querying documents. That means that a document that can be iterated set is returned.

    If you need this functionality, you can modify the sources of X-Applications Store implementation. There is a class TaminoStoreV4, the implementation class to access Tamino Version 4.1.x.

    Add a method e.g.

    public void myUpdateQuery(String queryExpression) {
    try {
    TStreamAccessor acc = connection.newStreamAccessor(TAccessLocation.newInstance(nodeLocation.getCollection()));
    TXQuery txquery = TXQuery.newInstance(updateExpression);
    TInputStream is = acc.xquery(txquery);
    Element result = JDomUtil.inputToElement(is);
    } catch (Exception e) {
    //todo
    }
    }
    </pre><BR><BR>Invoke the command <BR><BR>build build<BR><BR>within your X-Application installation directory. The result will be a new jar file <BR>xapplication.jar<BR>located within the directory ...\lib\debug<BR><BR>Use this jar file within your application instead of the old one.<BR><BR>Within your Java Code, cast the store class and invoke your update query.<BR><BR><pre class="ip-ubbcode-code-pre">
    ((TaminoStoreV4)workspace.getStore()).myUpdateQuery(...);



    I hope, that helps you to solve your problem.

    Bye,
    Christian.


    #Tamino
    #API-Management
    #webMethods


  • 3.  RE: Tamino access failure (INOXQE6352)

    Posted Mon September 15, 2003 12:29 PM

    Hello Christian,

    thanks a lot for your fast and helpful answer!
    I have tried your suggestion and after two minor changes it works!
    I have attached the new method for TaminoStoreV4

    Best regards

    Samer Al-Hunaty

    method:
    -------

    public void myUpdateQuery(String updateExpression, String collection) {
    try {
    TStreamAccessor acc = connection.newStreamAccessor(TAccessLocation.newInstance(collection));
    TXQuery txquery = TXQuery.newInstance(updateExpression);
    TInputStream is = acc.xquery(txquery);
    Element result = JDomUtil.inputToElement(is);
    }
    catch (Exception e) {
    //todo
    }


    #Tamino
    #webMethods
    #API-Management