Docker dies after enabling CORS in content services

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

Docker dies after enabling CORS in content services

Hi guys,

I'm trying to set up an ADF demo application

https://hub.docker.com/r/alfresco/alfresco-content-app
https://hub.docker.com/r/alfresco/demo-shell

I found some instruction manual, according to which you just need to run one command, run docker and that's it!
Nope :-( . Just another quest for a few days.

It throws out standard messages like "unknown username and password" and CORS problems.

According to the official documentation, just update web.xml to enable cors in content services 6.2:
https://docs.alfresco.com/6.2/tasks/enable-cors.html

Nope :-(. 
If I do so, this will happen:

root@miroslav-VirtualBox:/opt/share/alfresco-docker/acs# docker exec --user root -ti acs_alfresco_1 bash
[root@76d09adfb878 tomcat]# vi webapps/alfresco/WEB-INF/web.xml 


3.png

root@miroslav-VirtualBox:/opt/share/alfresco-docker/acs# docker-compose restart
Restarting acs_proxy_1                 ... done
Restarting acs_alfresco-pdf-renderer_1 ... done
Restarting acs_transform-router_1      ... done
Restarting acs_tika_1                  ... done
Restarting acs_imagemagick_1           ... done
Restarting acs_transform-misc_1        ... done
Restarting acs_libreoffice_1           ... done
Restarting acs_shared-file-store_1     ... done
Restarting acs_share_1                 ... done
Restarting acs_solr6_1                 ... done
Restarting acs_postgres_1              ... done
Restarting acs_alfresco_1              ... done
Restarting acs_sync-service_1          ... done
Restarting acs_activemq_1              ... done
Restarting acs_digital-workspace_1     ... done


http://server-virtualbox:8080/

Screenshot_1.png
docker-compose ps

Screenshot_2.png

docker logs acs_sync-service_1

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.fasterxml.jackson.module.afterburner.util.MyClassLoader (file:/opt/alfresco-sync-service/service-sync-3.3.1.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.fasterxml.jackson.module.afterburner.util.MyClassLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO [2020-04-24 08:32:48.241] [main] io.dropwizard.server.DefaultServerFactory - Registering jersey handler with root path prefix: /
INFO [2020-04-24 08:32:48.303] [main] io.dropwizard.server.DefaultServerFactory - Registering admin handler with root path prefix: /
INFO [2020-04-24 08:32:49.620] [main] org.alfresco.service.common.dropwizard.AbstractSpringDropwizardService - Application version : 3.3.1 (168)
INFO [2020-04-24 08:33:10.990] [main] org.alfresco.service.subscription.impl.config.ConfigurationImpl - get: http://alfresco:8080/alfresco/service/devicesync/config
INFO [2020-04-24 08:33:16.119] [main] org.alfresco.util.RetryConnectionCommand - retry to connect! Read timed out
INFO [2020-04-24 08:33:26.126] [main] org.alfresco.util.RetryConnectionCommand - retry to connect! Read timed out
INFO [2020-04-24 08:33:36.134] [main] org.alfresco.util.RetryConnectionCommand - retry to connect! Read timed out
INFO [2020-04-24 08:33:46.139] [main] org.alfresco.util.RetryConnectionCommand - retry to connect! Read timed out
INFO [2020-04-24 08:33:56.141] [main] org.alfresco.util.RetryConnectionCommand - retry to connect! Read timed out
INFO [2020-04-24 08:34:06.150] [main] org.alfresco.util.RetryConnectionCommand - retry to connect! Read timed out
INFO [2020-04-24 08:34:16.156] [main] org.alfresco.util.RetryConnectionCommand - retry to connect! Read timed out
INFO [2020-04-24 08:34:26.162] [main] org.alfresco.util.RetryConnectionCommand - retry to connect! Read timed out
ERROR [2020-04-24 08:34:32.540] [main] org.alfresco.service.subscription.impl.config.ConfigurationImpl - Exception getting sync service configuration from repository
org.alfresco.error.AlfrescoRuntimeException: 03240000 Problem getting sync service configuration from repository: HTTP/1.1 404
at org.alfresco.service.subscription.impl.config.ConfigurationImpl.getSyncConfigEntry(ConfigurationImpl.java:148)
at org.alfresco.service.subscription.impl.config.ConfigurationImpl.getSyncServiceConfig(ConfigurationImpl.java:78)
at org.alfresco.service.subscription.impl.config.ConfigurationImpl.<init>(ConfigurationImpl.java:65)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:300)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:285)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1340)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1186)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:303)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1674)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1426)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.alfresco.service.common.dropwizard.AbstractSpringDropwizardService.initSpring(AbstractSpringDropwizardService.java:99)
at org.alfresco.service.common.dropwizard.AbstractSpringDropwizardService.run(AbstractSpringDropwizardService.java:173)
at org.alfresco.service.common.dropwizard.AbstractSpringDropwizardService.run(AbstractSpringDropwizardService.java:38)
at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
at io.dropwizard.cli.Cli.run(Cli.java:78)
at io.dropwizard.Application.run(Application.java:93)
at org.alfresco.service.sync.dropwizard.SyncService.main(SyncService.java:66)

docker logs acs_alfresco_1

24-Apr-2020 08:34:40.722 INFO [JobLockService1] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [org.alfresco.repo.lock.JobLockServiceImpl$4]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
	java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.alfresco.repo.lock.JobLockServiceImpl$4]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
		at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1380)
		at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1368)
		at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1220)
		at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1182)
		at org.alfresco.repo.lock.JobLockServiceImpl.releaseLockVerify(JobLockServiceImpl.java:470)
		at org.alfresco.repo.lock.JobLockServiceImpl$2.run(JobLockServiceImpl.java:385)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
		at java.base/java.lang.Thread.run(Thread.java:834)


Is there pls any magic that would make it work?

alfresco:
   image: alfresco/alfresco-content-repository:6.2.0.2
sync-service:
   image: quay.io/alfresco/service-sync:3.3.1