AnsweredAssumed Answered

How to use NodeService in FilterServlet ?

Question asked by haevele on Jun 25, 2009
Hi, i have a problem with a Servlet Filter, that i am developing. The Filter is properly configured in web.xml.
The NodeService is injected by Spring. But when I try to use the NodeService inside the doFilter(…) method of my servlet,

StoreRef contentStoreRef = new StoreRef("workspace", "SpacesStore");
NodeRef rootNode = this.nodeService.getRootNode(contentStoreRef);
I get an
org.alfresco.error.AlfrescoRuntimeException: Transaction must be active and synchronization is required: Thread[http-8080-1,5,main]

I use labs3 latestStable

The Filter is configured like this in web.xml:

      <filter-name>Test Redirect Filter</filter-name>

Do you have any ideas, how I can call the nodeService safely inside the servlet ?

Thank you very much