I am trying to use the Java public API :
public EpicDocument upload(EpicDocument doc) { logger.info("creating new EpicDocument..."); StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore"); NodeRef root = nodeService.getRootNode(storeRef); QName type = QName.createQName(EPIC_NAMESPACE_URI, "document"); Map<QName, Serializable> props = new HashMap<>(); props.put(ContentModel.PROP_NAME, doc.getPath()); props.put(QName.createQName(EPIC_NAMESPACE_URI, "fileName"), "FILENAMEEEEEEE132423"); NodeRef nodeRef = nodeService.createNode(root, ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "myNameIsMehrdad"), type, props).getChildRef(); ContentWriter contentWriter = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true); contentWriter.setMimetype(MimetypeMap.MIMETYPE_TEXT_PLAIN); contentWriter.setEncoding("UTF-8"); contentWriter.putContent(new ByteArrayInputStream(doc.getBytes())); logger.info("EpicDocument created with NodeRef = {}", nodeRef.toString()); return doc; }
but I get this error :
Caused by: org.alfresco.service.transaction.ReadOnlyServerException: 04100056 Access Denied. The system is currently in read-only mode. at org.alfresco.repo.domain.node.AbstractNodeDAOImpl.getCurrentTransaction(AbstractNodeDAOImpl.java:650) at org.alfresco.repo.domain.node.AbstractNodeDAOImpl.newNodeImpl(AbstractNodeDAOImpl.java:1366) at org.alfresco.repo.domain.node.AbstractNodeDAOImpl.newNode(AbstractNodeDAOImpl.java:1290) at org.alfresco.repo.node.db.DbNodeServiceImpl.createNode_aroundBody24(DbNodeServiceImpl.java:392) at org.alfresco.repo.node.db.DbNodeServiceImpl$AjcClosure25.run(DbNodeServiceImpl.java:1) at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:167) at org.alfresco.traitextender.RouteExtensions.intercept(RouteExtensions.java:100) at org.alfresco.repo.node.db.DbNodeServiceImpl.createNode(DbNodeServiceImpl.java:342) at jdk.internal.reflect.GeneratedMethodAccessor204.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.alfresco.repo.lock.mem.LockableAspectInterceptor.invoke(LockableAspectInterceptor.java:244) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy37.createNode(Unknown Source) at jdk.internal.reflect.GeneratedMethodAccessor204.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.alfresco.repo.tenant.MultiTNodeServiceInterceptor.invoke(MultiTNodeServiceInterceptor.java:111) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy37.createNode(Unknown Source) at jdk.internal.reflect.GeneratedMethodAccessor204.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.alfresco.repo.service.StoreRedirectorProxyFactory$RedirectorInvocationHandler.invoke(StoreRedirectorProxyFactory.java:231) at com.sun.proxy.$Proxy58.createNode(Unknown Source) at org.alfresco.repo.node.MLPropertyInterceptor.invoke(MLPropertyInterceptor.java:284) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.alfresco.repo.node.NodeRefPropertyMethodInterceptor.invoke(NodeRefPropertyMethodInterceptor.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) at com.sun.proxy.$Proxy37.createNode(Unknown Source) at jdk.internal.reflect.GeneratedMethodAccessor204.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:205) at com.sun.proxy.$Proxy37.createNode(Unknown Source) at com.mhr.alf.epic.service.EpicContentServiceImpl.upload(EpicContentServiceImpl.java:56) at com.mhr.alf.epic.listener.AlfUploadQueueListener.onUpload(AlfUploadQueueListener.java:43) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:171) at org.springframework.messaging.handler.invocation.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:120) at org.springframework.amqp.rabbit.listener.adapter.DelegatingInvocableHandler.invoke(DelegatingInvocableHandler.java:130) at org.springframework.amqp.rabbit.listener.adapter.HandlerAdapter.invoke(HandlerAdapter.java:61) at org.springframework.amqp.rabbit.listener.adapter.MessagingMessageListenerAdapter.invokeHandler(MessagingMessageListenerAdapter.java:196)
what is the problem?
I am using community version 6.2.0-ga
I wish I had chosen Nuxeo.
your documentation is poor.
Hi @4rsenaltt,
What environment are you using?
my OS is Linux and I deployed Alfresco content service (VERSION 6.2.0-GA) plus my module docker image mad by SDK version 4, then in the module Spring Context I defined some RabbitMQ beans to listen to an AMQP queue and create nodes(calling the upload() method above).
is there any problem with this design?
Hi @4rsenaltt,
This error message is usually associated with running Enterprise without a valid licence.
If you're looking to use Alfresco beyond the licence time limit, you can install the Community Edition using a Docker installer.
HTH,
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.