Quick guide to using openVPMS in OSX with mamp

Requirements:

  1. openvpms installation files
  2. MAMP (for mysql database)
  3. apache tomcat6
  4. Connector/J
  5. libreoffice

Download OpenVPMS Installation Files

Download the latest OpenVPMS Installation files. Create a folder within your home folder to unzip the release into.

The following assumes a user named user: Move the package to ~/user/openvpms and unzip the Installation Pack. This should create a ~/user/openvpmsopenvpms-release-x.x.x folder with the necessary files to install OpenVPMS.

Download and install MAMP

Installing MAMP provides a really easy way to configure and run MySQL. Download from http://www.mamp.info/en/downloads/

The free MAMP is fine, you don't need the paid pro version.

Download tomcat6

Download tar.gz core binary distribution of Apache Tomcat version 6 from http://tomcat.apache.org/download-60.cgi

Unpack it and then move it to your home directory so it will be in ~/user/apache-tomcat-6.x.x/lib/

 

Connector/J

Download the connector/J which is needed to connect openvpms to the database. You then extract it and copy the mysql-connector-java-x.x.x-bin.jar to:

  1. ~/user/openvpmsopenvpms-release-x.x.x/lib/
  2. ~/user/apache-tomcat-6.x.x/lib/

Libreoffice

Download libreoffice and install it

 

Setting the variables and paths

open a terminal window and edit your .profile file eg. type:

 nano .profile 

add the following to your .profile file

 

 export JAVA_HOME=/Library/Java/Home

export CATALINA_HOME=/users/user/apache-tomcat-6.0.35

export PATH=/Applications/LibreOffice.app/Contents/MacOS:$PATH 

Installing a fresh installation

Start the mysql database using mamp. Using phpmyadmin (installed with mamp) go the import tab and navigate to ~/user/openvpmsopenvpms-release-x.x.x/db/createdb.sql

Import it and then navigate to ~/user/openvpmsopenvpms-release-x.x.x/db/db.sql and import it as well. 

Now in a terminal window cd to ~/user/openvpmsopenvpms-release-x.x.x/bin

run the setup by typing

 ./dataload.sh setup 

Copy the openvpms.war from ~/user/openvpmsopenvpms-release-x.x.x/webapps/ to ~/user/apache-tomcat-6.x.x/webapps/

Starting and stopping tomcat

Hopefully now you are ready to go. I installed this a long time ago so to the best of my knowledge I haven't missed any necessary configuration. To start and stop tomcat cd to ~/user/apache-tomcat-6.x.x/bin and then run 

 ./startup.sh 

or 

  ./shutdown.sh

using the terminal

Once it starts up you should be able to access openvpms at http://localhost:8080/openvpms/app

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Thanks for the great step by step instruction for mac os x installation. I followed them uneventfully until the ./dataload.sh setup. I got the following error message in terminal: Cannot create PoolableConnectionFactory (Access denied for user 'openvpms'@'localhost' (using password: YES)) 

Lorna Johnston :)

The createdb.sql script sets up a clean database, and creates the openvpms user required by OpenVPMS. If it ran successfully, you should be able to log into the database using the following entered on the command line:

mysql -u openvpms -p openvpms

It will prompt for a password. Enter:

openvpms

If you can log in, you will get a mysql prompt. Type:

quit 

and press enter.

If not, you will get an error like:

ERROR 1045 (28000): Access denied for user 'openvpms'@'localhost' (using password: YES)

See http://www.openvpms.org/documentation/csh/1.8/topics/installing-openvpms... for more information.

 

Thank you for your reply. If I run the command: mysql -u openvpms -p openvpms     from my home directory the following error is returned: -bash: mysql: command not found                      If I cd to /Applications/MAMP/Library/bin/   and run the same command I get the same error, but if I run   ./mysql -u openvpms -p openvpms, it runs with openvpms saying: Welcome to the MySQL monitor...               It appears that the mysql command from MAMP isn't universally available.  I'm not sure that this has anything to do with the ./dataload.sh setup error messages I am getting.  Here is more detail on the ./dataload.sh outcome:                 Lornas-Air:bin lornajohnston$ ./dataload.sh setup                   Cannot create PoolableConnectionFactory (Access denied for user 'openvpms'@'localhost' (using password: YES)) Cannot create PoolableConnectionFactory (Access denied for user 'openvpms'@'localhost' (using password: YES)) Cannot create PoolableConnectionFactory (Access denied for user 'openvpms'@'localhost' (using password: YES)) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'archetypeDescriptorCache' defined in file [/Users/lornajohnston/openvpms-release-1.8.1/bin/../conf/openvpms-framework.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.openvpms.component.business.service.archetype.descriptor.cache.ArchetypeDescriptorCacheDB]: Constructor threw exception; nested exception is org.openvpms.component.business.dao.im.common.IMObjectDAOException: Failed to find IMObjects for class org.openvpms.component.business.dao.hibernate.im.archetype.AssertionTypeDescriptorDO with shortName: descriptor.assertionType and instanceName: null.   ...

Lorna Johnston :)

The mysql binary isn't in your path and nor is the current working directory so you need to run it via /Applications/MAMP/Library/bin/mysql or by cd'ing into that directory as you've described above.

If you can run:

/Applications/MAMP/Library/bin/mysql -u openvpms -p openvpms

and it accepts openvpms as the password, the dataload tool should work.

The dataload tool uses the configuration from <OPENVPMS_HOME>/conf/hibernate.properties to determine the username and password to connect to the database. This should have the following entries:

hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost:3306/openvpms
hibernate.connection.username=openvpms
hibernate.connection.password=openvpms

If the password is different, or contains trailing spaces, connection will fail.

If the above is OK, you could try running mysql as the administrator and enter:

GRANT ALL PRIVILEGES ON openvpms.* TO 'openvpms'@'127.0.0.1'
    IDENTIFIED BY 'openvpms' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON openvpms.* TO 'openvpms'@'localhost'
    IDENTIFIED BY 'openvpms' WITH GRANT OPTION;

If dataload doesn't work with the above, try the insecure version below (it allows connections from all hosts):

GRANT ALL PRIVILEGES ON openvpms.* TO 'openvpms'@'%'
    IDENTIFIED BY 'openvpms' WITH GRANT OPTION;

Failing all of the above, post your question to the implementers forum where it is more likely to be seen.

 

Syndicate content