FHIR Chat · Failed to initialize FHIR Restful server · implementers

Stream: implementers

Topic: Failed to initialize FHIR Restful server


view this post on Zulip Rajan Kumar (Oct 11 2020 at 12:47):

Hi, I am new to FHIR APIs. I have decent Java experience and am putting my hands on FHIR APIs for the first time.

I am trying a small prototype where in I tried to use FHIR Java APIs (https://hapifhir.io/) along with Spring Boot. I have FHIR APIs included as my project's Maven dependencies and my Spring Boot is starting without any issues.

My RestfulServer implementation goes as below

 //Initialize
    @Override
    protected void initialize()throws ServletException{
        //create a context for the appropriate version
        setFhirContext(FhirContext.forR5());
        registerProvider(new PatientResourceProvider());
    }

However, when I try to access http://localhost:8080/metata getting below exception. Any help is greatly appreciated.

javax.servlet.ServletException: Failed to initialize FHIR Restful server
ca.uhn.fhir.rest.server.RestfulServer.init(RestfulServer.java:1274)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Thread.java:832)

Root Cause

ca.uhn.fhir.context.ConfigurationException: Incorrect use of type UnsignedIntDt as parameter type for method when context is for version R5 in method: public ca.uhn.fhir.rest.api.server.IBundleProvider ca.uhn.fhir.jpa.provider.BaseJpaResourceProviderPatientDstu2.patientInstanceEverything(javax.servlet.http.HttpServletRequest,ca.uhn.fhir.model.primitive.IdDt,ca.uhn.fhir.model.primitive.UnsignedIntDt,ca.uhn.fhir.rest.param.DateRangeParam,java.util.List,java.util.List,java.util.List,ca.uhn.fhir.rest.api.SortSpec,ca.uhn.fhir.rest.api.server.RequestDetails)
ca.uhn.fhir.rest.server.method.OperationParameter.initializeTypes(OperationParameter.java:131)
ca.uhn.fhir.rest.server.method.MethodUtil.getResourceParameters(MethodUtil.java:296)
ca.uhn.fhir.rest.server.method.BaseMethodBinding.<init>(BaseMethodBinding.java:74)
ca.uhn.fhir.rest.server.method.BaseResourceReturningMethodBinding.<init>(BaseResourceReturningMethodBinding.java:70)
ca.uhn.fhir.rest.server.method.OperationMethodBinding.<init>(OperationMethodBinding.java:80)
ca.uhn.fhir.rest.server.method.OperationMethodBinding.<init>(OperationMethodBinding.java:180)
ca.uhn.fhir.rest.server.method.BaseMethodBinding.bindMethod(BaseMethodBinding.java:443)
ca.uhn.fhir.rest.server.RestfulServer.findResourceMethods(RestfulServer.java:419)
ca.uhn.fhir.rest.server.RestfulServer.findResourceMethods(RestfulServer.java:390)
ca.uhn.fhir.rest.server.RestfulServer.registerProviders(RestfulServer.java:1604)
ca.uhn.fhir.rest.server.RestfulServer.init(RestfulServer.java:1235)
javax.servlet.GenericServlet.init(GenericServlet.java:158)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.base/java.lang.Thread.run(Thread.java:832)

view this post on Zulip Lloyd McKenzie (Oct 11 2020 at 14:07):

You might raise this on the #hapi stream, which is focused on the Java reference implementation

view this post on Zulip Rajan Kumar (Oct 11 2020 at 14:10):

Great, thank you!


Last updated: Apr 12 2022 at 19:14 UTC