documentation:software:webapi:setup
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:software:webapi:setup [2016/08/23 18:39] – jhardin | documentation:software:webapi:setup [2018/04/23 19:11] (current) – lee | ||
|---|---|---|---|
| Line 109: | Line 109: | ||
| You will need to download the Oracle JDBC driver, and install it into your local maven repository. | You will need to download the Oracle JDBC driver, and install it into your local maven repository. | ||
| - | mvn install: | + | mvn install: |
| (The above is all a single line command.) | (The above is all a single line command.) | ||
| Line 118: | Line 118: | ||
| Open command prompt, go to WebAPI folder, type | Open command prompt, go to WebAPI folder, type | ||
| - | set JAVA_HOME=C:/ | + | |
| //Make sure you point to a JDK, not a JRE. It is probably a good idea to stick to the same Java version that is running Tomcat// | //Make sure you point to a JDK, not a JRE. It is probably a good idea to stick to the same Java version that is running Tomcat// | ||
| - | mvn clean package -s / | + | |
| - | ``` | + | |
| This will create the file WebAPI.war in the target subfolder. | This will create the file WebAPI.war in the target subfolder. | ||
| - | _Note: {profile id} is set to the value of the profile ID from the example configuration. | + | //Note: {profile id} is set to the value of the profile ID from the example configuration. |
| - | ## Deploy the war file | + | ==== Deploy the war file ==== |
| + | ---- | ||
| In Tomcat (e.g. using the manager app), deploy the war file. | In Tomcat (e.g. using the manager app), deploy the war file. | ||
| This should automatically create a large number of tables in the webapi schema. | This should automatically create a large number of tables in the webapi schema. | ||
| - | # Verify Application | + | === Verify Application |
| + | ---- | ||
| Reading the Tomcat logs, the following output should appear indicating that the tables have been created (in this example, we see an Oracle output): | Reading the Tomcat logs, the following output should appear indicating that the tables have been created (in this example, we see an Oracle output): | ||
| - | ``` | + | |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | 2016-02-24 11: | + | 2016-02-24 11: |
| - | ``` | + | |
| Other platforms should see similar output, except for the JDBC url in the connection. | Other platforms should see similar output, except for the JDBC url in the connection. | ||
| - | ## Configure source and source_daimon tables | + | === Configure source and source_daimon tables |
| + | ---- | ||
| The webapi.source and webapi.source_daimon tables were created when you started the tomcat service with the WebAPI war deployed. | The webapi.source and webapi.source_daimon tables were created when you started the tomcat service with the WebAPI war deployed. | ||
| + | |||
| + | Here are the valid values for the daimon_type in the source_daimon table: | ||
| + | 0 = CDM, 1 = VOCABULARY, 2 = RESULTS, 3 = EVIDENCE | ||
| + | |||
| For this example it is assumed that the CDM and Vocabulary exist as a separate schema in the same database instance. | For this example it is assumed that the CDM and Vocabulary exist as a separate schema in the same database instance. | ||
| - | ### WebAPI SOURCE and SOURE_DAIMON Inserts | + | === WebAPI SOURCE and SOURE_DAIMON Inserts |
| - | ```sql | + | |
| - | INSERT INTO ohdsi.source (source_id, source_name, | + | INSERT INTO ohdsi.source (source_id, source_name, |
| - | INSERT INTO ohdsi.source (source_id, source_name, | + | INSERT INTO ohdsi.source (source_id, source_name, |
| + | INSERT INTO webapi.source_daimon (source_daimon_id, | ||
| + | INSERT INTO webapi.source_daimon (source_daimon_id, | ||
| + | INSERT INTO webapi.source_daimon (source_daimon_id, | ||
| + | INSERT INTO webapi.source_daimon (source_daimon_id, | ||
| - | INSERT INTO webapi.source_daimon (source_daimon_id, | ||
| - | INSERT INTO webapi.source_daimon (source_daimon_id, | ||
| - | INSERT INTO webapi.source_daimon (source_daimon_id, | ||
| - | INSERT INTO webapi.source_daimon (source_daimon_id, | ||
| - | ``` | ||
| The above inserts create 2 Sources: One used to point to the instance containing the CDM tables, the second pointing to the server containing a Vocabulary. | The above inserts create 2 Sources: One used to point to the instance containing the CDM tables, the second pointing to the server containing a Vocabulary. | ||
| - | _Note: WebAPI will need to be restarted in order to see the the new sources (Issue# TBD)._ | + | //Note: WebAPI will need to be restarted in order to see the the new sources (Issue# TBD).// |
| - | _Note: IF using postgresql, the jdbc connection string is of the form_ | + | //Note: IF using postgresql, the jdbc connection string is of the form// |
| - | `jdbc: | + | |
| - | ## Verify Configuration | + | === Verify Configuration |
| + | ---- | ||
| Once WebAPI is started, and the source/ | Once WebAPI is started, and the source/ | ||
| - | ``` | + | |
| - | http:// | + | http:// |
| - | ``` | + | |
| This should result in the following output: | This should result in the following output: | ||
| - | ```json | + | |
| - | [ | + | [ |
| {" | {" | ||
| [ | [ | ||
| Line 206: | Line 213: | ||
| ] | ] | ||
| }] | }] | ||
| - | ``` | + | |
| WebAPI is now configured and ready to serve OHDSI tools! | WebAPI is now configured and ready to serve OHDSI tools! | ||
| - | #Troubleshooting | + | ==== Troubleshooting |
| - | ##Errors during WebAPI startup | + | ---- |
| + | ===Errors during WebAPI startup=== | ||
| + | ---- | ||
| If errors are encountered in the logs of WebAPI, the most likely reason is JDBC url was not set properly (note: database names are case sensitive!), | If errors are encountered in the logs of WebAPI, the most likely reason is JDBC url was not set properly (note: database names are case sensitive!), | ||
| - | ##Errors when calling sources URL | + | ===Errors when calling sources URL=== |
| - | The most likely error you will receive when accessing http:// | + | ---- |
| + | The most likely error you will receive when accessing | ||
| is the ohdsi_app_user does not have permission on relation ‘source’. | is the ohdsi_app_user does not have permission on relation ‘source’. | ||
| If no error is appearing in the logs at all, please confirm the Tomcat servlet engine is listening on port 8080. If it is on a different port, you will need to adjust the URLs above to the correct port. | If no error is appearing in the logs at all, please confirm the Tomcat servlet engine is listening on port 8080. If it is on a different port, you will need to adjust the URLs above to the correct port. | ||
documentation/software/webapi/setup.1471977572.txt.gz · Last modified: by jhardin
