Q
Problem solve Get help with specific problems with your technologies, process and projects.

Attach a file via Java agent using embedObject

I am trying to attach a file via a Java agent using the embedObject method. The problem I'm having is that some documents are correctly attached but some aren't. I wonder if there is a size issue here, because the attachment works fine with small documents.

What I do is take information from, let's say, 20 documents, and create one report document that I attach to the body field of a rich text.

<<259 File does not exist >> is the execption that is raised after the following line: rtitem.embedObject(EmbeddedObject.EMBED_ATTACHMENT,null, fN, "Report");
I don't believe the problem is file size -- at least not directly. This looks like a timing issue that occurs because large files take longer to copy into the document than small files do. I believe there's some multithreading happening, such that embedObject returns control to your code before the copying is all done. Are you deleting each file immediately after the call to embedObject? If so, you're probably deleting them before Notes is done copying them.

Try saving the Notes document first. Then, after that succeeds, delete the files. If that doesn't help (or if I've guessed wrong about what you're doing) I suggest you call IBM support.

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on Java for Lotus Notes Domino

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close