How to create a HAPI server based on the jpaserver-example project?

285 views
Skip to first unread message

Zoltan Sz.

unread,
Jun 21, 2017, 8:58:15 AM6/21/17
to HAPI FHIR
Hi,

After using the official jpaserver-example project for over a year we came to the decision to create a separate, standalone version of this project for our development team, with authentication and other needed features.

My question is, what is the fastest way to create a jpaserver-example style HAPI server, which is separated from the main HAPI repository, and doesn't include all the other examples, plugins, only the required dependencies. My first try was to start reducing the contents of the main hapi-fhir repository until only the required elements remained - this however proved to be very time-consuming. The tutorials on the main page doesn't include on how to use the jpaserver frontend, which is required by my superiors for debugging purposes... Is there an easier way to do this, or an existing standalone, ready-to-develop version of the server (and frontend) which isn't hardwired into the main repository and I might have overlooked?

Thanks in advance,
Zoltán Szabó

James Agnew

unread,
Jun 21, 2017, 10:13:35 AM6/21/17
to Zoltan Sz., HAPI FHIR
Hi Zoltan,

There is a sample project that isn't embedded in the main HAPI repo here: https://github.com/furore-fhir/fhirstarters/tree/master/java/hapi-fhirstarters-jpaserver-example

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/02ea87d3-e806-4968-a48f-c1e12c320c16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zoltan Sz.

unread,
Jun 22, 2017, 3:29:21 AM6/22/17
to HAPI FHIR, zzll...@gmail.com
Looks amazing, and actually made some aspects of the project much clearer for my further tasks. However I encountered a problem, also mentioned at the end of this https://github.com/jamesagnew/hapi-fhir/issues/105 older thread. When running the tests, I get the ResourceNotFoundException for line 38 in ExampleServerIT.java ( 
IIdType id = ourClient.create().resource(pt).execute().getId(); ), and although the .war file is generated, I can't start the deployed project on Tomcat because of the "Application at context path /hapi-fhir-jpaserver-example could not be started" error.

James Agnew

unread,
Jun 22, 2017, 5:57:52 AM6/22/17
to Zoltan Sz., HAPI FHIR
I'd recommend starting by confirming that you aren't seeing this same problem: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/hapi-fhir/0OFwyjvu0v4/eDDkreBRAQAJ

If not, can you post logs showing the stack traces that occur?

Cheers,
James

On Thu, Jun 22, 2017 at 3:29 AM, Zoltan Sz. <zzll...@gmail.com> wrote:
Looks amazing, and actually made some aspects of the project much clearer for my further tasks. However I encountered a problem, also mentioned at the end of this https://github.com/jamesagnew/hapi-fhir/issues/105 older thread. When running the tests, I get the ResourceNotFoundException for line 38 in ExampleServerIT.java ( 
IIdType id = ourClient.create().resource(pt).execute().getId(); ), and although the .war file is generated, I can't start the deployed project on Tomcat because of the "Application at context path /hapi-fhir-jpaserver-example could not be started" error.

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.

Zoltan Sz.

unread,
Jun 22, 2017, 7:24:20 AM6/22/17
to HAPI FHIR, zzll...@gmail.com
No, but based on the recommendations in that thread, I made some checkups on writing/reading permissions, also fired up Tomcat with sudo (I'm developing on mac). This caused a rather strange result - the fhirstarter deploy still won't work, the official jpaserver-example war generated from the hapi-fhir repo however runs, but throws an exception (log included).

I'm beginning to suspect that we forgot some very basic setting concerning the data source... the dev server might be an out of the box Apache Tomcat, with only the admin users and it's roles configured. I might get the permission to look at and edit the server.xml file, what should I look for in it?

Hibernate - Jun 22, 2017 1:10:26 PM org.apache.catalina.core.log

James Agnew

unread,
Jun 22, 2017, 8:49:35 AM6/22/17
to Zoltan Sz., HAPI FHIR
This looks to be the error:

Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database /Users/ZooLee/apache-tomcat-6.0.53/bin/target/jpaserver_derby_files.

I would try stopping tomcat, deleting that directory and restarting tomcat.

Cheers,
James

On Thu, Jun 22, 2017 at 7:24 AM, Zoltan Sz. <zzll...@gmail.com> wrote:
No, but based on the recommendations in that thread, I made some checkups on writing/reading permissions, also fired up Tomcat with sudo (I'm developing on mac). This caused a rather strange result - the fhirstarter deploy still won't work, the official jpaserver-example war generated from the hapi-fhir repo however runs, but throws an exception (log included).

I'm beginning to suspect that we forgot some very basic setting concerning the data source... the dev server might be an out of the box Apache Tomcat, with only the admin users and it's roles configured. I might get the permission to look at and edit the server.xml file, what should I look for in it?

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.

Zoltan Sz.

unread,
Jun 23, 2017, 6:11:41 AM6/23/17
to HAPI FHIR, zzll...@gmail.com
Nearly there - the .war is finally deployed and running, but there's still an exception when trying to open the frontend layout. Log included:


localhost.2017-06-23.log

James Agnew

unread,
Jun 23, 2017, 7:00:50 AM6/23/17
to Zoltan Sz., HAPI FHIR
A quick Google of that error suggests you are using a version of Tomcat that is too old.

Cheers,
James

On Fri, Jun 23, 2017 at 6:11 AM, Zoltan Sz. <zzll...@gmail.com> wrote:
Nearly there - the .war is finally deployed and running, but there's still an exception when trying to open the frontend layout. Log included:


--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+unsubscribe@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.

Zoltan Sz.

unread,
Jun 30, 2017, 4:12:45 AM6/30/17
to HAPI FHIR, zzll...@gmail.com
Hi,

Everything works like a charm, this week I was able to start the development. Thank you for your help :)

Zoltan
Reply all
Reply to author
Forward
0 new messages