1
votes

I get the following error in a xp:messages control:

Error in lotus.domino.local.View, line -2: NotesException: Unknown or unsupported object type in Vector

It is generated in the following code in my Java class:

View vw = db.getView(viewName);
if(null != vw){ 
ViewEntryCollection vec
-> vec = vw.getAllEntriesByKey(key);
}

key is here a provided String.

Anyone has an explanation for this?

3
Do you actually have the -> in your code?dustytrash
You contradict yourself with "key is here a provided String", the error message states "Unknown or unsupported object type in Vector", so tell us, what's in the key variable exactly?Frantisek Kossuth

3 Answers

3
votes

Did you check that your variable key is not null? I get this error message if I provide a key parameter that is null.

2
votes

You're passing in a String, not a Vector. You need to create a Vector, then add your string as the first element to it, same as in SSJS.

Vector vec = new Vector();
vec.add(key)
vw.getAllEntriesByKey(vec);

This is one of the reasons that ODA's method signature is getAllEntriesByKey(Object key), so our abstraction layer does all that for you. Plus once you get the result, you can use standard Java looping to process the loop (for (ViewEntry ent : vec) {....})

0
votes

There are two things to consider. The first is your syntax. The code should be as follows

View vw = db.getView(viewName);
if(null != vw){ 
    ViewEntryCollection vec = vw.getAllEntriesByKey(key);
    // do something with the vec
}

The second is the exception message:

Unknown or unsupported object type in vector.

The documentation here has the method signatures. The key variable you've mentioned is a String so the method should be the one you've used:

public ViewEntryCollection getAllEntriesByKey(Object key) throws NotesException

When you remove the -> from the code does it work as expected?