title: Alfresco java backed webscript returns Exception in Transaction (StackOverflowError)
body: <p>I am using Alfresco version 3.4. 
  When invoking Java backed webscript I receive <em>Exception in transaction</em> (stackoverflow, read log) error.</p>
  
  <p>HTTP response is formatted like</p>
  
  <pre><code>&lt;div&gt;
           &lt;table&gt;
              &lt;tbody&gt;&lt;tr&gt;
                 &lt;td&gt;&lt;img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco"&gt;&lt;/td&gt;
                 &lt;td&gt;&lt;span class="title"&gt;Web Script Status 500 - Internal Error&lt;/span&gt;&lt;/td&gt;
              &lt;/tr&gt;
           &lt;/tbody&gt;&lt;/table&gt;
           &lt;br&gt;
           &lt;table&gt;
              &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;The Web Script &lt;a href="/path/to/webscript/and/its/name.post"&gt;/path/to/webscript/and/its/name.post&lt;/a&gt; has responded with a status of 500 - Internal Error.&lt;/td&gt;&lt;/tr&gt;
           &lt;/tbody&gt;&lt;/table&gt;
           &lt;br&gt;
           &lt;table&gt;
              &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;500 Description:&lt;/b&gt;&lt;/td&gt;&lt;td&gt; An error inside the HTTP server which prevented it from fulfilling the request.&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;b&gt;Message:&lt;/b&gt;&lt;/td&gt;&lt;td&gt;07212496 Exception in Transaction.&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;&lt;b&gt;Exception:&lt;/b&gt;&lt;/td&gt;&lt;td&gt;org.alfresco.error.AlfrescoRuntimeException - 07212496 Exception in Transaction.&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
        &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:461)&lt;/td&gt;&lt;/tr&gt;
     &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;b&gt;Server&lt;/b&gt;:&lt;/td&gt;&lt;td&gt;Community v3.4.0 (c 3335) schema 4.113&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;b&gt;Time&lt;/b&gt;:&lt;/td&gt;&lt;td&gt;21.08.2014. 11:10:31&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;b&gt;Diagnostics&lt;/b&gt;:&lt;/td&gt;&lt;td&gt;&lt;a href="/path/to/webscript/and/its/name.post"&gt;Inspect Web Script (path/to/webscript/and/its/name.post)&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
           &lt;/tbody&gt;&lt;/table&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p>In logs I can read </p>
  
  <pre><code>14:29:20,548  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 07217738 Exception in Transaction.
  org.alfresco.error.AlfrescoRuntimeException: 07217738 Exception in Transaction.
      at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:461)
      at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:436)
      at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:466)
      at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:304)
      at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:333)
      at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:189)
      at org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:118)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
      at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
      at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
      at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
      at java.lang.Thread.run(Thread.java:619)
  Caused by: java.lang.StackOverflowError
      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:451)
      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:440)
      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.getState(AbstractPropertyBackedBean.java:221)
      at org.alfresco.repo.management.subsystems.ChildApplicationContextFactory.getApplicationContext(ChildApplicationContextFactory.java:336)
      at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:69)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      at $Proxy40.isTransformable(Unknown Source)
      at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:71)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      at $Proxy40.isTransformable(Unknown Source)
      at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:71)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
      at $Proxy40.isTransformable(Unknown Source)
      at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
  </code></pre>
  
  <p>Since its java backed webscript, I debugged whole code, no exceptions or something like it. I increased thread stack size since I'm using development environment. I've run out of ideas what to try more. </p>