AnsweredAssumed Answered

Transaction required

Question asked by alfresc0t3ster on Feb 5, 2015
Hello!

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)
<blockcode>
<webscript>
  <shortname>Testing Config Webscript</shortname>
  <description>Get Testing Confiuration based on URL Parameter</description>
  <url>/testing</url>
  <format default="text">argument</format>
  <authentication>user</authentication>
  <transaction>none</transaction>
</webscr
</blockcode>

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

service-content.xml
<blockcode>
<bean id="CmisService" class="testing.services.CmisService">
      <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" />
   </bean>
</blockcode>

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

CmisService.java
<blockcode>

   private ContentService contentService;
   private NodeService nodeService;

        ….
       
        + setter/getter for each service
</blockcode>

All services are null in my 'CmisService' class, BUT if I get my services per ApplicationContext, they are working fine:

CmisService.java
<blockcode>
ApplicationContext appContext = BaseApplicationContextHelper.getApplicationContext(new String[]{"classpath:alfresco/application-context.xml"});
contentService = (ContentService) appContext.getBean("contentService");
</blockcode>

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?

Outcomes