Acosix / alfresco-simple-content-stores

Addon to provide a set of common content store implementations and easy-to-use configuration (no Spring config)
Apache License 2.0
43 stars 19 forks source link

Docker installation #27

Closed lukacsbarni closed 3 years ago

lukacsbarni commented 4 years ago

Hello,

I tried to implement alfresco-simple-content-stores with Docker. The Alfresco version is 6.2. I use the following configuration:

simpleContentStores.enabled=true
simpleContentStores.customStores=myCustomFileStore
simpleContentStores.rootStore=myCustomFileStore
simpleContentStores.customStore.myCustomFileStore.type=standardFileStore
simpleContentStores.customStore.myCustomFileStore.value.rootAbsolutePath=/usr/local/tomcat/alf_data/myContentStore
simpleContentStores.customStore.myCustomFileStore.value.deleteEmptyDirs=true
simpleContentStores.customStore.myCustomFileStore.value.fixedLimit=104857600

I receive this error in the log file:

alfresco_1               | 2020-05-20 12:08:14,869  INFO  [repo.admin.ConfigurationChecker] [localhost-startStop-1] The root data directory ('dir.root') is: /usr/local/tomcat/alf_data
alfresco_1               | 2020-05-20 12:08:14,875  INFO  [management.subsystems.ChildApplicationContextFactory] [localhost-startStop-1] Starting 'ContentStore' subsystem, ID: [ContentStore, managed, simple-content-stores]
alfresco_1               | 2020-05-20 12:08:14,921  INFO  [repo.beans.SimpleContentStoresBeanDefinitionEmitter] [localhost-startStop-1] Generating simple-content-stores bean definitions
alfresco_1               | 2020-05-20 12:08:14,924  INFO  [repo.beans.SimpleContentStoresBeanDefinitionEmitter] [localhost-startStop-1] Defined custom store names: myCustomFileStore
alfresco_1               | 2020-05-20 12:08:14,924  WARN  [repo.beans.SimpleContentStoresBeanDefinitionEmitter] [localhost-startStop-1] Custom store myCustomFileStore does not define a type
alfresco_1               | 2020-05-20 12:08:14,925  WARN  [management.subsystems.ChildApplicationContextFactory] [localhost-startStop-1] Startup of 'ContentStore' subsystem, ID: [ContentStore, managed, simple-content-stores] failed
alfresco_1               | org.alfresco.error.AlfrescoRuntimeException: 04200018 myCustomFileStore (custom content store) has not been given a type
alfresco_1               |      at de.acosix.alfresco.simplecontentstores.repo.beans.SimpleContentStoresBeanDefinitionEmitter.emitCustomStoreBeanDefinition(SimpleContentStoresBeanDefinitionEmitter.java:225)
alfresco_1               |      at de.acosix.alfresco.simplecontentstores.repo.beans.SimpleContentStoresBeanDefinitionEmitter.emitCustomStoreBeanDefinitions(SimpleContentStoresBeanDefinitionEmitter.java:182)
alfresco_1               |      at de.acosix.alfresco.simplecontentstores.repo.beans.SimpleContentStoresBeanDefinitionEmitter.postProcessBeanDefinitionRegistry(SimpleContentStoresBeanDefinitionEmitter.java:149)
alfresco_1               |      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
alfresco_1               |      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:125)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
alfresco_1               |      at org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ApplicationContextState.start(ChildApplicationContextFactory.java:824)
alfresco_1               |      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:1098)
alfresco_1               |      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:1064)
alfresco_1               |      at org.alfresco.repo.management.subsystems.SwitchableApplicationContextFactory$SwitchableState.start(SwitchableApplicationContextFactory.java:125)
alfresco_1               |      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:1098)
alfresco_1               |      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.getState(AbstractPropertyBackedBean.java:320)
alfresco_1               |      at org.alfresco.repo.management.subsystems.SwitchableApplicationContextFactory.getApplicationContext(SwitchableApplicationContextFactory.java:74)
alfresco_1               |      at org.alfresco.repo.management.subsystems.SubsystemProxyFactory.locateBean(SubsystemProxyFactory.java:181)
alfresco_1               |      at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:79)
alfresco_1               |      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
alfresco_1               |      at org.alfresco.repo.management.subsystems.CryptodocSubsystemProxyFactory$1.invoke(CryptodocSubsystemProxyFactory.java:60)
alfresco_1               |      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
alfresco_1               |      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
alfresco_1               |      at com.sun.proxy.$Proxy26.getReader(Unknown Source)
alfresco_1               |      at org.alfresco.repo.content.ContentServiceImpl.getReader(ContentServiceImpl.java:478)
alfresco_1               |      at org.alfresco.repo.content.ContentServiceImpl.getReader(ContentServiceImpl.java:430)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker.check(ConfigurationChecker.java:191)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker.access$0(ConfigurationChecker.java:167)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker$1$1.doWork(ConfigurationChecker.java:155)
alfresco_1               |      at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:602)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker$1.execute(ConfigurationChecker.java:151)
alfresco_1               |      at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
alfresco_1               |      at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:338)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker.onBootstrap(ConfigurationChecker.java:161)
alfresco_1               |      at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
alfresco_1               |      at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:221)
alfresco_1               |      at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:186)
alfresco_1               |      at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:206)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
alfresco_1               |      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
alfresco_1               |      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
alfresco_1               |      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
alfresco_1               |      at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
alfresco_1               |      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699)
alfresco_1               |      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165)
alfresco_1               |      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
alfresco_1               |      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
alfresco_1               |      at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:129)
alfresco_1               |      at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:150)
alfresco_1               |      at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:140)
alfresco_1               |      at java.base/java.security.AccessController.doPrivileged(Native Method)
alfresco_1               |      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:717)
alfresco_1               |      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
alfresco_1               |      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
alfresco_1               |      at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1859)
alfresco_1               |      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
alfresco_1               |      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
alfresco_1               |      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
alfresco_1               |      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
alfresco_1               |      at java.base/java.lang.Thread.run(Thread.java:834)
alfresco_1               | 2020-05-20 12:08:14,938  ERROR [web.context.ContextLoader] [localhost-startStop-1] Context initialization failed
alfresco_1               | org.alfresco.error.AlfrescoRuntimeException: 04200018 myCustomFileStore (custom content store) has not been given a type
alfresco_1               |      at de.acosix.alfresco.simplecontentstores.repo.beans.SimpleContentStoresBeanDefinitionEmitter.emitCustomStoreBeanDefinition(SimpleContentStoresBeanDefinitionEmitter.java:225)
alfresco_1               |      at de.acosix.alfresco.simplecontentstores.repo.beans.SimpleContentStoresBeanDefinitionEmitter.emitCustomStoreBeanDefinitions(SimpleContentStoresBeanDefinitionEmitter.java:182)
alfresco_1               |      at de.acosix.alfresco.simplecontentstores.repo.beans.SimpleContentStoresBeanDefinitionEmitter.postProcessBeanDefinitionRegistry(SimpleContentStoresBeanDefinitionEmitter.java:149)
alfresco_1               |      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
alfresco_1               |      at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:125)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
alfresco_1               |      at org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ApplicationContextState.start(ChildApplicationContextFactory.java:824)
alfresco_1               |      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:1098)
alfresco_1               |      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:1064)
alfresco_1               |      at org.alfresco.repo.management.subsystems.SwitchableApplicationContextFactory$SwitchableState.start(SwitchableApplicationContextFactory.java:125)
alfresco_1               |      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:1098)
alfresco_1               |      at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.getState(AbstractPropertyBackedBean.java:320)
alfresco_1               |      at org.alfresco.repo.management.subsystems.SwitchableApplicationContextFactory.getApplicationContext(SwitchableApplicationContextFactory.java:74)
alfresco_1               |      at org.alfresco.repo.management.subsystems.SubsystemProxyFactory.locateBean(SubsystemProxyFactory.java:181)
alfresco_1               |      at org.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:79)
alfresco_1               |      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
alfresco_1               |      at org.alfresco.repo.management.subsystems.CryptodocSubsystemProxyFactory$1.invoke(CryptodocSubsystemProxyFactory.java:60)
alfresco_1               |      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
alfresco_1               |      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
alfresco_1               |      at com.sun.proxy.$Proxy26.getReader(Unknown Source)
alfresco_1               |      at org.alfresco.repo.content.ContentServiceImpl.getReader(ContentServiceImpl.java:478)
alfresco_1               |      at org.alfresco.repo.content.ContentServiceImpl.getReader(ContentServiceImpl.java:430)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker.check(ConfigurationChecker.java:191)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker.access$0(ConfigurationChecker.java:167)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker$1$1.doWork(ConfigurationChecker.java:155)
alfresco_1               |      at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:602)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker$1.execute(ConfigurationChecker.java:151)
alfresco_1               |      at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
alfresco_1               |      at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:338)
alfresco_1               |      at org.alfresco.repo.admin.ConfigurationChecker.onBootstrap(ConfigurationChecker.java:161)
alfresco_1               |      at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
alfresco_1               |      at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:221)
alfresco_1               |      at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:186)
alfresco_1               |      at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:206)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:402)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:359)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:896)
alfresco_1               |      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
alfresco_1               |      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
alfresco_1               |      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
alfresco_1               |      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
alfresco_1               |      at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
alfresco_1               |      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699)
alfresco_1               |      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165)
alfresco_1               |      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
alfresco_1               |      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
alfresco_1               |      at org.apache.catalina.core.ContainerBase.access$000(ContainerBase.java:129)
alfresco_1               |      at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:150)
alfresco_1               |      at org.apache.catalina.core.ContainerBase$PrivilegedAddChild.run(ContainerBase.java:140)
alfresco_1               |      at java.base/java.security.AccessController.doPrivileged(Native Method)
alfresco_1               |      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:717)
alfresco_1               |      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
alfresco_1               |      at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
alfresco_1               |      at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1859)
alfresco_1               |      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
alfresco_1               |      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
alfresco_1               |      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
alfresco_1               |      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
alfresco_1               |      at java.base/java.lang.Thread.run(Thread.java:834)

Could you please provide me a hint?

AFaust commented 4 years ago

How specifically did you set these configuration properties? When using the Alfresco Docker images, the default is generally to specify them via the JAVA_OPTS environment variable as -D parameters, which has various drawbacks. Specifically, that does not support "dynamic properties", i.e. all properties that have not been pre-defined and may be dependent on other input / configuration - in this case, the configuration properties not processed are those including "myCustomFileStore" in the name. I have suggested an improvement to Alfresco that would deal with this limitation in their Docker images, but so far it has not even been considered. With the default Alfresco Docker images in their current state, using simple content stores requires that these configuration properties be set in an alfresco-global.properties file directly - either by including a custom configuration-only module, integrating them in an existing module of your own, or building a custom Alfresco Docker image and setting these values inside the pre-packaged ../shared/classes/alfresco-global.properties file.

lukacsbarni commented 4 years ago

Yes, I specified as environment variables with "-D". I will try to put into the ../shared/classes/alfresco-global.properties file.