subject=subjectContext.getSubjects(); That returns a collection of Subject, not one, per the documentation (and the fact that it's plural). You're calling getPrincipals on a collection, not a Subject. -- Scott