08-20-2020 11:30 AM
Hello,
I am building my own Docker image based on:
https://hub.docker.com/r/alfresco/alfresco-content-repository-community
The tag I am using is "latest", which is Alfresco Repository CE 6.3.0.
My container is running in ECS. The JAVA_OPTS look like this:
-Ddb.driver=org.mariadb.jdbc.Driver -Dindex.subsystem.name=noindex -Dalfresco.host=acs-repository.${Project}.lan -Dalfresco.port=443 -Dalfresco.protocol=https -Daos.baseUrlOverwrite=https://acs-repository.${Project}.lan:443/alfresco/aos -Dmessaging.broker.connections.max=8 -Dmessaging.broker.url="failover:(${Amazonmq.Outputs.OpenwireEndpoints})" -Dcsrf.filter.enabled=false -Djodconverter.enabled=false -Djodconverter.officeHome=null -Xms3500m -Xmx3500m -Dlocal.transform.service.enabled=false -Dtransform.service.enabled=false -Dlegacy.transform.service.enabled=false -DsyncService.mode=OFF -Dsync.mode=OFF -Dsync.pullJob.enabled=false -Dsync.pushJob.enabled=false -Dsystem.usages.enabled=false -Dsystem.usages.clearBatchSize=0 -Dactivities.feed.notifier.enabled=false -Dactivities.feed.cleaner.enabled=false -Dactivities.post.cleaner.enabled=false -Dactivities.feed.generator.enabled=false -Dactivities.post.lookup.enabled=false -Dreplication.enabled=false -Dtransferservice.receiver.enabled=false -Dsystem.thumbnail.generate=false
Log line that seem to indicate a problem (can't paste everything because of lack of space):
2020-08-20 14:59:40,155 WARN [context.support.XmlWebApplicationContext] [localhost-startStop-1] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.CustomEditorConfigurer#0' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'customPropertyEditorRegistrar' while setting bean property 'propertyEditorRegistrars' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customPropertyEditorRegistrar' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'NamespaceService' while setting bean property 'namespaceService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryDAO' defined in class path resource [alfresco/core-services-context.xml]: Cannot resolve reference to bean 'tenantService' while setting bean property 'tenantService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantService' defined in URL [jar:file:/usr/local/tomcat/webapps/alfresco/WEB-INF/lib/alfresco-repository-8.83.jar!/alfresco/mt/mt-context.xml]: Cannot resolve reference to bean 'tenantAdminDAO' while setting bean property 'tenantAdminDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantAdminDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'repoSqlSessionTemplate' while setting bean property 'sqlSessionTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repoSqlSessionTemplate' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot resolve reference to bean 'repoSqlSessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repoSqlSessionFactory' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot resolve reference to bean 'dialectResourceLoader' while setting bean property 'resourceLoader'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectResourceLoader' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Cannot create inner bean 'org.springframework.beans.factory.config.PropertyPathFactoryBean#70482cfe' of type [org.springframework.beans.factory.config.PropertyPathFactoryBean] while setting bean property 'dialectClass'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPathFactoryBean#70482cfe' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialect': FactoryBean threw exception on object creation; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Could not connect to amjs1n0th4q14z.csxr954ib66u.us-west-1.rds.amazonaws.com:3306 : PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target)
08-21-2020 10:06 AM
You need to tell your jdbc url where to find cert file ,for example
url="jdbc:mysql://${db.host}:${db..port}/${db.database}?password=${db.password}&user=${db.user}&useSSL=true&requireSSL=true&trustCertificateKeyStoreUrl=file://${trustStorePath}&trustCertificateKeyStorePassword=${trustStorePassword}&clientCertificateKeyStoreUrl=file://${keyStorePath}&clientCertificateKeyStorePassword=${keyStorePassword}"
Please refer to https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-using-ssl.html
08-20-2020 10:08 PM
FactoryBean threw exception on object creation; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Could not connect to amjs1n0th4q14z.csxr954ib66u.us-west-1.rds.amazonaws.com:3306 : PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target)
It seems you have enabled jdbc connection to the database using ssl, but you didn't configure the certificate correctly
08-21-2020 07:22 AM
Thanks @kaynezhang ,
Yes, somebody else told me I need to add the DB certificate to the trust store.
So I am using the RDS root certificate, available at:
https://s3.amazonaws.com/rds-downloads/rds-ca-2019-root.pem
And followed these instructions to install the certificate.
However, I still have exactly the same problem...
Any idea?
Thanks a lot for any help!
08-21-2020 10:06 AM
You need to tell your jdbc url where to find cert file ,for example
url="jdbc:mysql://${db.host}:${db..port}/${db.database}?password=${db.password}&user=${db.user}&useSSL=true&requireSSL=true&trustCertificateKeyStoreUrl=file://${trustStorePath}&trustCertificateKeyStorePassword=${trustStorePassword}&clientCertificateKeyStoreUrl=file://${keyStorePath}&clientCertificateKeyStorePassword=${keyStorePassword}"
Please refer to https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-using-ssl.html
08-21-2020 12:52 PM
Hi @kaynezhang ,
I think the bug is now fixed. I had to add some parameters to the connection string just like you suggested. We didn't use exactly the same parameters because our setup is different, but in the end it's working.
Thanks a lot for the pointers!
08-24-2020 03:56 AM
Hi @fabrice7
I've accepted the solution by @kaynezhang - this helps other users to know what worked. Hope that's OK.
Cheers,
Explore our Alfresco products with the links below. Use labels to filter content by product module.