Dialect Database MariaDB

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

Dialect Database MariaDB

Jump to solution

Hi,
it is the first time I install Alfresco Community and therefore I apologize for my inaccuracies.
The data are Alfresco Community 6.1 on CentOS 7 with MariaDB 10.3 on the same host.
For the installation I followed the documentation, I had some difficulties but I went on until now.
When I start Tomcat, I see in the logs:
Error creating bean with name 'org.springframework.beans.factory.
config.PropertyPathFactoryBean#304879f3' defined in class path resource [alfresco/ibatis/ibatis-context.xml]: Initialization of bean failed; neste
d exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialect': FactoryBean threw exception on ob
ject creation; nested exception is java.lang.IllegalArgumentException: Dialect must be explicitly set for database: MariaDB
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:378)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:401)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:159)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1648)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1400)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498)
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:204)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:171)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:691)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:528)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:400)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4682)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5150)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:713)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1849)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)


In the file tomcat/shared/classes/alfresco-global.properties I also put:

hibernate.dialect=org.hibernate.dialect.MariaDBDialect

but nothing, nothing has changed and I can't overcome this obstacle !!!
Thanks a lot


Best Regards

1 Solution

Accepted Solutions
Active Member II

Re: Dialect Database MariaDB

Jump to solution

Hi,
so, the problem with MariaDB I overcame, the problem was that I had installed a too "recent" connector (mariadb-java-client-2.4.1.jar) and the platform didn't support it and so I installed the mariadb-java-client-2.2.5 connector.

Then, I had the problem with Sample Site:

Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'disabled'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${sample.site.disabled}].....

And this too I solved by inserting

sample.site.disabled=true

in the alfresco-global.properties file.

Now, when I restarted everything went ok, the DB was created, I have only a few errors because I still have to install additional software like LibreOffice but when I enter the url http://<hostname_server>:8080/share (or http://<hostname_server>:8080/alfresco), in the browser.... nothing.... the page is waiting but nothing appears !!!
On the log Catalin.out I don't see anything, it doesn't even register browser calls but my pc arrives on the server because if I do:

telnet <hostname_server> 8080
Trying 172.16.100.23...
Connected to prot01prdpom.home.coop.
Escape character is '^]'.

I hope I was clearer !!

Best Regards

View solution in original post

10 Replies
Alfresco Employee

Re: Dialect Database MariaDB

Jump to solution

Follow these steps:

Using MariaDB instead of PostgreSQL as database · keensoft/docker-alfresco Wiki · GitHub 

If you are not using Docker, then just include following values in your alfresco-global.properties

db.driver=org.mariadb.jdbc.Driver
db.username=alfresco
db.password=alfresco
db.url=jdbc:mariadb://db:3306/alfresco?useUnicode=true\&characterEncoding=UTF-8
Software Engineer in Alfresco Search Team.
Active Member II

Re: Dialect Database MariaDB

Jump to solution

Thanks but nothing !!!
In alfresco-global.properties I have replaced these lines

#db.driver=com.mysql.jdbc.Driver
#db.url=jdbc:mysql://${db.host}:${db.port}/${db.name}?useUnicode=yes&characterEncoding=UTF-8

with

db.driver=org.mariadb.jdbc.Driver
db.url=jdbc:mariadb://${db.host}:${db.port}/${db.name}?useUnicode=true\&characterEncoding=UTF-8

but the error remains the same:

Error creating bean with name 'dialect': FactoryBean threw exception on ob
ject creation; nested exception is java.lang.IllegalArgumentException: Dialect must be explicitly set for database: MariaDB


Best Regards

Alfresco Employee

Re: Dialect Database MariaDB

Jump to solution

Did you copy MariaDB Connector/J library to "tomcat/lib"?

Software Engineer in Alfresco Search Team.
Active Member II

Re: Dialect Database MariaDB

Jump to solution

Hi,
yes, I copied MariaDB Connector/J library to tomcat/lib and to tomcat/shared/lib/
I think Alfresco can connect to the DB, because if I mistake the password in the alfresco-global.properties file, the error changes and becomes:


Failed to obtain JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'alfresco'@'localhost' (using password: YES))

Best Regards

Alfresco Employee

Re: Dialect Database MariaDB

Jump to solution

So now the problem is that MySQL is not configured to be accessed from "localhost".

Probably this can help: GRANT - MariaDB Knowledge Base 

Software Engineer in Alfresco Search Team.
Active Member II

Re: Dialect Database MariaDB

Jump to solution

No, no, I had only done a test to mistake the password on purpose to verify that Alfresco arrived, and connected, to the DB !!!
By putting the right password again, the "old" error returns.

Best Regards

Active Member II

Re: Dialect Database MariaDB

Jump to solution

Hi,

I overcame the rock, the problem was that I had installed a connector too recent (mariadb-java-client-2.4.1.jar) and the platform didn't support it and so I installed the mariadb-java-client-2.2.5 connector. jar.
The problem is that I always have an error even though it has changed, now it is:

Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'boolean' for property 'disabled'; nested exception is java.lang.IllegalArgumentException: Invalid boolean value [${sample.site.disabled}]
at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:595)
at org.springframework.beans.AbstractNestablePropertyAccessor.convertForProperty(AbstractNestablePropertyAccessor.java:604)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:219)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1697)


Best Regards

Active Member II

Re: Dialect Database MariaDB

Jump to solution

Wow... I didn't believe it but it's really hard !!!
I also passed the second obstacle, inserting it into the file alfresco-global.properties

sample.site.disabled=true

and when I restarted everything went ok, the DB was created, I have only a few errors because I still have to install additional software like LibreOffice.
All happy, I enter the url http://<hostname_server>:8080/share in the browser.... and anything.... the page is waiting but nothing appears !!!
Before I had blocking errors but at least the http://<hostname_server>:8080/share page appeared to me.
On Catalin.out I don't see anything, it doesn't even register browser calls but my pc arrives on the server because if I do:

telnet <hostname_server> 8080
Trying 172.16.100.23...
Connected to prot01prdpom.home.coop.
Escape character is '^]'.

I'm going crazy...... help me !!!

Alfresco Employee

Re: Dialect Database MariaDB

Jump to solution

I don't understand what the problem is.

The steps to use MariaDB are pretty simple:

1) Create an empty database for Alfresco in MariaDB

2) Include the right settings in "alfresco-global.properties"

3) Copy the JAR file to "tomcat/lib"

And it's done.

The steps are (still) the same described for MySQL: Alfresco – Using MySQL instead of PostgreSQL | 

Software Engineer in Alfresco Search Team.