jdbc Error with OpenVPMS 2.1.1
Submitted by Canberravillage... on Tue, 30/07/2019 - 14:12
Hi Team
I'm testing out a fresh OpenVPMS 2.1.1 installation on a newly installed Debian Stretch system. Relevant software is:
- MySQL 5.7 with sql_mode set correctly
- MySQL Connector/J 8 connector from Oracle
- Tomcat 8 and openjdk-8-jre from Debian
With the mysql-connector .jar file in the OpenVPMS directory I get the following when using dbtool to create a new database:
- ./dbtool --create install -u root
- java.lang.IllegalStateException: Property not found: jdbc.driverClassName
The Tomcat8 logs show a more verbose error, with extract here:
- 30 Jul 2019 03:05:20,543 WARN XmlWebApplicationContext,http-nio-8080-exec-3:544 - - Exception encountered during context initialization - cancelling refresh attempt
- org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in ServletContext resource [/WEB-INF/openvpms-framework.xml]: Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}"
- 30 Jul 2019 03:05:20,543 WARN XmlWebApplicationContext,http-nio-8080-exec-3:544 - - Exception encountered during context initialization - cancelling refresh attempt
- org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in ServletContext resource [/WEB-INF/openvpms-framework.xml]: Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'jdbc.driverClassName' in string value "${jdbc.driverClassName}"
I've also tried the connector from Debian's libmysql-java package with similar results.
Any tips on this one?
Cheers
Damien
Re: jdbc Error with OpenVPMS 2.1.1
Yep you need to use the
Ver 5 of the Connector
They changed the driverclass in 8
Under 5 it was
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
But using the Connector/8
<parameter>
<name>driverClassName</name>
<value>com.mysql.cj.jdbc.Driver</value>
</parameter>
Probably want to use
Re: jdbc Error with OpenVPMS 2.1.1
Basically you just take the precompiled jar and make sure its in the 'lib' directory of the installation extraction
Its not included due to licencing issues
Re: jdbc Error with OpenVPMS 2.1.1
You could try updating hibernate.properties as well
Re: jdbc Error with OpenVPMS 2.1.1
Thanks Ben, using the 5.1 version connector did the trick.