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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  DeferredElementNSImpl

    Posted 11/19/02 01:00 PM

    I have a problem with my code. I send it with its related xml file in attachment.
    I get the error:
    java.lang.ClassCastException: org.apache.xerces.dom.DeferredElementNSImpl
    at Database2.sample(Database2.java:85)
    at Database2.main(Database2.java:134)
    Exception in thread “main”

    Thx
    @nto
    AccessListaMe.xml (719 Bytes)


    #API-Management
    #webMethods
    #webMethods-Tamino-XML-Server-APIs


  • 2.  RE: DeferredElementNSImpl

    Posted 11/19/02 01:02 PM


  • 3.  RE: DeferredElementNSImpl

    Posted 11/19/02 01:57 PM

    The reason for the ClassCastException is that the returned value from the following line:

    Element accessList = (Element)xmlObject.getElement();

    is a org.w3c.dom.Element and the Element accessList in this case is imported from org.jdom.* (line 8 in the source). The reason a org.w3c.dom.Element is being returned is because you have asked to use the TDOMObjectModel when creating the TXMLObjectAccessor.

    So you either need to :
    1) change org.jdom imports to org.w3c.dom imports;
    2) or change the object model to TJDOMObjectModel.


    Stuart Fyffe-Collins
    Software AG (UK) Ltd.


    #webMethods-Tamino-XML-Server-APIs
    #webMethods
    #API-Management


  • 4.  RE: DeferredElementNSImpl

    Posted 11/19/02 02:22 PM

    I’m trying your first solution, but i have to change getChildren, in getElementByTagName and i have i insert Nodelist of java.util import, is it correct?

    Ths
    @


    #webMethods
    #webMethods-Tamino-XML-Server-APIs
    #API-Management


  • 5.  RE: DeferredElementNSImpl

    Posted 11/19/02 02:33 PM

    The first solution have to many changes to do. So i try the second changing

    accessor = connection.newXMLObjectAccessor(
    TAccessLocation.newInstance( collection ) ,
    TDOMObjectModel.getInstance() );

    in
    accessor = connection.newXMLObjectAccessor(
    TAccessLocation.newInstance( collection ) ,
    TJDOMObjectModel.getInstance() );
    with adding the following import
    import com.softwareag.tamino.db.API.objectModel.jdom.*;

    and it works!!!
    Many Thanks Stuart!!!
    @nto


    #webMethods
    #webMethods-Tamino-XML-Server-APIs
    #API-Management