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
  • 1.  getNextSibling() error

    Posted Wed September 26, 2001 12:13 PM

    somehow get an exception error while accessing the next sibling()?? anyone can help?

    java.lang.ClassCastException: com.docuverse.dom.BasicText
    at QConstruction.showResult(QConstruction.java:97)
    at QConstruction.doPost(QConstruction.java:47)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java)
    at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java:500)
    at org.apache.tomcat.core.Handler.service(Handler.java:223)
    at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:448)
    at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:911)
    at org.apache.tomcat.core.ContextManager.service(ContextManager.java:824)
    at org.apache.tomcat.modules.server.Ajp13Interceptor.processConnection(Ajp13Interceptor.java:167)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:438)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:505)
    at java.lang.Thread.run(Thread.java:484)
    __
    i am using w3cdom1.jar but i dont know whey it keep referencing to com.docuverse.dom.BasicText ??

    TaminoResult tr = tamino.query(“/Construction”);
    Element rootNode = (Element)tr.getElement();
    out.println(“NodeName = " + rootNode.getNodeName()+rootNode.getNodeValue()+”
    “);

    Element construction = (Element) rootNode.getFirstChild();
    out.println(”NodeName = " + construction.getNodeName()+construction.getNodeValue()+“
    ”);
    construction1 = (Element)construction.getNextSibling(); // this is the problem statement

    anyone can help pls?

    thanks

    cheers !


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


  • 2.  RE: getNextSibling() error

    Posted Wed September 26, 2001 12:17 PM

    typo : construction1 = construction

    The servlet is able to compile but unable to execute in tomcat und apache.
    hmm the funny thing is if i declare a Node type

    regards

    cheers !


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


  • 3.  RE: getNextSibling() error

    Posted Thu September 27, 2001 03:39 PM

    Unfortunately the next sibling may not be an Element. The best thing to do is check the type of the next sibling before doing the cast. You may find that it is a BasicText if there is white space between the Elements. The reason you have BasicElement + BasicText is because the API uses the docuverse DOM to do its parsing. However the BasicElement class implements the DOM Element class as expected.


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


  • 4.  RE: getNextSibling() error

    Posted Fri September 28, 2001 10:57 AM

    thanks … came to find that one out too.
    As long as there is a carriage return in between
    tags well there will be a text node an I will have to check for that.

    well thanks alot :slight_smile:

    regards

    cheers !


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