Stream: hapi
Topic: hapi-fhir-cli server error
Gaston Fiore (Jul 01 2016 at 12:39):
I tried to start a FHIR server using the hapi-fhir-cli by running java -jar hapi-fhir-cli.jar run-server
as stated in the documentation. However, the process gets killed, without giving much information. The output by some strange reason has varied in different tries. The most informative output that I got is:
gaston@pgx-fhir:~/bin$ java -jar hapi-fhir-cli.jar run-server ------------------------------------------------------------ 🔥 HAPI FHIR 1.5 - Command Line Tool ------------------------------------------------------------ Max configured JVM memory (Xmx): 239.8MB Detected Java version: 1.8.0_91 ------------------------------------------------------------ 12:12:54 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2] 12:12:54 INFO ca.uhn.fhir.cli.RunServerCommand - Preparing HAPI FHIR JPA server on port 8080 12:12:55 INFO ca.uhn.fhir.cli.RunServerCommand - Starting HAPI FHIR JPA server in DSTU2 mode 12:13:26 WARN o.h.e.j.e.i.JdbcEnvironmentInitiator - HHH000342: Could not obtain connection to query metadata : Cannot create PoolableConnectionFactory (Failed to create database 'directory:target/jpaserver_derby_files', see the next exception for details.) Killed
Does anyone have any pointers? The derby.log
file is empty and I'm not sure where to look next. Thanks a lot!
David Hay (Jul 01 2016 at 19:45):
At one stage I used this: JAVA_HOME=/usr/libexec/java_home
./hapi-fhir-cli run-server - though it doesn't sound like finding java is your problem...
Gaston Fiore (Jul 01 2016 at 19:52):
Thanks @David Hay , indeed, I don't think that finding Java is the problem. I could finally start the server, but what's surprising is that I haven't changed anything. The output that I get changes from try to try by some strange reason. On most tries I got:
gaston@pgx-fhir:~/bin$ java -jar hapi-fhir-cli.jar run-server ------------------------------------------------------------ 🔥 HAPI FHIR 1.5 - Command Line Tool ------------------------------------------------------------ Max configured JVM memory (Xmx): 239.8MB Detected Java version: 1.8.0_91 ------------------------------------------------------------ 12:01:54 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2] 12:01:54 INFO ca.uhn.fhir.cli.RunServerCommand - Preparing HAPI FHIR JPA server on port 8080 12:01:55 INFO ca.uhn.fhir.cli.RunServerCommand - Starting HAPI FHIR JPA server in DSTU2 mode Killed
One other time I got:
gaston@pgx-fhir:~/bin$ java -jar hapi-fhir-cli.jar run-server ------------------------------------------------------------ 🔥 HAPI FHIR 1.5 - Command Line Tool ------------------------------------------------------------ Max configured JVM memory (Xmx): 239.8MB Detected Java version: 1.8.0_91 ------------------------------------------------------------ 12:12:54 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2] 12:12:54 INFO ca.uhn.fhir.cli.RunServerCommand - Preparing HAPI FHIR JPA server on port 8080 12:12:55 INFO ca.uhn.fhir.cli.RunServerCommand - Starting HAPI FHIR JPA server in DSTU2 mode 12:13:26 WARN o.h.e.j.e.i.JdbcEnvironmentInitiator - HHH000342: Could not obtain connection to query metadata : Cannot create PoolableConnectionFactory (Failed to create database 'directory:target/jpaserver_derby_files', see the next exception for details.) Killed
And one time the server started:
gaston@pgx-fhir:~/bin/server$ java -jar ../hapi-fhir-cli.jar run-server ------------------------------------------------------------ 🔥 HAPI FHIR 1.5 - Command Line Tool ------------------------------------------------------------ Max configured JVM memory (Xmx): 239.8MB Detected Java version: 1.8.0_91 ------------------------------------------------------------ 17:16:21 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2] 17:16:22 INFO ca.uhn.fhir.cli.RunServerCommand - Preparing HAPI FHIR JPA server on port 8080 17:16:22 INFO ca.uhn.fhir.cli.RunServerCommand - Starting HAPI FHIR JPA server in DSTU2 mode 17:16:52 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2] 17:16:55 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU1] 17:16:55 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2_HL7ORG] 17:16:56 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU3] 17:17:07 WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 10000, SQLState: 01J01 17:17:07 WARN o.h.e.jdbc.spi.SqlExceptionHelper - Database 'directory:target/jpaserver_derby_files' not created, connection made to existing database instead. 17:17:07 WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 10000, SQLState: 01J01 17:17:07 WARN o.h.e.jdbc.spi.SqlExceptionHelper - Database 'directory:target/jpaserver_derby_files' not created, connection made to existing database instead. 17:17:07 WARN o.h.e.jdbc.spi.SqlExceptionHelper - SQL Warning Code: 10000, SQLState: 01J01 17:17:07 WARN o.h.e.jdbc.spi.SqlExceptionHelper - Database 'directory:target/jpaserver_derby_files' not created, connection made to existing database instead. 17:17:09 INFO ca.uhn.fhir.cli.RunServerCommand - Server started on port 8080 17:17:09 INFO ca.uhn.fhir.cli.RunServerCommand - Web Testing UI : http://localhost:8080/ 17:17:09 INFO ca.uhn.fhir.cli.RunServerCommand - Server Base URL: http://localhost:8080/baseDstu2/
I never changed permissions or anything. @James Agnew , do you have any ideas what could be going on? I don't know why I'm not getting a consistent behavior. Thanks a lot!
Gaston Fiore (Jul 01 2016 at 20:55):
Now it did not start. Again, I have not changed anything:
gaston@pgx-fhir:~/bin/server$ java -jar ../hapi-fhir-cli.jar run-server ------------------------------------------------------------ 🔥 HAPI FHIR 1.5 - Command Line Tool ------------------------------------------------------------ Max configured JVM memory (Xmx): 239.8MB Detected Java version: 1.8.0_91 ------------------------------------------------------------ 20:49:45 INFO ca.uhn.fhir.context.FhirContext - Creating new FHIR context for FHIR version [DSTU2] 20:49:46 INFO ca.uhn.fhir.cli.RunServerCommand - Preparing HAPI FHIR JPA server on port 8080 20:49:46 INFO ca.uhn.fhir.cli.RunServerCommand - Starting HAPI FHIR JPA server in DSTU2 mode Killed
James Agnew (Jul 04 2016 at 22:15):
I wonder if it's possible it's running out of memory... Can you try it with a larger memory setting?
java -Xmx1024m -jar ../hapi-fhir-cli.jar run-server
Gaston Fiore (Jul 05 2016 at 12:22):
Thanks @James Agnew ! I'm also going to enable swap memory in the host to see if that helps.
Last updated: Apr 12 2022 at 19:14 UTC