jdbc Error with OpenVPMS 2.1.1

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

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

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 

mysql-connector-java-5.1.48.tar.gz
 
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

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 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: jdbc Error with OpenVPMS 2.1.1

You could try updating hibernate.properties as well

#
# Version: 1.0
#
# The contents of this file are subject to the OpenVPMS License Version
# 1.0 (the 'License'); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.openvpms.org/license/
#
# Software distributed under the License is distributed on an 'AS IS' basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# Copyright 2018 (C) OpenVPMS Ltd. All Rights Reserved.
#

jdbc.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/openvpms?useSSL=false
jdbc.username=openvpms
jdbc.password=openvpms
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: jdbc Error with OpenVPMS 2.1.1

Thanks Ben, using the 5.1 version connector did the trick.

Syndicate content