Deploying to a remote server running with a spring.active.profile

115 views
Skip to first unread message

rbhman

unread,
Feb 3, 2021, 5:53:40 PM2/3/21
to HAPI FHIR
Is it possible to deploy JPAStarter to a remote Tomcat server that has been started with a particular profile, e.g with the VM argument:.

-Dspring.profile.active=INT

If I go with the single application.yaml (with active: r4) that ships with JPAServer, then Spring Boot reports that the active profile is INT, but the server then fails to deploy after reporting:

2021-02-03 17:43:50.781 [http-nio-8080-exec-323] INFO  o.s.d.r.c.RepositoryConfigurationDelegate [RepositoryConfigurationDelegate.java:182] Finished Spring Data repository scanning in 120ms. Found 0 repository interfaces.

Even if I create in addition an application-INT.yaml file that has 

profiles:
   active: r4

it's the same result as above.

If I change the application-INT.yaml file to have e.g. :

profiles:
   active: INT
   include: r4

Then the repositories are discovered and the database schema is created, but I end up with an error because the war tries to create a file:

/target/lucenefiles

Caused by: org.hibernate.search.exception.SearchException: Unable to create index directory: target/lucenefiles for index ca.uhn.fhir.jpa.entity.TermConcept

, which is the value on the default application.yaml file. My application-INT.yaml has an override property for the lucene index location:

hibernate.search.default.indexBase: /LuceneIndexes

. where /LuceneIndexes has been chmod 777 altered before-hand.

How do I go about deploying to the INT server?

rbhman

unread,
Feb 5, 2021, 10:30:52 AM2/5/21
to HAPI FHIR
I finally figured out the problem. There is a bug in JPAStarter (EnvironmentHelper always overwrites JPA properties with default values.) 

I made the faulty assumption that my multiple profiles and/or what were the active profiles were the root cause.  

Reply all
Reply to author
Forward
0 new messages