ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to retrieve the server meta

1,746 views
Skip to first unread message

bhanot...@gmail.com

unread,
Jul 27, 2017, 8:49:28 AM7/27/17
to HAPI FHIR
Hi All,
I am facing the following error when i am hitting the FHIR public server from FHIR client present in the code. Below is the stack trace of the error:-

2017-07-26T18:16:32.70+0300 [App/0]      ERR     ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to retrieve the server metadata statement during client initialization. URL used was http://fhirtest.uhn.ca/baseDstu3/.com/metadata
2017-07-26T18:16:32.70+0300 [App/0]      ERR at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBase(RestfulClientFactory.java:314)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBaseIfConfiguredToDoSo(RestfulClientFactory.java:203)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:189)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at ca.uhn.fhir.rest.client.GenericClient$BaseClientExecutable.invoke(GenericClient.java:741)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at ca.uhn.fhir.rest.client.GenericClient$SearchInternal.execute(GenericClient.java:2129)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at ca.uhn.fhir.rest.client.GenericClient$SearchInternal.execute(GenericClient.java:1955)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at com.moh.cas.integrate.cashisinterface.processors.SlotSearchFhirCallProcess.myProcess(SlotSearchFhirCallProcess.java:119)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at com.moh.cas.integrate.cashisinterface.processors.CasBaseProcess.process(CasBaseProcess.java:85)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:529)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:497)
2017-07-26T18:16:32.70+0300 [App/0]      ERR at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:365)
2017-07-26T18:16:32.71+0300 [App/0]      ERR at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:497)
2017-07-26T18:16:32.71+0300 [App/0]      ERR at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:242)
2017-07-26T18:16:32.71+0300 [App/0]      ERR at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:148)
2017-07-26T18:16:32.71+0300 [App/0]      ERR at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:156)
2017-07-26T18:16:32.71+0300 [App/0]      ERR at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:173)
2017-07-26T18:16:32.71+0300 [App/0]      ERR at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:305)
2017-07-26T18:16:32.71+0300 [App/0]      ERR at com.moh.cas.integrate.cashisinterface.api.AppController.sendToSlotPostRouter(AppController.java:18)
2017-07-26T18:16:32.71+0300 [App/0]      ERR at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 


Help is much  appreciated.


Thanksand Regards,
Sahil

James Agnew

unread,
Jul 27, 2017, 8:51:33 AM7/27/17
to bhanot...@gmail.com, HAPI FHIR
It looks like there is a weird ".com" in the server base url, judging by the top of that stack trace.

I'd double check the base URL you are using to create the client.

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/8c2850a4-d49f-440d-b2dd-2f07f0c07c74%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bhanot...@gmail.com

unread,
Jul 27, 2017, 8:57:13 AM7/27/17
to HAPI FHIR, bhanot...@gmail.com
Hi James, Apologies that was a copy paste error, I dont know how that .com came in between......posting the error trace again......


2017-07-26T18:16:32.70+0300 [App/0]      ERR     ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to retrieve the server metadata statement during client initialization. URL used was http://fhirtest.uhn.ca/baseDstu3/metadata

James Agnew

unread,
Jul 27, 2017, 10:18:07 AM7/27/17
to bhanot...@gmail.com, HAPI FHIR
Hmm.. Are you able to reproduce however you are calling this in an IDE with a code snippet? If so, can you post the code snippet that reproduces this?

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.

bhanot...@gmail.com

unread,
Jul 27, 2017, 10:31:06 AM7/27/17
to HAPI FHIR, bhanot...@gmail.com
Hi James,
I am getting the FHIR context and client form the below mentioned functions:-

protected FhirContext getFHIRContext()
{
FhirContext ctx = FhirContext.forDstu3();
if(proxyURL !=null && !(proxyURL.isEmpty()) && proxyPort !=0 )
ctx.getRestfulClientFactory().setProxy(proxyURL, proxyPort);
if(proxyUsername !=null && !(proxyUsername.isEmpty()) && proxyPassword !=null && !proxyPassword.isEmpty())
ctx.getRestfulClientFactory().setProxyCredentials(proxyUsername, proxyPassword);
return ctx;
}
protected IGenericClient getFHIRClient(FhirContext ctx,String facility_ID)
{
CASHISEndpoint e=searchEndPoint.getEndpoints(facility_ID);
System.out.println("In CASBASE Process:------------ "+e.getFacility_ID()+"   "+e.getHis_EndPoint());
IGenericClient client = ctx.newRestfulGenericClient(e.getHis_EndPoint());
return client;
}
-----------------------------------------------------------------------------------------------------------------------------------
                // get FHIR context
FhirContext ctx = getFHIRContext();
// get IGeneric Client
IGenericClient client = super.getFHIRClient(ctx,this.getLocationId().toString());
IQuery<ca.uhn.fhir.model.api.Bundle> query = client.search().forResource("Slot"); 
               responseBundle = query.encodedJson().returnBundle(Bundle.class).execute();
It is giving me error on the last line which is highlighted. 

one more info to add.....this code is working fine in my local environment. When i push this code to PREDIX platform the only i am facing the issue.
I hope i am providing the sufficient info. Kindly let me know in  case you need any further info.

Thanks and Regards,
Sahil 
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.

James Agnew

unread,
Jul 27, 2017, 10:44:01 AM7/27/17
to bhanot...@gmail.com, HAPI FHIR
If the same code works locally for you, that sounds like it's something specific to your environment. I would double check that the server you are deploying to has the appropriate permissions and firewall rules to be able to access the internet. Also double check the proxy settings you are using. 

If there are any other stack traces in the error log that might also help.

Cheers,
james

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.

bhanot...@gmail.com

unread,
Jul 27, 2017, 11:13:38 AM7/27/17
to HAPI FHIR, bhanot...@gmail.com
Hi James,
I am also thinking in the same direction. This is issue with the environment settings. As i am novice to PREDIX,plus i dont have the admin access to the platform where i could see the configuration settings. Simultaneously i have opened the ticket with the PREDIX expert team. Waiting for their revert.

ll post the findings once i ll get their response.

Thank you very much for your valuable responses. 

Regards,
Sahil

bhanot...@gmail.com

unread,
Aug 23, 2017, 6:20:51 AM8/23/17
to HAPI FHIR, bhanot...@gmail.com

Hi All,

Apologies for posting it so late. This issue has been solved long back.

It was a proxy issue. Nothing related to FHIR.

Thanks a lot for your valuable inputs on this.

CHEERS... :)


On Thursday, July 27, 2017 at 3:49:28 PM UTC+3, cse062...@gmail.com wrote:

pothanna...@gmail.com

unread,
Jun 13, 2018, 2:45:23 AM6/13/18
to HAPI FHIR

Hi All,
I am facing the following error when i am hitting the FHIR public server from FHIR client present in the code. Below is the stack trace of the error:-



ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to retrieve the server metadata statement during client initialization. URL used was http://nprogram.azurewebsites.net/metadata
at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBase(RestfulClientFactory.java:288) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBaseIfConfiguredToDoSo(RestfulClientFactory.java:202) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:207) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.GenericClient$BaseClientExecutable.invoke(GenericClient.java:717) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.GenericClient$SearchInternal.execute(GenericClient.java:1999) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.GenericClient$SearchInternal.execute(GenericClient.java:1841) ~[hapi-fhir-base-1.6.jar:na]
at com.interopx.hl7.service.Hl7CServiceImpl.insertFhirContent(Hl7CServiceImpl.java:165) ~[classes/:na]
at com.interopx.hl7.service.Hl7CServiceImpl$$FastClassBySpringCGLIB$$afcc980b.invoke(<generated>) ~[classes/:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) ~[spring-tx-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) ~[spring-aop-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at com.interopx.hl7.service.Hl7CServiceImpl$$EnhancerBySpringCGLIB$$ba2daf10.insertFhirContent(<generated>) ~[classes/:na]
at com.interopx.hl7.controller.H17ConnectorController.getResourceDataByExtractionId(H17ConnectorController.java:34) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) ~[spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) ~[spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) ~[spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) [spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) [spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) [spring-webmvc-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.16.jar:8.5.16]
at com.interopx.hl7.util.CorsFilters.doFilter(CorsFilters.java:24) [classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.3.10.RELEASE.jar:4.3.10.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455) [tomcat-embed-core-8.5.16.jar:8.5.16]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.16.jar:8.5.16]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_161]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.16.jar:8.5.16]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_161]
Caused by: ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to parse response from server when performing GET to URL http://nprogram.azurewebsites.net/metadata - ca.uhn.fhir.parser.DataFormatException: DataFormatException at [[row,col {unknown-source}]: [2,1]]: Incorrect resource type found, expected "Conformance" but found "CapabilityStatement"
at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:359) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.GenericClient$BaseClientExecutable.invoke(GenericClient.java:717) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.GenericClient$FetchConformanceInternal.execute(GenericClient.java:1007) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBase(RestfulClientFactory.java:285) ~[hapi-fhir-base-1.6.jar:na]
... 74 common frames omitted
Caused by: ca.uhn.fhir.parser.DataFormatException: DataFormatException at [[row,col {unknown-source}]: [2,1]]: Incorrect resource type found, expected "Conformance" but found "CapabilityStatement"
at ca.uhn.fhir.parser.XmlParser.doXmlLoop(XmlParser.java:268) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.XmlParser.parseResource(XmlParser.java:1046) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.XmlParser.doParseResource(XmlParser.java:187) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:604) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.BaseClient$ResourceResponseHandler.invokeClient(BaseClient.java:534) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.BaseClient$ResourceResponseHandler.invokeClient(BaseClient.java:486) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:352) ~[hapi-fhir-base-1.6.jar:na]
... 77 common frames omitted
Caused by: ca.uhn.fhir.parser.DataFormatException: Incorrect resource type found, expected "Conformance" but found "CapabilityStatement"
at ca.uhn.fhir.parser.ParserState$PreResourceState.enteringNewElement(ParserState.java:2024) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.ParserState.enteringNewElement(ParserState.java:137) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.XmlParser.doXmlLoop(XmlParser.java:220) ~[hapi-fhir-base-1.6.jar:na]
... 83 common frames omitted

2018-06-13 12:08:46.391 ERROR 27900 --- [nio-2226-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is ca.uhn.fhir.rest.client.exceptions.FhirClientConnectionException: Failed to retrieve the server metadata statement during client initialization. URL used was http://nprogram.azurewebsites.net/metadata] with root cause

ca.uhn.fhir.parser.DataFormatException: Incorrect resource type found, expected "Conformance" but found "CapabilityStatement"
at ca.uhn.fhir.parser.ParserState$PreResourceState.enteringNewElement(ParserState.java:2024) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.ParserState.enteringNewElement(ParserState.java:137) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.XmlParser.doXmlLoop(XmlParser.java:220) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.XmlParser.parseResource(XmlParser.java:1046) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.XmlParser.doParseResource(XmlParser.java:187) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.parser.BaseParser.parseResource(BaseParser.java:604) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.BaseClient$ResourceResponseHandler.invokeClient(BaseClient.java:534) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.BaseClient$ResourceResponseHandler.invokeClient(BaseClient.java:486) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.BaseClient.invokeClient(BaseClient.java:352) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.GenericClient$BaseClientExecutable.invoke(GenericClient.java:717) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.GenericClient$FetchConformanceInternal.execute(GenericClient.java:1007) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBase(RestfulClientFactory.java:285) ~[hapi-fhir-base-1.6.jar:na]
at ca.uhn.fhir.rest.client.RestfulClientFactory.validateServerBaseIfConfiguredToDoSo(RestfulClientFactory.java:202) ~[hapi-fhir-base-1.6.jar:na]

Trying FHIR

unread,
Aug 2, 2018, 12:59:16 PM8/2/18
to HAPI FHIR
Hi,
Were you able to resolve the issue. I am having the same error when i try to connect to http://fhirtest.uhn.ca/baseDstu2 server.
I even tried proxy authentication but i get 403 when I add proxy details.

Thank you,
Reply all
Reply to author
Forward
0 new messages