AnsweredAssumed Answered

Transaction required

Question asked by alfresc0t3ster on Feb 5, 2015

I have a problem with backend services and transactions in alfresco 5.0c.
I am working on a custom service, which overlays some alfresco services (FileFolderService, NodeService, …).

My .desc.xml: (backend)
  <shortname>Testing Config Webscript</shortname>
  <description>Get Testing Confiuration based on URL Parameter</description>
  <format default="text">argument</format>

<bean id="webscript.testing.get" class="testing.webscripts.TestingGet" parent="webscript" >
      <property name="service" ref="CmisService" />

<bean id="CmisService" class="">
      <property name="fileFolderService" ref="FileFolderService" />
      <property name="personService" ref="PersonService" />
      <property name="repositoryHelper" ref="repositoryHelper" />
      <property name="serviceRegistry" ref="ServiceRegistry" />
      <property name="contentService" ref="ContentService"/>
        <property name="nodeService" ref="NodeService" />

'TestingGet' is just an AbstractWebScript, which calls my CmisService class.

   private ContentService contentService;
   private NodeService nodeService;

        + setter/getter for each service

All services are null in my 'CmisService' class, BUT if I get my services per ApplicationContext, they are working fine:
ApplicationContext appContext = BaseApplicationContextHelper.getApplicationContext(new String[]{"classpath:alfresco/application-context.xml"});
contentService = (ContentService) appContext.getBean("contentService");

I am using transaction none, because ApplicationContext throw me a Exception with:

2015-02-05 10:14:39,659  ERROR [extensions.webscripts.AbstractRuntime] [http-bio
-8080-exec-4] Exception from executeScript - redirecting to status template erro
r: 01050012 Not all patches could be applied

Someone could tell me, why the services are null but ApplicationContext contains them?