JPA Server running local

928 views
Skip to first unread message

heathm...@gmail.com

unread,
Mar 22, 2015, 12:06:58 PM3/22/15
to hapi...@googlegroups.com
I'm trying to get a local FHIR service up and running and possibly deployed to Azure (Tomcat) for a class project I'm in at Ga Tech.

I followed all of the directions from the site here:

All went well and I now navigate to here:

The page loads and looks similar to the public API we have been using here: http://fhirtest.uhn.ca/home?encoding=json&pretty=true

But... I see a red error at the top of my local site:
"Warning!

Failed to load conformance statement, error was: ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException: HTTP 404 Not Found"

I also don't see the normal list of Resources on the left so that I can create Patients ect..

James Agnew

unread,
Mar 22, 2015, 12:41:40 PM3/22/15
to heathm...@gmail.com, hapi...@googlegroups.com
Hi Heath,

A few people have reported similar issues lately. I think it has to do with flaky detection by the testing UI of what it's own URL is in some web containers.

Can you try the following?
1. Look for the hapi-fhir-tester-config.xml file, which you should find in the src/main/webapp/WEB-INF directory in the example project
2. Edit this file, looking for the string "${serverBase}" and replacing it with "http://localhost:8080/hapi-fhir-jpaserver-example" (no quotes of course)

If this works, awesome, but it means there is still a problem with the way HAPI is detecting the server base from the tester.

Ps no obligations whatsoever of course but I'd love to hear more about the class project- It's always nice for us to hear about new places where HAPI is being used. :)

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+...@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/e21f1cab-4180-4388-aac6-53d1e16036a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

heathm...@gmail.com

unread,
Mar 23, 2015, 4:52:45 PM3/23/15
to hapi...@googlegroups.com, heathm...@gmail.com
James,
You are the man!
We're up and running. I have it hosted and running on a vm on Azure. Due to "hard coding" the base URL, it does show incorrectly on the site but that's not important for us.

I'm taking an online class at Georgia Tech, CS6400 Health Informatics. You're site and API was mentioned and referenced as the de facto fhir standard. We've been using it for testing our project code but realized we needed more control over the data for our class project. Thus the reason for hosting our own instance. The project is pretty open ended. We're building a patient portal using nearly 100% javascript so the CORS support is a big bonus. We'll be sure to reference the hard work you've put into the code base.

Heath

pa.f....@gmail.com

unread,
Oct 15, 2015, 10:12:47 AM10/15/15
to HAPI FHIR, heathm...@gmail.com
Hi,

i want to revive this topic. I've just installed the latest Snapshot of the JPA-Server Example. The hapi server is deployed on a tomcat which is proxied by a tomcat (AJP connection) and i got the same error code.

If replace the server base with the https URL of the Server i get:
Warning!

Failed to load conformance statement, error was: ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?


with the http URL:

Warning!

Failed to load conformance statement, error was: ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException: HTTP 404 Not Found


the only way to make it work is to insert localhost:8080 as the base address. I tried to debug the problem, but failed :/

Is there any news about this issue? Should i open a github issue?


Thanks

Patrick Werner

James Agnew

unread,
Oct 15, 2015, 10:28:06 AM10/15/15
to pa.f....@gmail.com, HAPI FHIR, Heath Murphy
Hi Patrick,

Can you describe your architecture a bit more? The testing UI needs to be able to access the FHIR server as though it was a normal client, and it sounds like something about your proxy setup is causing issues there.

Cheers,
James



pa.f....@gmail.com

unread,
Mar 31, 2016, 11:33:18 AM3/31/16
to HAPI FHIR, pa.f....@gmail.com, heathm...@gmail.com
finally i found the time for more testing on this issue:

It doesn't matter if i use ajp or http proxy in Apache. If i use https I always get: Failed to load conformance statement, error was: ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? 
So the Webtester doesn't support HTTPS.

If i switch to an pure HTTP Setting i get:

Failed to load conformance statement, error was: ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException: HTTP 404 Not Found


FhirTesterConfig (edited part):
@Bean
public TesterConfig testerConfig() {
   TesterConfig retVal = new TesterConfig();
   retVal
      .addServer()
         .withId("hhn")
         .withFhirVersion(FhirVersionEnum.DSTU2)
         .withBaseUrl("http://fhir.iap.hs-heilbronn.de/baseDstu2")
         .withName("HHN Gecko Test Server")
      .addServer()
         .withId("hapi")
         .withFhirVersion(FhirVersionEnum.DSTU2)
         .withBaseUrl("https://fhirtest.uhn.ca/baseDstu2")
         .withName("Public HAPI Test Server");
   return retVal;
}

apache config:
VirtualHost 141.7.10.238:80>
 <VirtualHost 141.7.10.238:80>
        ServerName fhir.iap.hs-heilbronn.de
        ServerAdmin ***@hs-heilbronn.de
        ProxyRequests off
        ProxyPass / http://localhost:8080/
        ProxyPassReverse / http://localhost:8080/
</VirtualHost>

StackTrace Tomcat:

2016-03-31 17:20:17.101 [http-bio-8080-exec-12] WARN  ca.uhn.fhir.to.BaseController [BaseController.java:394] Failed to load conformance statement

ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException: HTTP 404 Not Found

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException.newInstance(BaseServerResponseException.java:272)

at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:290)

at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:185)

at ca.uhn.fhir.rest.client.GenericClient.conformance(GenericClient.java:186)

at ca.uhn.fhir.to.BaseController.loadAndAddConfDstu2(BaseController.java:392)

at ca.uhn.fhir.to.BaseController.loadAndAddConf(BaseController.java:319)

at ca.uhn.fhir.to.BaseController.addCommonParams(BaseController.java:95)

at ca.uhn.fhir.to.Controller.actionHome(Controller.java:215)

at sun.reflect.GeneratedMethodAccessor207.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:817)

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:731)

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)

at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.ebaysf.web.cors.CORSFilter.handleNonCORS(CORSFilter.java:437)

at org.ebaysf.web.cors.CORSFilter.doFilter(CORSFilter.java:172)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)

at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)



I don't find anything about the conformance resource in the apache access log. 
The HAPI Server itself is working.

Thank you
Patrick

pa.f....@gmail.com

unread,
Mar 31, 2016, 1:24:13 PM3/31/16
to HAPI FHIR, pa.f....@gmail.com, heathm...@gmail.com
I spent the afternoon remote debugging the weboverlay. I could narrow the Problem to the following code part:

public class ApacheHttpRequest implements IHttpRequest
   -> Line70(decompiled) method: 
   public IHttpResponse execute()

but i couldn't figure out the actual problem, here is the state of myclient & myRequest

myRequest = {HttpGet@11403} "GET http://fhir.iap.hs-heilbronn.de/baseDstu2/metadata HTTP/1.1"
    version = null
    config = null
    aborted = {AtomicBoolean@11529} "false"
    cancellableRef = {AtomicReference@11530} "org.apache.http.impl.execchain.ConnectionHolder@6d67f2de"
    headergroup = {HeaderGroup@11531} "[User-Agent: HAPI-FHIR/1.5-SNAPSHOT (FHIR Client; FHIR DSTU2; apache), Accept-Charset: utf-8, Accept-Encoding: gzip, Accept: application/xml+fhir;q=1.0, application/json+fhir;q=1.0]"
    params = {BasicHttpParams@11486} 
myClient = {InternalHttpClient@11206} 
   log = {SLF4JLocationAwareLog@11536} 
   execChain = {RedirectExec@11500} 
   connManager = {PoolingHttpClientConnectionManager@11537} 
   routePlanner = {DefaultRoutePlanner@11538} 
   cookieSpecRegistry = {Registry@11539} "{standard=org.apache.http.impl.cookie.RFC6265CookieSpecProvider@1a5e737f, netscape=org.apache.http.impl.cookie.NetscapeDraftSpecProvider@24e414ac, standard-strict=org.apache.http.impl.cookie.RFC6265CookieSpecProvider@b06d8e4, default=org.apache.http.impl.cookie.DefaultCookieSpecProvider@59a53a58, best-match=org.apache.http.impl.cookie.DefaultCookieSpecProvider@59a53a58, ignorecookies=org.apache.http.impl.cookie.IgnoreSpecProvider@30096f98, compatibility=org.apache.http.impl.cookie.DefaultCookieSpecProvider@59a53a58}"
   authSchemeRegistry = {Registry@11540} "{negotiate=org.apache.http.impl.auth.SPNegoSchemeFactory@344c4c41, ntlm=org.apache.http.impl.auth.NTLMSchemeFactory@93063d4, digest=org.apache.http.impl.auth.DigestSchemeFactory@79b7ef50, kerberos=org.apache.http.impl.auth.KerberosSchemeFactory@2392a51, basic=org.apache.http.impl.auth.BasicSchemeFactory@54c14013}"
   cookieStore = {BasicCookieStore@11541} "[]"
   credentialsProvider = {BasicCredentialsProvider@11542} "{}"
   defaultConfig = {RequestConfig@11543} "[expectContinueEnabled=false, proxy=null, localAddress=null, cookieSpec=null, redirectsEnabled=true, relativeRedirectsAllowed=true, maxRedirects=50, circularRedirectsAllowed=false, authenticationEnabled=true, targetPreferredAuthSchemes=null, proxyPreferredAuthSchemes=null, connectionRequestTimeout=10000, connectTimeout=10000, socketTimeout=10000, contentCompressionEnabled=true]"
   closeables = {ArrayList@11544}  size = 1
   CloseableHttpClient.log = {SLF4JLocationAwareLog@11536} 

http://fhir.iap.hs-heilbronn.de/baseDstu2/metadata 
is the correct uri to the conformance statement.

pa.f....@gmail.com

unread,
Apr 1, 2016, 5:15:26 AM4/1/16
to HAPI FHIR, pa.f....@gmail.com, heathm...@gmail.com
solved it (actually a workmate of mine solved it), i feel stupid now.
Here the solution if someone else has the same problem:

in the apache config <VirtualHost 141.7.10.238:80> only listened on the external IP Adress. Due to the hosts file the URL of the Server was resolved to 127.0.0.1 and the external IP. But the apache didn't listen on localhost. 
We fixed it by removing the mapping FQDN -> 127.0.0.1 and just put FQDN -> external ip in /etc/hosts

It know also works with HTTPS.
Reply all
Reply to author
Forward
0 new messages