cancel
Showing results for 
Search instead for 
Did you mean: 

Transaction must be active and synchronization is required

antonkronseder
Champ in-the-making
Champ in-the-making
Dear alfresco community,
after migrating from LABS 3.0a to 3.0b,3.0c,3.0d(Final) aka 3.1 and 3.2 Preview aka 3.0e I always have the following Exception.
Btw: everything runs fine with LABS 3.0a and Enterprise 3.0.

I fetch a Ticket by using RESTLET:

Login
GET /alfresco/service/api/login?u={username}&pw={password?}


And use this ticket to e.g create a new site with my own java based webscript:


create a site
POST /alfresco/service/hd/site?shortName={shortName}

create a site by its shortName.

Authentication:   admin
Transaction:   required
Format Style:   extension
Default Format:   json
Id:   de/hdgmbh/site/site.post
Descriptor:   classpath:alfresco/templates/webscripts/de/hdgmbh/site/site.post.desc.xml



Web Script Status 500 - Internal Error

org.alfresco.error.AlfrescoRuntimeException - Transaction must be active and synchronization is required: Thread[http-8181-5,5,main]
org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:432)
org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:416)
org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:209)
org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.getFlushData(DirtySessionMethodInterceptor.java:213)org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.invoke(DirtySessionMethodInterceptor.java:354)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy2.getNodePair(Unknown Source)
org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:153)


In the webscript desc.xml I tried it with:    
<transaction>required</transaction>
and with
<transaction>requiresnew</transaction>

Any help would be appreciated.

Thanks in advance,

Anton Kronseder
9 REPLIES 9

derek
Star Contributor
Star Contributor
Hi,
Please post the full stack trace.
Regards

antonkronseder
Champ in-the-making
Champ in-the-making
Sorry for posting it not in the first time.
BTW: It looks like it works, lets say a couple of times (1-5) with the same TICKET. But after the Test fetches a new TICKET - for the same user - it looks like after the second or third time the following Exceptions will be thrown.
Any suggestions?

Best regards,

Anton Kronseder


15:50:16,083 DEBUG [repository.site.CreateSiteCommand] Creating site: testShortName
15:50:16,318 DEBUG [alfresco.connect.HttpUrlConnectionRestCommandConnection] Sending JSONString: {"title":"test title","shortName":"testShortName","owner":"alfredAus","u":"admin","description":"test description","sitePreset":"testSitePreset","contentType":"application/json","alf_ticket":"TICKET_9305f8560829f2776a1f53b4b5750b3d46537059","isPublic":"true"}
15:50:33,241 DEBUG [alfresco.connect.HttpUrlConnectionRestCommandConnection] Cannot execute http://localhost:8181/alfresco/service/hd/site?shortName=testShortName&u=admin&alf_ticket=TICKET_930...
java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8181/alfresco/service/hd/site?shortName=testShortName&u=admin&alf_ticket=TICKET_930...
   at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1170)
   at de.hdgmbh.zdmf.alfresco.connect.HttpUrlConnectionRestCommandConnection.getInputStream(HttpUrlConnectionRestCommandConnection.java:246)
   at de.hdgmbh.zdmf.alfresco.connect.HttpUrlConnectionRestCommandConnection.retrieveResponse(HttpUrlConnectionRestCommandConnection.java:399)
   at de.hdgmbh.zdmf.alfresco.connect.HttpUrlConnectionRestCommandConnection.sendRequest(HttpUrlConnectionRestCommandConnection.java:312)
   at de.hdgmbh.zdmf.alfresco.command.repository.site.CreateSiteCommand.execute(CreateSiteCommand.java:99)
   at de.hdgmbh.zdmf.alfresco.command.AbstractRestCommand.execute(AbstractRestCommand.java:118)
   at de.hdgmbh.zdmf.alfresco.command.AbstractManagementCommand.execute(AbstractManagementCommand.java:105)
   at de.hdgmbh.zdmf.alfresco.facade.RetryOnInvalidTicketCommand.execute(RetryOnInvalidTicketCommand.java:134)
   at it.de.hdgmbh.zdmf.des.filebasics.AbstractAlfrescoTestBase.createSite(AbstractAlfrescoTestBase.java:567)
   at it.de.hdgmbh.zdmf.des.filebasics.SiteTest.testCreateSiteWithOwner(SiteTest.java:93)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
   at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
   at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
   at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
15:50:33,256 DEBUG [alfresco.connect.HttpUrlConnectionRestCommandConnection] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <title>Web Script Status 500 - Internal Error</title>
      <link rel="stylesheet" href="/alfresco/css/base.css" type="text/css" />
   </head>
   <body>
      <div>
         <table>
            <tr>
               <td><img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" /></td>
               <td><span class="title">Web Script Status 500 - Internal Error</span></td>
            </tr>
         </table>
         <br/>
         <table>
            <tr><td>The Web Script <a href="/alfresco/service/hd/site?shortName=testShortName&u=admin&alf_ticket=TICKET_9305f8560829f2776a1f53b4b5750b3d46537059">/alfresco/service/hd/site</a> has responded with a status of 500 - Internal Error.</td></tr>
         </table>
         <br/>
         <table>
            <tr><td><b>500 Description:</b></td><td> An error inside the HTTP server which prevented it from fulfilling the request.</td></tr>
            <tr><td> </td></tr>
            <tr><td><b>Message:</b></td><td>Transaction must be active and synchronization is required: Thread[7295415@qtp0-0,5,main]</td></tr>
            <tr><td></td><td> </td></tr>
   <tr><td><b>Exception:</b></td><td>org.alfresco.error.AlfrescoRuntimeException - Transaction must be active and synchronization is required: Thread[7295415@qtp0-0,5,main]</td></tr>
   <tr><td></td><td> </td></tr>
         <tr><td></td><td>org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:432)</td></tr>
         <tr><td></td><td>org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:416)</td></tr>
         <tr><td></td><td>org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:209)</td></tr>
         <tr><td></td><td>org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.getFlushData(DirtySessionMethodInterceptor.java:213)</td></tr>
         <tr><td></td><td>org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.invoke(DirtySessionMethodInterceptor.java:354)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</td></tr>
         <tr><td></td><td>$Proxy2.getNodePair(Unknown Source)</td></tr>
         <tr><td></td><td>org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:153)</td></tr>
         <tr><td></td><td>org.alfresco.repo.node.db.DbNodeServiceImpl.getParentAssocs(DbNodeServiceImpl.java:1327)</td></tr>
         <tr><td></td><td>org.alfresco.repo.node.AbstractNodeServiceImpl.getParentAssocs(AbstractNodeServiceImpl.java:580)</td></tr>
         <tr><td></td><td>sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)</td></tr>
         <tr><td></td><td>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</td></tr>
         <tr><td></td><td>java.lang.reflect.Method.invoke(Method.java:597)</td></tr>
         <tr><td></td><td>org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)</td></tr>
         <tr><td></td><td>org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invokeInternal(SingleEntryTransactionResourceInterceptor.java:154)</td></tr>
         <tr><td></td><td>org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invoke(SingleEntryTransactionResourceInterceptor.java:138)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</td></tr>
         <tr><td></td><td>$Proxy7.getParentAssocs(Unknown Source)</td></tr>
         <tr><td></td><td>sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)</td></tr>
         <tr><td></td><td>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</td></tr>
         <tr><td></td><td>java.lang.reflect.Method.invoke(Method.java:597)</td></tr>
         <tr><td></td><td>org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)</td></tr>
         <tr><td></td><td>org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:110)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</td></tr>
         <tr><td></td><td>$Proxy7.getParentAssocs(Unknown Source)</td></tr>
         <tr><td></td><td>sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)</td></tr>
         <tr><td></td><td>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</td></tr>
         <tr><td></td><td>java.lang.reflect.Method.invoke(Method.java:597)</td></tr>
         <tr><td></td><td>org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221)</td></tr>
         <tr><td></td><td>$Proxy8.getParentAssocs(Unknown Source)</td></tr>
         <tr><td></td><td>sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source)</td></tr>
         <tr><td></td><td>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</td></tr>
         <tr><td></td><td>java.lang.reflect.Method.invoke(Method.java:597)</td></tr>
         <tr><td></td><td>org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)</td></tr>
         <tr><td></td><td>org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)</td></tr>
         <tr><td></td><td>org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)</td></tr>
         <tr><td></td><td>org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:274)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)</td></tr>
         <tr><td></td><td>org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:274)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)</td></tr>
         <tr><td></td><td>org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</td></tr>
         <tr><td></td><td>$Proxy7.getParentAssocs(Unknown Source)</td></tr>
         <tr><td></td><td>org.alfresco.repo.security.authority.AuthorityDAOImpl.findAuthorities(AuthorityDAOImpl.java:366)</td></tr>
         <tr><td></td><td>org.alfresco.repo.security.authority.AuthorityDAOImpl.findAuthorities(AuthorityDAOImpl.java:287)</td></tr>
         <tr><td></td><td>org.alfresco.repo.security.authority.AuthorityDAOImpl.getContainingAuthorities(AuthorityDAOImpl.java:259)</td></tr>
         <tr><td></td><td>org.alfresco.repo.security.authority.AuthorityServiceImpl.getContainingAuthorities(AuthorityServiceImpl.java:290)</td></tr>
         <tr><td></td><td>org.alfresco.repo.security.authority.AuthorityServiceImpl.getAuthoritiesForUser(AuthorityServiceImpl.java:168)</td></tr>
         <tr><td></td><td>org.alfresco.repo.security.authority.AuthorityServiceImpl.hasAdminAuthority(AuthorityServiceImpl.java:143)</td></tr>
         <tr><td></td><td>org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:267)</td></tr>
         <tr><td></td><td>org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:261)</td></tr>
         <tr><td></td><td>org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)</td></tr>
         <tr><td></td><td>org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:116)</td></tr>
         <tr><td></td><td>javax.servlet.http.HttpServlet.service(HttpServlet.java:820)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.Server.handle(Server.java:324)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)</td></tr>
         <tr><td></td><td>org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)</td></tr>
         <tr><td></td><td>org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)</td></tr>
         <tr><td></td><td>org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)</td></tr>
   <tr><td></td><td> </td></tr>
            <tr><td><b>Server</b>:</td><td>Alfresco Labs v3.0.0 (Stable 1526) schema 1.002</td></tr>
            <tr><td><b>Time</b>:</td><td>28.04.2009 15:50:33</td></tr>
            <tr><td></td><td> </td></tr>
            <tr><td><b>Diagnostics</b>:</td><td><a href="/alfresco/service/script/de/hdgmbh/site/site.post">Inspect Web Script (de/hdgmbh/site/site.post)</a></td></tr>
         </table>
      </div>
   </body>
</html>

derek
Star Contributor
Star Contributor
Hi,

You mentioned that you had upgraded to 3.2, but the following:
Alfresco Labs v3.0.0 (Stable 1526) schema 1.002
indicates otherwise.  Without having to go back in the code to see if an issue existed, could you run it on the latest (HEAD) code.

The particular service being called is wrapped in Spring transaction wrappers, so it's surprising that the error occurs, but I've not checked the files' SVN histories.

Regards

antonkronseder
Champ in-the-making
Champ in-the-making
As I did not want to post exceptions of a preview when they also occur in the last stable version I pasted the exception from the 3.1 Version.
But never the less you are right with the quoted log snipplet: it says 3.0.0
Astonishingly the version.properties information in alfresco-labs-war-3e dev.zip\alfresco.war\WEB-INF\classes\version.properties is:


version.major=3
version.minor=0
version.revision=0
version.label=e dev

version.edition=Labs

version.build=1688

version.schema=2008

Moreover the link of the alfresco LABS wiki page http://wiki.alfresco.com/wiki/Download_Labs
->
Labs 3.1 Final, the last release of the 3.1 series.
links to http://wiki.alfresco.com/wiki/Labs_3_Final_download_files  where I receive a
alfresco-labs-war-3Stable.zip
with a alfresco-labs-war-3Stable.zip\alfresco.war\WEB-INF\classes\version.properties file:


version.major=3
version.minor=0
version.revision=0
version.label=Stable

version.edition=Labs

version.build=1526

version.schema=1002

Also a 3.0.0 ??.

[size=120]So I will follow your advice and checkout alfresco and build it for my own.[/size]

BTQ: the version.properties of the svn repository
http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/projects/repository/config/alfresco...
is correct:



version.major=3
version.minor=2
version.revision=0
version.label=_Preview2_dev

version.edition=Labs

version.build=@build-number@

version.schema=2011

Thanks for your hints.
I will try it and reply to this post.

Best regards,

Anton Kronseder

antonkronseder
Champ in-the-making
Champ in-the-making
In the Alfresco 3.2 Preview2 this Exception no longer occurs.
Thanks for your tip.

chriss
Champ in-the-making
Champ in-the-making
I got this error on Labs 3.2 Preview 2.  New to Web Scripts and doing a simple helloworld example from a book, added the controller piece helloworld.get.js and this is what it threw:

07:25:03,877 User:admin ERROR [web.scripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 05260026 Wrapped Exception (with status template): 05260025 Transaction must be active and synchronization is required: Thread[http-8443-3,5,main]
org.alfresco.web.scripts.WebScriptException: 05260026 Wrapped Exception (with status template): 05260025 Transaction must be active and synchronization is required: Thread[http-8443-3,5,main]
        at org.alfresco.web.scripts.AbstractWebScript.createStatusException(AbstractWebScript.java:613)
        at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:165)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:305)
        at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:390)
        at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:238)
        at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:262)
        at org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
        at org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
        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.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:128)
        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:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.alfresco.error.AlfrescoRuntimeException: 05260025 Transaction must be active and synchronization is required: Thread[http-8443-3,5,main]
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:435)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:419)
        at org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:212)
        at org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.getFlushData(DirtySessionMethodInterceptor.java:213)
        at org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.invoke(DirtySessionMethodInterceptor.java:354)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy2.getNodePair(Unknown Source)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:154)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.getPaths(DbNodeServiceImpl.java:1865)
        at org.alfresco.repo.node.db.DbNodeServiceImpl.getPath(DbNodeServiceImpl.java:1849)
        at sun.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invokeInternal(SingleEntryTransactionResourceInterceptor.java:154)
        at org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invoke(SingleEntryTransactionResourceInterceptor.java:138)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy4.getPath(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:110)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy4.getPath(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221)
        at $Proxy5.getPath(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:274)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:274)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy4.getPath(Unknown Source)
        at org.alfresco.repo.web.scripts.RepoStore.getPath(RepoStore.java:293)
        at org.alfresco.repo.web.scripts.RepoStore.getBaseDir(RepoStore.java:258)
        at org.alfresco.repo.web.scripts.RepoStore.access$000(RepoStore.java:77)
        at org.alfresco.repo.web.scripts.RepoStore$RepoScriptContent.getPathDescription(RepoStore.java:947)
        at org.alfresco.repo.web.scripts.RepositoryScriptProcessor$RepositoryScriptLocation.toString(RepositoryScriptProcessor.java:202)
        at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:282)
        at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:108)
        at org.alfresco.web.scripts.AbstractWebScript.executeScript(AbstractWebScript.java:819)
        at org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:90)
        … 19 more

sversh71
Champ in-the-making
Champ in-the-making
I got this error on Labs 3.2 Preview 2.  New to Web Scripts and doing a simple helloworld example from a book, added the controller piece helloworld.get.js…
try to change xml a little:


<webscript>
  <shortname>Hello World</shortname>
  <description>Hello world web script</description>
  <url>/helloworld?name={nameArgument}</url>
  <authentication>guest</authentication>
  <transaction>required</transaction>
  </webscript>

This answer by sversh was helpful.

akomisarek
Champ in-the-making
Champ in-the-making
Hello!

I got the same issue, but hopefully adding  

<authentication>guest</authentication>
<transaction>required</transaction>

helped.

But I wonder why is it required? Jeff in his book writes

A GET usually doesn't require a transaction

and here we need transaction when even we are not accessing repository… (I assume it shoudln't be required for read only access as well), so why we have to specify those parameters? Is it but with 3.2 build or change in way how Web Scripts are handled?

Thanks in advance,
Adam