cancel
Showing results for 
Search instead for 
Did you mean: 

Exception Thrown when adding a model

rjewson
Champ in-the-making
Champ in-the-making
Hi,

I have a clean install of 3.2.  I create a simple helloworld.get.desc.xml and helloworld.get.html.ftl with basic content. Everything works ok.  As soon as I add helloworld.get.js (empty, or with content) I get the following stack trace:


500 Description:    An error inside the HTTP server which prevented it from fulfilling the request.

Message:   07070085 Wrapped Exception (with status template): 07070084 Transaction must be active and synchronization is required: Thread[http-8080-4,5,main]
   
Exception:   org.alfresco.error.AlfrescoRuntimeException - 07070084 Transaction must be active and synchronization is required: Thread[http-8080-4,5,main]
   
   org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:436)
   org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:420)
   org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:213)
   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:171)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   $Proxy7.getNodePair(Unknown Source)
   org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:155)
   org.alfresco.repo.node.db.DbNodeServiceImpl.getPaths(DbNodeServiceImpl.java:1891)
   org.alfresco.repo.node.db.DbNodeServiceImpl.getPath(DbNodeServiceImpl.java:1875)
   sun.reflect.GeneratedMethodAccessor329.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invokeInternal(SingleEntryTransactionResourceInterceptor.java:154)
   org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor.invoke(SingleEntryTransactionResourceInterceptor.java:138)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   $Proxy9.getPath(Unknown Source)
   sun.reflect.GeneratedMethodAccessor329.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:110)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   $Proxy9.getPath(Unknown Source)
   sun.reflect.GeneratedMethodAccessor329.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:221)
   $Proxy10.getPath(Unknown Source)
   sun.reflect.GeneratedMethodAccessor329.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
   org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
   org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:306)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:274)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:274)
   org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
   org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   $Proxy9.getPath(Unknown Source)
   org.alfresco.repo.web.scripts.RepoStore.getPath(RepoStore.java:293)
   org.alfresco.repo.web.scripts.RepoStore.getBaseDir(RepoStore.java:258)
   org.alfresco.repo.web.scripts.RepoStore.access$000(RepoStore.java:77)
   org.alfresco.repo.web.scripts.RepoStore$RepoScriptContent.getPathDescription(RepoStore.java:947)
   org.alfresco.repo.web.scripts.RepositoryScriptProcessor$RepositoryScriptLocation.toString(RepositoryScriptProcessor.java:202)
   org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:282)
   org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:108)
   org.alfresco.web.scripts.AbstractWebScript.executeScript(AbstractWebScript.java:819)
   org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:90)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:320)
   org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:424)
   org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:253)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:262)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
   org.alfresco.web.scripts.servlet.WebScriptServlet.service(WebScriptServlet.java:122)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
   org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   java.lang.Thread.run(Thread.java:619)
   
Exception:   org.alfresco.web.scripts.WebScriptException - 07070085 Wrapped Exception (with status template): 07070084 Transaction must be active and synchronization is required: Thread[http-8080-4,5,main]

Any thoughts?
3 REPLIES 3

rjewson
Champ in-the-making
Champ in-the-making
If I add:

<authentication>user</authentication>

to the description it works ok, but if

<authentication>none</authentication> then I get the stack trace.  So the next question - what needs to be done to make the script run correctly without authentication?

lista
Star Contributor
Star Contributor
If I'm not mistaken, setting authentication to user automatically sets the transaction to true.
That's why it works that way. Try setting the authentication to guest, and transaction to true.

<transaction>true</transaction>

mikeh
Star Contributor
Star Contributor
The other point is that you can't use authentication=none and try to access the Repository.

Thanks,
Mike