cancel
Showing results for 
Search instead for 
Did you mean: 

Spring Transaction exception

felipe
Champ in-the-making
Champ in-the-making
Hi,
I'm trying to run samples provided with Alfresco source and I've some exceptions concerning spring transactions.

Login works fine,
// Retrieve Company Home
Node root = session.getRootNode();
Node companyHome = root.getNode("app:company_home");

works fine too, but when I want to access to the companyHome variable for the getNodes() method, transaction is marked as rollbackOnly

SimpleExample.java throws the following Exception

Exception in thread "main" org.springframework.transaction.UnexpectedRollbackException: Transaction has been rolled back because it has been marked as rollback-only
   at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:465)
   at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:266)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy14.isCurrentUserTheSystemUser(Unknown Source)
   at org.alfresco.repo.security.permissions.impl.acegi.ACLEntryVoter.vote(ACLEntryVoter.java:189)
   at net.sf.acegisecurity.vote.AffirmativeBased.decide(AffirmativeBased.java:69)
   at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:394)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:37)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy22.getCurrentUserName(Unknown Source)
   at org.alfresco.jcr.util.JCRProxyFactory$SessionContextInvocationHandler.invoke(JCRProxyFactory.java:116)
   at $Proxy66.logout(Unknown Source)
   at org.alfresco.jcr.example.SimpleExample.main(SimpleExample.java:82)


SimpleExampleWithContent.java seems to work fine however.

Can anybody  help me???

Regards,
Phil
1 REPLY 1

anediaz
Champ in-the-making
Champ in-the-making
Hi,
I've found this, it may help you:

"
My test program has the following JARS in the classpath
- jcr-1.0.jar
- extension-jcr-thread-bound.jar
- extension-jcr-rmi.jar
- jcr-rmi-1-impl-classes.jar
"



I've a similar problem but I haven't fixed it. If you achieve to do anything please tell me, because I also have a problem when calling to "getNodes()"