As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
13:29:01,257 User:admin ERROR [repo.transaction.AlfrescoTransactionSupport] After completion (committed) listener exception: listener: org.myorg.module.myapp.service.MyService@c937c8 org.alfresco.error.AlfrescoRuntimeException: onCommit cache modifications are not allowed. at org.alfresco.repo.cache.TransactionalCache.put(TransactionalCache.java:398) at org.alfresco.repo.ownable.impl.OwnableServiceImpl.getOwner(OwnableServiceImpl.java:144) at org.alfresco.repo.security.permissions.dynamic.OwnerDynamicAuthority.hasAuthority(OwnerDynamicAuthority.java:58) at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.getAuthorisations(PermissionServiceImpl.java:447) at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.hasPermission(PermissionServiceImpl.java:345) at org.alfresco.repo.security.permissions.impl.PermissionServiceImpl.hasPermission(PermissionServiceImpl.java:577) at sun.reflect.GeneratedMethodAccessor266.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210) at $Proxy14.hasPermission(Unknown Source)
<!– Instantiate the custom Service. –> <bean id="myService" class="org.myorg.module.MyPackage.service.MyService" init-method="init"> <property name="serviceRegistry"> <ref bean="ServiceRegistry" /> </property> <property name="policyComponent"> <ref bean="policyComponent" /> </property> <property name="dirRoot"> <value>${dir.root}</value> </property> </bean>
/** * Returns the list of all country categories. The first time you call this, * the list is actually fetched from the repository but cached afterwards, so that * subsequent calls are very fast. */ public List<NodeRef> getCachedCountryHierarchy() { // … NodeRef tag = …; List<ChildAssociationRef> childAssocs = nodeService.getChildAssocs(tag); // (*) // … }
<bean id="module.cayman" class="org.alfresco.module.cayman.Main" parent="module.baseComponent" init-method="init"> <property name="nodeService"> <ref bean="NodeService" /> </property> </bean>
public class Main extends AbstractModuleComponent { private NodeService nodeService; public void setNodeService(NodeService nodeService) { this.nodeService = nodeService; } public void init() { System.out.println("Init of Cayman module"); logger.debug("Init of Cayman module"); StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore"); NodeRef ref1 = new NodeRef(storeRef, "/app:company_home/cm:Cayman"); System.out.println(nodeService.exists(ref1)); } }
17:53:58,241 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'module.cayman' defined in file [D:\alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\cayman\module-context.xml]: Invocation of init method failed; nested exception is net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A valid SecureContext was not provided in the RequestContext Caused by: net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A valid SecureContext was not provided in the RequestContext at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:477) at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:355) at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77) (and so on…)