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.  Exception while inserting doc

    Posted Thu January 15, 2004 01:03 PM

    Hi All
    I’m getting a NullPointer Exception when inserting a document into Tamimo.

           
    //Insert new document into Tamino
    TXMLObject submission = TXMLObject.newInstance(element);
    TResponse response = accessor.insert(submission);
    System.out.println("Response to insert: " + response.getReturnValue()); 


    I’m getting an exception on the TResponse response = accessor.insert(submission) line.
    Please advice.
    Best Regards


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


  • 2.  RE: Exception while inserting doc

    Posted Thu January 15, 2004 05:22 PM

    Hello there.

    I think that the most likely possibility for a NullPointerException on the line you mentioned is that the “accessor” object is null.

    Could you please post the code where you create and assign a value to the “accessor” object?

    Best Regards,
    Trevor.


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


  • 3.  RE: Exception while inserting doc

    Posted Fri January 16, 2004 08:06 AM

    Thank for the reply Trevor,
    Here’s the code where I assign a value to the accessor

     
    // Obtain the concrete TXMLObjectAccessor using the JDOM object model
    accessor = connection.newXMLObjectAccessor(TAccessLocation.newInstance(collection), TJDOMObjectModel.getInstance());


    I’ve also attached the whole java program.
    Thanks
    CreateNew.java (4.94 KB)


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


  • 4.  RE: Exception while inserting doc

    Posted Fri January 16, 2004 10:40 PM

    Hello goligoli.

    In your code you assign values to the “connection” and “accessor” fields in the “CreateNew” constructor - but unfortunately this constructor is never called!

    I would recommend making the “connection” and “accessor” fields local to the main method, and initializing them just before usage.

    I hope that helps,
    Trevor.


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