Problem
Datameer-7.2.5 fails to start (either after an upgrade or a brand new installation) with the following exception:
[anonymous] ERROR [2018-10-30 12:20:53.808] [main] (ContextLoader.java:351) - Context initialization failed org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath:/spring/beanRefFactory.xml], factory key [beanRefFactory]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanRefFactory' defined in class path resource [spring/beanRefFactory.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring/datasource.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: mysql] Unable to build EntityManagerFactory at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:388) at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:561) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:323) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at datameer.dap.conductor.webapp.ContextListener.initializeContextOrDie(ContextListener.java:200) at datameer.dap.conductor.webapp.ContextListener.contextInitialized(ContextListener.java:164) Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mysql] Unable to build EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:925) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:900) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:76) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:353) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:373) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:362) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1648) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1585) ... 78 more Caused by: org.hibernate.HibernateException: Wrong column type in dap.accept_terms for column is_accepted. Found: bit, expected: boolean at org.hibernate.mapping.Table.validateColumns(Table.java:373) at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1307) at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:175) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:512) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1799) at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
Cause
The root cause of this behaviour is a new jar, mariadb-java-client-2.2.1.jar, that was added to: /Datameer-7.2.5/webapps/conductor/WEB-INF/lib/. This jar is being loaded before the mysql connector located at: /Datameer-7.2.5/etc/custom-jars. MariaDB handles boolean values in a different way than MySQL does, which leads to the exception.
Solution
- Stop Datameer.
- Remove /Datameer-7.2.5/webapps/conductor/WEB-INF/lib/mariadb-java-client-2.2.1.jar
- Clean up /Datameer-7.2.5/tmp, /Datameer-7.2.5/temp.
- Start Datameer.
Comments
0 comments
Please sign in to leave a comment.