OHDSI Home | Forums | Wiki | Github

Could not start WebAPI on Tomcat (ATLAS)

Hi @hui_xing_tan

You may want to refer to this WebAPI PostgreSQL Installation question on the forum. It seems to address the same issue.

@Chris_Knoll @vkramdev

Thanks for the helpful advice and links, I tried a couple of things and it works now:

  1. Executing maven command without a space between the -P and the profile Id: -Pwebapi-postgresql
  2. Changes the values to my server from localhost or 54.209.111.128 to 127.0.0.1
  3. Changed the settings in WebAPI/pom.xml file to match those in WebAPIConfig/settings.xml

settings.xml:

<settings>
<profiles>
  <profile>
    <id>webapi-postgresql</id>
    <properties>
      <datasource.driverClassName>org.postgresql.Driver</datasource.driverClassName>
      <datasource.url>jdbc:postgresql://127.0.0.1:5433/OHDSI</datasource.url>
      <datasource.username>ohdsi_app_user</datasource.username>
      <datasource.password>app1</datasource.password>
      <datasource.dialect>postgresql</datasource.dialect>
      <datasource.ohdsi.schema>webapi</datasource.ohdsi.schema>
      <flyway.datasource.driverClassName>${datasource.driverClassName}</flyway.datasource.driverClassName>
      <flyway.datasource.url>${datasource.url}</flyway.datasource.url>
      <flyway.datasource.username>ohdsi_admin_user</flyway.datasource.username>
      <flyway.datasource.password>admin1</flyway.datasource.password>
      <flyway.locations>classpath:db/migration/postgresql</flyway.locations>
      <security.enabled>false</security.enabled>
      <security.token.expiration>43200</security.token.expiration>
      <security.origin>*</security.origin>
      <security.ssl.enabled>false</security.ssl.enabled>
      <security.oauth.callback.ui>http://localhost/atlas/#/welcome</security.oauth.callback.ui>
      <security.oauth.callback.api>http://localhost:8080/WebAPI/user/oauth/callback</security.oauth.callback.api>
      <security.oauth.google.apiKey></security.oauth.google.apiKey>
      <security.oauth.google.apiSecret></security.oauth.google.apiSecret>
      <security.oauth.facebook.apiKey></security.oauth.facebook.apiKey>
      <security.oauth.facebook.apiSecret></security.oauth.facebook.apiSecret>
    </properties> 
  </profile>  
</profiles>
</settings>

pom.xml:



webapi-postgresql

<datasource.driverClassName>org.postgresql.Driver</datasource.driverClassName>
<datasource.url>jdbc:postgresql://127.0.0.1:5433/OHDSI</datasource.url>
<datasource.username>ohdsi_app_user</datasource.username>
<datasource.password>app1</datasource.password>
<datasource.dialect>postgresql</datasource.dialect>
<datasource.ohdsi.schema>webapi</datasource.ohdsi.schema>
<flyway.datasource.driverClassName>${datasource.driverClassName}</flyway.datasource.driverClassName>
<flyway.datasource.url>${datasource.url}</flyway.datasource.url>
<flyway.datasource.username>ohdsi_admin_user</flyway.datasource.username>
<flyway.datasource.password>admin1</flyway.datasource.password>
<flyway.schemas>${datasource.ohdsi.schema}</flyway.schemas>
<flyway.placeholders.ohdsiSchema>${datasource.ohdsi.schema}</flyway.placeholders.ohdsiSchema>
<flyway.locations>classpath:db/migration/postgresql</flyway.locations>
<spring.batch.repository.tableprefix>${datasource.ohdsi.schema}.BATCH_</spring.batch.repository.tableprefix>
<hibernate.dialect>org.hibernate.dialect.PostgreSQL9Dialect</hibernate.dialect>
<security.db.datasource.url>${datasource.url}</security.db.datasource.url>
<security.db.datasource.driverClassName>${datasource.driverClassName}</security.db.datasource.driverClassName>
<security.db.datasource.username>${datasource.username}</security.db.datasource.username>
<security.db.datasource.password>${datasource.password}</security.db.datasource.password>
<security.db.datasource.authenticationQuery>select password from ${security.db.datasource.schema}.users_data where
lower(email) = lower(?)</security.db.datasource.authenticationQuery>

After rebuilding the .war file I deployed it on Tomcat and the tables are now showing in PostgreSQL

Not too sure the details behind it though…For example what is the difference between localhost, 54.209.111.128 and 127.0.0.1? And why settings.xml and pom.xml have to match. If anyone can enlighten here I’d be most grateful :smile:

Thanks for all the help
Regards,
Hui Xing

A few things:
You shouldn’t change things directly in pom.xml. The reason for this is that the pom.xml contains the set of default values which should be overriden in settings.xml. If we add new things to pom.xml, you will have conflicts with the edits you made in your pom.xml and the changes we made for a new release. The idea about having a settings.xml document is that it lets you make the changes to the pom.xml values, without changing the pom.xml file. So you might want to try this again, just using the default pom.xml file, with your updates in settings.xml, and see if the maven command properly builds your WebAPI.war file with your settings.

127.0.0.1 is a ‘loopback’ interface and it’s a way of saying ‘myself’ while 54.209.111.128 is a network ip, which goes through a dfferent network layer. The reason one might work over the other is that by default the DB server may allow connections from 127.0.0.1, but not from a network address.

A lot of all this depends on how you installed your software and your network configuration (like firewalls), so I can’t tell you definitively why one configuration may work for you over another.

More information is needed to resolve this issue.
For example, whether the computer on which PostgreSQL software is currently installed is the same computer that installed ATLAS or not.

If you are on the same computer, you can use 127.0.0.1 or localhost to point to itself, as @Chris_Knoll says. In this case, the connection works smoothly in any network environment.

However, if PostgreSQL and ATLAS are installed on different computers, you will not be able to use 127.0.0.1 or localhost, and you will be affected by your current network environment (firewall, etc.). There are also some additional settings that need to be made.

When I first replied, I thought that ATLAS and PostgreSQL would be installed on different machines, so I advised them to modify the postgresql.conf file. If it is not, this part has no effect.

Please check this point.

I see, thanks! I’ve tried to use back the default pom.xml file but the maven command dosen’t build the WebAPI file with the updates in the settings.xml. Instead it uses those in the default pom.xml

Would it be possible to use the WebAPI file built from the pom.xml that was updated or will it cause problems in the future? Thanks!

Hi @NEONKID

Ok, I’m installing them on the same machine for now just to test out. By different computers do you mean a computer with the central database server (PostgreSQL, for example) installed and a separate one that’s running the WebAPI on Tomcat?

Thanks!
Hui Xing

That’s right.

If you want to test WebAPI and DBMS using the same machine, you can write 127.0.0.1 or localhost to the datasource address. In case of pom.xml, it will be used as the basic configuration file of WebAPI.

If you want to use a file other than pom.xml (eg settings.xml or others) as a configuration file, you must use the “-s” option of the mvn command.

You shouldn’t need to do it this way. it’s very odd that the -s option to specify the settings file. You should really keep at this and figure out where the mistake is, because it’s critical that people be able to specify ‘sensitive’ information in a separate file. Maybe pass the full path to the file? If you’re on mac or linux, the file is case-sensitive…

When you run your MVN command, so you see anything in the output (it will be one of the first few lines of output) indicating that it could not read your settings file?

@NEONKID @Chris_Knoll

Ah yes, i’ve tried with the -s option and it still uses the pom.xml settings

There some warnings when I built the file, please see below:

[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Expected root element ‘settings’ but found ‘w:wordDocument’ (position: START_TAG seen … w:embeddedObjPresent=“no” w:ocxPresent=“no” xml:space=“preserve”>… @3:543) @ /WebAPI/WebAPIConfig/settings.xml, line 3, column 543
[WARNING]
[INFO] Scanning for projects…
[INFO]
[INFO] --------------------------< org.ohdsi:WebAPI >--------------------------
[INFO] Building WebAPI 1.0.0-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
Downloading from ohdsi.thirdparty: http://repo.ohdsi.org:8085/nexus/content/repositories/thirdparty/org/ohdsi/sql/SqlRender/1.5.1-SNAPSHOT/maven-metadata.xml
Downloading from ohdsi: http://repo.ohdsi.org:8085/nexus/content/repositories/releases/org/ohdsi/sql/SqlRender/1.5.1-SNAPSHOT/maven-metadata.xml
Downloading from central: http://repo.maven.apache.org/maven2/org/ohdsi/sql/SqlRender/1.5.1-SNAPSHOT/maven-metadata.xml
Downloading from ohdsi.snapshots: http://repo.ohdsi.org:8085/nexus/content/repositories/snapshots/org/ohdsi/sql/SqlRender/1.5.1-SNAPSHOT/maven-metadata.xml
Downloading from redshift: http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release/org/ohdsi/sql/SqlRender/1.5.1-SNAPSHOT/maven-metadata.xml
Downloading from odysseus.community.snapshots: http://repo.odysseusinc.com/artifactory/community-libs-snapshot-local/org/ohdsi/sql/SqlRender/1.5.1-SNAPSHOT/maven-metadata.xml
Downloaded from ohdsi.snapshots: http://repo.ohdsi.org:8085/nexus/content/repositories/snapshots/org/ohdsi/sql/SqlRender/1.5.1-SNAPSHOT/maven-metadata.xml (1.2 kB at 1.1 kB/s)
Downloaded from odysseus.community.snapshots: http://repo.odysseusinc.com/artifactory/community-libs-snapshot-local/org/ohdsi/sql/SqlRender/1.5.1-SNAPSHOT/maven-metadata.xml (334 B at 209 B/s)
Downloading from central: http://repo.maven.apache.org/maven2/commons-io/commons-io/maven-metadata.xml
Downloading from ohdsi.thirdparty: http://repo.ohdsi.org:8085/nexus/content/repositories/thirdparty/commons-io/commons-io/maven-metadata.xml
Downloading from ohdsi: http://repo.ohdsi.org:8085/nexus/content/repositories/releases/commons-io/commons-io/maven-metadata.xml
Downloading from ohdsi.snapshots: http://repo.ohdsi.org:8085/nexus/content/repositories/snapshots/commons-io/commons-io/maven-metadata.xml
Downloading from springsource.releases: http://repo.springsource.org/release/commons-io/commons-io/maven-metadata.xml
Downloading from redshift: http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release/commons-io/commons-io/maven-metadata.xml
Downloading from odysseus.community.snapshots: http://repo.odysseusinc.com/artifactory/community-libs-snapshot-local/commons-io/commons-io/maven-metadata.xml
Downloaded from central: http://repo.maven.apache.org/maven2/commons-io/commons-io/maven-metadata.xml (783 B at 1.3 kB/s)
Downloading from odysseus.community.releases: http://repo.odysseusinc.com/artifactory/community-libs-release-local/commons-io/commons-io/maven-metadata.xml
Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/commons-io/commons-io/maven-metadata.xml
Downloading from central: http://repo.maven.apache.org/maven2/org/ohdsi/circe/1.6.0-SNAPSHOT/maven-metadata.xml
Downloading from ohdsi.snapshots: http://repo.ohdsi.org:8085/nexus/content/repositories/snapshots/org/ohdsi/circe/1.6.0-SNAPSHOT/maven-metadata.xml
Downloading from ohdsi.thirdparty: http://repo.ohdsi.org:8085/nexus/content/repositories/thirdparty/org/ohdsi/circe/1.6.0-SNAPSHOT/maven-metadata.xml
Downloading from ohdsi: http://repo.ohdsi.org:8085/nexus/content/repositories/releases/org/ohdsi/circe/1.6.0-SNAPSHOT/maven-metadata.xml
Downloading from redshift: http://redshift-maven-repository.s3-website-us-east-1.amazonaws.com/release/org/ohdsi/circe/1.6.0-SNAPSHOT/maven-metadata.xml
Downloading from odysseus.community.snapshots: http://repo.odysseusinc.com/artifactory/community-libs-snapshot-local/org/ohdsi/circe/1.6.0-SNAPSHOT/maven-metadata.xml
Downloaded from ohdsi.snapshots: http://repo.ohdsi.org:8085/nexus/content/repositories/snapshots/org/ohdsi/circe/1.6.0-SNAPSHOT/maven-metadata.xml (764 B at 1.0 kB/s)
[INFO]
[INFO] — maven-clean-plugin:2.5:clean (default-clean) @ WebAPI —
[INFO] Deleting /WebAPI/target
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ WebAPI —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 534 resources
[INFO] Copying 1 resource
[INFO] Copying 29 resources
[INFO]
[INFO] — maven-compiler-plugin:2.5.1:compile (default-compile) @ WebAPI —
[INFO] Compiling 461 source files to /WebAPI/target/classes
[INFO]
[INFO] — maven-resources-plugin:2.6:testResources (default-testResources) @ WebAPI —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 30 resources
[INFO]
[INFO] — maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ WebAPI —
[INFO] Compiling 18 source files to /WebAPI/target/test-classes
[INFO]
[INFO] — maven-surefire-plugin:2.18.1:test (default-test) @ WebAPI —
[INFO] Tests are skipped.
[INFO]
[INFO] — maven-war-plugin:2.2:war (default-war) @ WebAPI —
[INFO] Packaging webapp
[INFO] Assembling webapp [WebAPI] in [/WebAPI/target/WebAPI]
[INFO] Processing war project
[INFO] Copying webapp resources [/WebAPI/src/main/webapp]
[INFO] Webapp assembled in [11719 msecs]
[INFO] Building war: /WebAPI/target/WebAPI.war
[INFO]
[INFO] — miredot-plugin:1.5.1:restdoc (default) @ WebAPI —
[INFO] Building reflective model of API and reading annotations…
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @javax.annotation.PostConstruct()
[WARNING] Unknown annotation on service method: skipped @javax.annotation.PostConstruct()
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @javax.annotation.PostConstruct()
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[class java.lang.Exception], dontRollbackOn=[class org.springframework.dao.EmptyResultDataAccessException])
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=true, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=true, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.context.annotation.Bean(name=[], initMethod=, destroyMethod=(inferred), value=[], autowire=NO)
[WARNING] Unknown annotation on service method: skipped @javax.annotation.PostConstruct()
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=true, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=true, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @javax.transaction.Transactional(value=REQUIRED, rollbackOn=[], dontRollbackOn=[])
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[WARNING] Unknown annotation on service method: skipped @javax.annotation.PostConstruct()
[WARNING] Unknown annotation on service method: skipped @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], readOnly=false, isolation=DEFAULT, transactionManager=, noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[])
[INFO] Built.
[INFO] Reading javadoc comments from sourcefiles…
[INFO] Read.
[INFO] Merging reflective and javadoc models…
[WARNING] Limited support for jdk8 (@link, @see, @linkplain javadoc tags won’t format properly)
[INFO] Merged.
[INFO] Performing issue analysis…
[INFO] Analysis done.
[INFO] Constructing Html documentation
[WARNING] Could not find html intro file file: miredot.htmlintro.html
[INFO] MireDot: Completed
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 56.558 s
[INFO] Finished at: 2018-08-12T13:36:32+08:00
[INFO] ------------------------------------------------------------------------

Thanks
Hui Xing

There’s the problem. It looks like you tried to edit the settings.xml file in a word editor. Don’t do that. just use a plain text file and make it contain only the text starting with <settings>.

Ah yes, it works now after pasting the settings it into a text file. The WebAPI built with the settings in settings.xml

Thanks @Chris_Knoll!!

Hi, when I check on the applications.properties in the built .war file in the c:/tomcat/webapps/WebAPI.war it gives me the below, which is not what I have set in my settings.xml in under the WebAPIConfig.What might be the issue kindly?

#Primary DataSource
datasource.driverClassName=org.postgresql.Driver
datasource.url=jdbc:postgresql://54.209.111.128:5432/vocabularyv5
datasource.username=USER
datasource.password=PASS
datasource.dialect=postgresql
datasource.ohdsi.schema=ohdsi
datasource.dialect.source=sql server

#Flyway database change management.
#DataSource for Change Managment / Migration
flyway.enabled=true
flyway.datasource.driverClassName=org.postgresql.Driver
flyway.datasource.url=jdbc:postgresql://54.209.111.128:5432/vocabularyv5
flyway.datasource.username=userWithWritesToOhdsiSchema
flyway.datasource.password=PASS

It looks like you didn’t provide a local settings.xml and then pass the path to the settings XML as part of your mvn command. The documents describe this here.

Thank you Chris, I have provided the settings.xml for postgreSQL as am using the postgreSQL database but the application wont deploy in the tomcat. And the WebApi.war build does not update the password as set in the settings.xml.

<security.db.datasource.username>${datasource.username}</security.db.datasource.username>
<security.db.datasource.password>${datasource.password}</security.db.datasource.password> <security.db.datasource.authenticationQuery>select password from ${security.db.datasource.schema}.users where lower(email) = lower(?)</security.db.datasource.authenticationQuery>

I also tried changing the above lines with the correct username and password but it did not work. Kindly help.

I’m sorry, I’m not sure what I can do to help. The core of the problem is the values in your settings is not being reflected in the final application.properties file, and I don’t expect the application to work until the values get populated properly.

I’d double check your work and try to figure out why it’s not populating in your environment. Many other people have followed the instructions and managed to get their local settings configured, so I’m fairly certain the issue is on your side.

If anyone else in the community has experience with configuring a WebAPI on postgresql, please share your experiences / points of failure and maybe it will help @EdnahM.

Hi @Chris_Knoll , thanks for the help.

I changed my pom.xml to be same as the settings.xml as the .war file was building from the configurations in the pom.xml file and it worked.

The only issues it did not add the sources to the database.

“the current webapi has no sources defined.
please add one or more on configuration page.”

This is what am trying to figure out why.

Thank You.

Hi @EdnahM

I had similar issues deploying using the settings.xml file too. You can try some of these tips so that the .war file gets built from the settings.xml file.

  1. Check that the correct settings are specified when running the mvn build command, for example if using postgresql, {profile id} in the maven command will be webapi-postgresql:

C:\Git\OHDSI\WebAPI> mvn clean package -DskipTests -s WebAPIConfig/settings.xml -P {profile id}

In the settings.xml file, there are different sections for different settings like postgresql, oracle etc, so another thing you may want to check is whether you have edited the section for the profile you want (i.e. webapi-postgresql)

  1. Make sure the folder name is spelt correctly, case matches, etc. For example in the above example the settings.xml file is stored in a folder called WebAPIConfig, that is located in C:\Git\OHDSI\WebAPI

  2. Edit the settings.xml file using a text editor instead of word editor. I had error building because I saved the settings.xml in a word editor.

  3. After running the maven build command, one way to check if it has successfully taken in the settings.xml is to look out for any error message that the settings.xml file cannot be located, or if there is error reading from the xml file. Usually this error message appears shortly after you run the build. If you see that message, it means the settings.xml file has not been used.

Hope this helps!
Hui Xing

Hi @hui_xing_tan

I have counterchecked my settings.xml and the case together with the command am using to build my webAPI.war file.

It seems its reading my settings.xml file as it shows the following warning message on running the command, but it doesn’t use the password I set in the settings.xml file instead its using the pom.xml file.

[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: ‘profile’ (position: START_TAG seen …\r\n … @7:11) @ C:\Users\edna\Desktop\WebAPI\WebAPIConfig\settings.xml, line 7, column 11
[WARNING]

But still I haven’t figured out why its not having any sources added to my database.

I still have this when accessing the data sources or any part of the ATLAS.

application initialization failed

the current webapi has no sources defined.
please add one or more on configuration page.

Thank you.

Did you follow these instructions?

Thanks so much for this, I hadn’t followed the CDM-configuration. I am still configuring the Achilles.

Plus on the issue of settings.xml. I was able to generate the webAPI.war file from the settings.xml instead of the pom.xml by using the latest webAPI version 2.9.0 and it created the tables in the database.

Thanks alot @Chris_Knoll , @hui_xing_tan

t