NotesException: You must provide an item name

Hi Guys,

I have set up a Tomcat communicating with domino through DIIOP. The attached errors seem to occure when I access a field of a document that has no value.

And if this field is access by getItemValueSting(“fieldnameABC”) or as you can see by Document.encrypt() it throws the attached exception.

If add right before the getItemValueString(“fieldnameABC”) a replaceItemValue(“fieldnameABC”, “abc”) everything works fine.

I have also tryed to access the Field through the Item.class with the same result, trying to access the value of the item with getText, getValueSting etc.

all result in the same exception. Has anyone had the same problem or any suggestions?

Right now, the only way to fix this is to write a static method mySaveAccessGetItemValueString(Document doc, String fieldname) with a try catch implementation.

But this isn’t realy the thing I was looking for. An other way is to make sure, no empty (or wrong format) values to be filled into the fields, but this can not

be fail safe.

Home someone has some ideas.

Kind regards

Ben

2008-08-18 06:23:03,376 [TP-Processor3] FATAL NewLogFile - NotesException: You must provide an item name

2008-08-18 06:23:03,376 [TP-Processor3] FATAL NewLogFile - at lotus.domino.NotesExceptionHelper.read(Unknown Source)

2008-08-18 06:23:03,377 [TP-Processor3] FATAL NewLogFile - at lotus.domino.NotesExceptionHolder._read(Unknown Source)

2008-08-18 06:23:03,378 [TP-Processor3] FATAL NewLogFile - at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)

2008-08-18 06:23:03,378 [TP-Processor3] FATAL NewLogFile - at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)

2008-08-18 06:23:03,379 [TP-Processor3] FATAL NewLogFile - at lotus.domino.corba._IDocumentStub.doUpdates(Unknown Source)

2008-08-18 06:23:03,379 [TP-Processor3] FATAL NewLogFile - at lotus.domino.cso.Document.sendUpdates(Unknown Source)

2008-08-18 06:23:03,380 [TP-Processor3] FATAL NewLogFile - at lotus.domino.cso.Item.getRItem(Unknown Source)

2008-08-18 06:23:03,380 [TP-Processor3] FATAL NewLogFile - at lotus.domino.cso.Item.getValueString(Unknown Source)

2008-08-18 06:23:03,448 [TP-Processor3] FATAL NewLogFile - NotesException: You must provide an item name

2008-08-18 06:23:03,448 [TP-Processor3] FATAL NewLogFile - at lotus.domino.NotesExceptionHelper.read(Unknown Source)

2008-08-18 06:23:03,448 [TP-Processor3] FATAL NewLogFile - at lotus.domino.NotesExceptionHolder._read(Unknown Source)

2008-08-18 06:23:03,449 [TP-Processor3] FATAL NewLogFile - at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)

2008-08-18 06:23:03,449 [TP-Processor3] FATAL NewLogFile - at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)

2008-08-18 06:23:03,449 [TP-Processor3] FATAL NewLogFile - at lotus.domino.corba._IDocumentStub.doUpdates(Unknown Source)

2008-08-18 06:23:03,449 [TP-Processor3] FATAL NewLogFile - at lotus.domino.cso.Document.sendUpdates(Unknown Source)

2008-08-18 06:23:03,450 [TP-Processor3] FATAL NewLogFile - at lotus.domino.cso.Document.encrypt(Unknown Source)

Subject: Document.hasItem() and code examples.

You should try checking that the item exists before trying to use it. Document.hasItem(itemName) is the way to check. If you are unsure of what is in the field then it might be better to use NotesDocument.getItem(itemName) and then check what the item is before using it.

There are some great code examples in the Domino Designer help files nearly every method/property has an example of how to use.

Subject: SOLVED! NotesException: You must provide an item name

Hi Tony,

thanks for your effort. But as I wrote, the item did exist and I did try to access the item through the Item.class.

  1. The method Document.hasItem() would return true.

  2. The code Item item = Document.getFirstItem() would return the right Item.

  3. Even the item.getName() would return the right String containing the right item name.

But all getValue() methods from item.getValueString() etc. and Document.getItemValueString would throw that exception.

After debugging for couple of hours I found out that at one point in the code I have to remove some unnecessary items.

This was done by doc.removeItem(itemname). But I haven’t checked if itemname is empty.

I hard coded it to doc.removeItem(“”);

After executing this the empty removeItem statement the ValueMethods of any item threw the exception.

In fact if this exception would be thrown by the empty removeItem statement it would make sense because no item name was given.

Maybe the item remove is done with the next getItemValueString :slight_smile: I dont know. Right now I have no time to debug deeper but I wanted to

make this issue available.

Regards Ben