Building CONNECT from Source Code

Prerequisites

Minimum System Requirements

Hardware

Specification

Processor

Minimum dual 2GHz CPU

RAM

Minimum of 8GB

Hard Disk Size

Application dependent on the deployment configuration.
For sizing purposes, assume 100K per CCD record,
1K per audit log record. (The testing environment allocated 20GB.)

Hard Disk Speed

Minimum of 7200 RPM and 10000 RPM preferred

Network Interface

100 Mbps Ethernet acceptable; 1 Gbps Ethernet desirable

Software Requirements

Software

Version

Java JDK

CONNECT 5.2+ - Java JDK (64-bit) 1.8 or higher

CONNECT 5.0+ - Java JDK (64-bit)  1.7u40 or higher, IBM JDK (64-bit)  1.7u40 or higher or Java JDK (64-bit) 1.8

CONNECT 4.X - Java JDK (64-bit) 1.7 (or higher), or IBM JDK (64-bit) 1.7 (or higher)

Git

Git

Relational Database

Any ANSI SQL92 compliant relational database.
(For example: MySQL, Oracle, and DB2. We test with MySQL 5.1.x)

Build Automation Tool

Maven 3.1.1 or higher

Application Servers*

WebSphere Enterprise 8.5.5.3,

WebLogic 12c (12.1.1, 12.1.3 and 12.2.2.1), or JBoss EAP 7, or /wiki/spaces/CONNECT4/pages/58490914

Recommended Test Tools (Optional)

SoapUI 5.3

Note:  CONNECT has also been successfully deployed to Apache Tomcat (4.5 or earlier), Glassfish 4.1 but this setup is not officially supported.

Java

Download and install the JDK. Set the environment variable JAVA_HOME to the Java installation directory and prepend the PATH system environment variable with $JAVA_HOME/bin. Test the Java installation using the following command:

java -d64 -version

It should return that the version is "1.x.0_yy" where x is the version and yy is the update number. (It should return the version that you have downloaded.)

NoteUS_export_policy.jar and local_policy.jar are needed from the Java Cryptography Extension (JCE) Unlimited Policy Files; download the version that matches your JDK version using one of the following links:  JCE 1.6 or JCE 1.7 or JCE 1.8. Copy those two files into the $JAVA_HOME/jre/lib/security directory.

Git

Install the Git client. This will be used to download the CONNECT source code.

MySQL 5.1

The Gateway and the reference implementation of the Adapters use a MySQL database by default. The programmatic access to this database is done using Hibernate. When doing the initial installation of the Gateway and Adapter, it is recommended that MySQL be installed and that the system be verified. After it has been created and verified, other relational databases can be used in place of MySQL by altering the appropriate entries in the Hibernate configuration files for those projects that are accessing the database. Directions for configuring Hibernate to use other databases are not defined in this document.

Maven 3.1.1 or Higher

For JDK 1.7, Set the environment variable MAVEN_HOME to the Maven installation directory and set MAVEN_OPTS to (minus the quotes) "-Xmx8000m -XX:MaxPermSize=1024m". Prepend MAVEN_HOME/bin to the PATH.

For JDK 1.8, Set the environment variable MAVEN_HOME to the Maven installation directory and set MAVEN_OPTS to (minus the quotes) "-Xmx8000m". Prepend MAVEN_HOME/bin to the PATH.

Prerequisite Summary

All software from the requirements table above should be installed (with the possible exception of SoapUI), and the following environment variables should be set (examples are given from a Windows installation):

set ANT_HOME=c:\Program Files (x86)\apache-ant-1.7.1
set ANT_OPTS=-Xmx1200m -XX:MaxPermSize=128m -Dcom.sun.aas.instanceName=server
set JAVA_HOME=c:\program files\java\jdk1.x.0_yy (x is the version and yy is the update)
set MAVEN_HOME=c:\Program Files (x86)\apache-maven-3.1.1
set MAVEN_OPTS=-Xmx8000m -XX:MaxPermSize=1024m
set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%MAVEN_HOME%\bin;%PATH%

Download the Source Code from Git

Download CONNECT source code by using Git Bash (or the installed Git client) and use the following command:

git clone https://github.com/CONNECT-Solution/CONNECT <desired path to where CONNECT source code should be downloaded to>

Cloning the Git repository means that all versions of the source code are available on the adopter's machine. The default version of the code that is checked out is the head of the development branch. This will be shown in Git Bash in parentheses as "(CONNECT)". To check-out the 5.0 release, use the following command:

git checkout 5.0.0

Set up MySQL Databases

Following the official website (http://dev.mysql.com/doc/) for instruction on how to download and install MySQL databases.  Once completing configuration successful, please following the following steps to set up CONNECT databases and sample records:

  • Navigate to <CONNECT_SOURCE_DIR>/Product/DBScripts/nhincdb and execute dropall.sql, nhincdb.sql, populateTestData.sql inside MySQL instance. 

Add Database Password

In /CONNECT/pom.xml, enter the MySQL data as needed:

<!-- DB Options -->
        <db.host>xxxxx</db.host>
        <db.password>xxxxx</db.password>
        <db.port>xxxxx</db.port>
        <db.user>xxxxx</db.user>
        <mysql.root.password>xxxxx</mysql.root.password>
        <mysqldriver.version>xxxxx</mysqldriver.version>


In /CONNECT/Product/SoapUI_Test/pom.xml, enter the MySQL root password:

<mysql.root.password>xxxxxxx</mysql.root.password>

Alternative: you can pass the properties when doing maven build without modifying pom.xml by using the command below:

mvn clean install -Dmysql.root.password=<mysqlpassword> -Ddb.user=<username>

Build the Source

Open a command prompt and execute one of the following commands once the current working directory is at the CONNECT root folder:

mvn clean install  <---- This builds all CONNECT services except for Direct along with the CONNECT WildFly ear. This command will not run db scripts.
mvn clean install -P DB <---- This builds all CONNECT services except for Direct along with the CONNECT WildFly ear. This command will run db scripts.
mvn clean install -P AD,PD,DQ,DR,DS,DDS,X12,Direct,was,weblogic,jboss7  <---- This builds all CONNECT services including Direct along with CONNECT ear for all supported servers
mvn clean install -P AD,PD,DQ,DR,DS,DDS,X12,admingui,was,weblogic,jboss7  <---- This builds all CONNECT services including AdminGUI webservices along with CONNECT ear for all supported servers

The various profiles (-P) listed above correspond to the target application server and desired services. The EAR will be build specifically for that server. WebSphere Enterprise server is indicated with "was." The others are self-explanatory, and Widlfy(Jboss) is the default, so no profile is passed in. You can omit services and servers you do not need. For example, executing mvn clean install -P PD,weblogic will build a CONNECT ear to support only Patient Discovery and WebLogic.

If the desired application server is not Wildfly(Jboss), then the profile must be switched. This is done with the -P switch, followed by the name of the application server as shown in the code sample above. When building in Linux or Solaris, escape the switch with a backslash. The EAR file will be in <CONNECT_SOURCE_DIR>/Product/Production/Deploy/[app server name]/target. It will be named CONNECT-JB.ear, CONNECT-WAS.ear, etc., depending on the application server used.

Abbreviations used for app server name

WL - WebLogic (profile to be used to build WebLogic ear - weblogic)

WAS - WebSPhere (profile to be used to build WebSphere ear - was)

JB7 - JBoss (profile to be used to build JBoss ear and wildfly - jboss7) 

Database scripts

If CONNECT database scripts need to be executed during build time, use the DB profile. EXAMPLE: mvn clean install -P AD,PD,DQ,DR,DS,X12,Direct,DB


For building selected services, ensure that the services to be built are provided in the build command. The corresponding profiles for each service is as follows:

AD - Admin Distribution

PD - Patient Discovery

DQ - Document Query

DR - Document Retrieve

DS - Document Submission

DDS - Document Data Submission (Pilot)

X12 - Core X12

Direct - Direct Core

admingui - Administrative GUI *.WAR, and the corresponding webservices into the compiled *.EAR.

INFO

By default all the exchange services(PD, DQ, DR, DS, AD) will be operated in standard mode and X12 will be operated in Passthrough mode.

Application Server

Wildfly Configuration/Deployment.

Download and install the desired application server from the links in the requirements table above. Instructions for Websphere or Weblogic are contained in the links further below.

Deploy the EAR to WildFly

Deploy the EAR to WebSphere 

Deploy the EAR to WebLogic

Deploy the EAR to JBoss

Test the Installation

Test Tool

Installing SoapUI is not necessary as Maven will build and run the test suite, but adopters can download and install SoapUI 4.5.1 for free at http://www.soapui.org/Downloads/older-versions.html.

Instructions for running CONNECT validation tests can be found /wiki/spaces/CONNECTWIKI/pages/10584099.

Deploying the Admin GUI

  • Execute CONNECT/Product/DBScripts/adminguidb/adminguidb.sql
  • Deploy the CONNECT/Product/Production/Adapters/General/CONNECTAdminGUI/target/CONNECTAdminGUI.war file
  • Refer to the /wiki/spaces/CONNECTWIKI/pages/85852259 for instructions on how to navigate the Admin GUI


Troubleshooting

IssueResolution
[ERROR] Failed to execute goal on project CONNECTAdminGUI: Could not resolve dependencies for project org.connectopensource:CONNECTAdminGUI:war:5.0.0-RC1: Failed to collect dependencies at org.primefaces.themes:bootstrap:jar:1.0.10: Failed to read artifact descriptor for org.primefaces.themes:bootstrap:jar:1.0.10: Could not transfer artifact org.primefaces.themes:bootstrap:pom:1.0.10 from/to prime-repo (http://repository.primefaces.org): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Import the certificate from http://repository.primefaces.org/ into <JAVA_HOME>/jre/lib/security/cacerts