AnsweredAssumed Answered

Alfresco Embedded

Question asked by army81 on Feb 17, 2011
I have a alfresco.war instance with tomcat 6.0.18, db postgres and I implement a web app but I need to get repository and serviceregistry from context of alfresco.war with a servlet in my web app :
public static ServiceRegistry getServiceRegistry() {
      if (serviceRegistry == null) {
         ServletContext alfrescoWebContext = servletContext
               .getContext("/alfresco");
         WebApplicationContext alfrescoSpringContext = WebApplicationContextUtils
               .getRequiredWebApplicationContext(alfrescoWebContext);
         serviceRegistry = (ServiceRegistry) alfrescoSpringContext
               .getBean(ServiceRegistry.SERVICE_REGISTRY);
         repository = (RepositoryImpl) alfrescoSpringContext
               .getBean("JCR.Repository");
      }
      return serviceRegistry;
   }
but the alfrescoWebContext is null. How I can take the context of alfresco.war?  It's possible to get the context of alfresco.war app?

Outcomes