}
private void setAuthenticatedUser(PortletRequest req, String userName) {
WebApplicationContext ctx = (WebApplicationContext) getPortletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
ServiceRegistry serviceRegistry = (ServiceRegistry) ctx.getBean(ServiceRegistry.SERVICE_REGISTRY);
TransactionService transactionService = serviceRegistry.getTransactionService();
NodeService nodeService = serviceRegistry.getNodeService();
AuthenticationComponent authComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
AuthenticationService authService = (AuthenticationService) ctx.getBean("authenticationService");
PersonService personService = (PersonService) ctx.getBean("personService");