AnsweredAssumed Answered

MultilingualContentService auth provider not found exception

Question asked by akomisarek on Dec 9, 2009

I am getting following exception when I try to use MultilingualContentService:
net.sf.acegisecurity.providers.ProviderNotFoundException: No authentication provider for net.sf.acegisecurity.providers.UsernamePasswordAuthenticationToken

I am really confused because I use it for my evaluator which is used in details menu and it is similar to AddTranslationEvaluator:

This is my code:

    public boolean evaluate(Node node)
        boolean result = false;
        boolean isNodeMultililingal = node.hasAspect(ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
        boolean isMLContainer = node.getType().equals(ContentModel.TYPE_MULTILINGUAL_CONTAINER);

        if (isNodeMultililingal || isMLContainer)
            FacesContext fc = FacesContext.getCurrentInstance();
            // the current user must have enough right to add a content to the space
            // where the pivot translation is located in
            if(MultilingualUtils.canAddChildrenToPivotSpace(node, fc))
                MultilingualContentService mlservice = (MultilingualContentService) FacesHelper.getManagedBean(fc, "MultilingualContentService");
                int availableTranslationCount    = mlservice.getTranslations(node.getNodeRef()).size(); //throws exception
                result = (availableTranslationCount > 0);
                result = false;
            result = true;
        return result;

And when I try to invoke methods on ml content service I get mentioned exception. Do I miss something? AddTranslationEvaluator is invoked in the same rendering proccess and it works properly so why my code is not?

Thanks for any help,

EDIT: Topic renamed for more clarity.