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.  what's wrong with this info?

    Posted 07/23/02 07:21 AM

    I use JB7 to run the ProcessPerson.java(an example in Tamino Document)
    but I couldn’t fix this problem,what’s wrong with it?

    the tracestack infomation:
    Nested Exception (com.softwareag.tamino.db.API.common.TPreconditionViolation) stacktrace:


    com.softwareag.tamino.db.API.common.TPreconditionViolation: No Reader given.

    at com.softwareag.tamino.db.API.common.TContractVerifier.precondition(TContractVerifier.java:31)

    at com.softwareag.tamino.db.API.objectModel.dom.TDOMReader.read(TDOMReader.java:56)Reading documents from file and insert into database



    at com.softwareag.tamino.db.API.objectModel.dom.TDOMAdapter.readFrom(TDOMAdapter.java:182)

    at com.softwareag.tamino.db.API.examples.person.ProcessPersons.performInsertPersonFromFile(ProcessPersons.java:96)

    at com.softwareag.tamino.db.API.examples.person.ProcessPersons.main(ProcessPersons.java:210)

    I am a Java NewComer.


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


  • 2.  RE: what's wrong with this info?

    Posted 07/23/02 08:50 AM

    InputStream myInputStream =null;

    System.out.println((new File(“person1.xml”)).exists());
    myInputStream = (new ProcessPersons()).getClass().getResourceAsStream( “e:\test\person1.xml” );

    the console result show me that the file “person1.xml” is existing,but myInputStream is still null…

    this is the part of ProcessPerson example in Tamino Documents.(Tamino Server 3.1.1)

    could u please tell me what’s going wrong?

    I am a Java NewComer.


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


  • 3.  RE: what's wrong with this info?

    Posted 07/23/02 09:59 AM

    hi,

    since you claim to be a newbie, it’s rather hard to tell, what you were doing.
    either, something is generally wrong in the way you set up the TDOMReader.
    or, you did a smart thing and tested what’s in the reader before passing it to the TDOMReader. this you must not do, as then the data stream is “consumed” and cannot be read anymore.

    hope that helps.

    andreas f.


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


  • 4.  RE: what's wrong with this info?

    Posted 07/23/02 12:13 PM

    The statement

    InputStream myInputStream = (new ProcessPersons()).getClass().getResourceAsStream( filename );

    in the sample is used to read an input file, which is located in the JavaTaminoAPIExamples.jar archive from the same location as the class itself. You can’t give a path to this method.

    What you want to do is read from the filesystem. Try the statement, which is given in the comment section of ProcessPersons.java, which is:

    xmlObject.readFrom( new FileReader( “e:\test\person1.xml” ) );

    This will give you an TXMLObject build from your file.


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


  • 5.  RE: what's wrong with this info?

    Posted 07/23/02 12:43 PM

    the problem occurs when I created a new project and copy-paste the source code to a new file…
    so…

    it puzzles me a lot.

    thank u again for ur help:)

    I am a Java NewComer.


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