Hi,
I've written a job to delete users in a specific status (toBeRemoved).
Unfortunately I get a nullpointer exception.
This is what I do:
NodeCond searchCond = new NodeCond();
SyncopeUserCond syncopeUserCond = new SyncopeUserCond();
syncopeUserCond.setSchema("status");
syncopeUserCond.setExpression("toBeRemoved");
syncopeUserCond.setType(org.apache.syncope.client.search.AttributeCond.Type.EQ);
searchCond.setSyncopeUserCond(syncopeUserCond);
searchCond.setType(org.apache.syncope.client.search.NodeCond.Type.LEAF);
List<SyncopeUser>
users=searchDAO.search(EntitlementUtil.getRoleIds(entitlementDAO.findAll()),
searchCond);
for (SyncopeUser user : users){
userDAO.delete(user.getId());
}
The nullpointer exception occurs on the delete. In that method it
looks for memberships but those are empty, thus the nullpointer.
When I look at the user-object in debug mode I see that even the
attributes are not present in the object. So it seems that I do not
get a complete object back from the search. Only the core attributes
like username, status, password, token
The same search in console gives me everything (firstname, last name, ...)
What am I doing wrong?
best regards
Bob