Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting server_address to something running behind reverse proxy seem to NOT work since 5.1.0 #164

Closed
petermicuch opened this issue Nov 9, 2020 · 38 comments

Comments

@petermicuch
Copy link
Contributor

I was using HAPI server version 5.0.2, connected to postgres DB and running in k8s cluster. Everything was running just fine. I now switched to HAPI server version 5.1.0 and I am getting errors on resolving server_address. Below is error from server running on Docker Desktop for Windows, but the same issue I can see in Azure Kubernetes Services.

Provided subpath /fhir-dstu3 resolves by reverse proxy and is proxied to HAPI server service and /fhir subpath. As said, this all worked fine on 5.0.2, but not with 5.1.0. Was there any change done recently in the area of server_address handling?

2020-11-09 16:27:43.465 [main] WARN  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext [AbstractApplicationContext.java:558] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'errorPageFilterRegistration' defined in org.springframework.boot.web.servlet.support.ErrorPageFilterConfiguration: Unsatisfied dependency expressed through method 'errorPageFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'errorPageFilter' defined in org.springframework.boot.web.servlet.support.ErrorPageFilterConfiguration: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties' : prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties 
under 'server.address' to java.net.InetAddress
2020-11-09 16:27:43.465 [main] INFO  o.s.s.c.ThreadPoolTaskExecutor [ExecutorConfigurationSupport.java:208] Shutting down ExecutorService 'jobLaunchingTaskExecutor'
2020-11-09 16:27:43.525 [main] INFO  c.u.f.j.c.HapiFhirLocalContainerEntityManagerFactoryBean [AbstractEntityManagerFactoryBean.java:598] Closing JPA EntityManagerFactory for persistence unit 'HAPI_PU'
2020-11-09 16:27:43.534 [main] INFO  com.zaxxer.hikari.HikariDataSource [HikariDataSource.java:347] HikariPool-1 - Shutdown initiated...
2020-11-09 16:27:43.534 [main] INFO  com.zaxxer.hikari.pool.HikariPool [HikariPool.java:204] HikariPool-1 - Close initiated...
2020-11-09 16:27:43.672 [main] INFO  com.zaxxer.hikari.pool.HikariPool [HikariPool.java:238] HikariPool-1 - Closed.
2020-11-09 16:27:43.673 [main] INFO  com.zaxxer.hikari.HikariDataSource [HikariDataSource.java:349] HikariPool-1 - Shutdown completed.
2020-11-09 16:27:43.685 [main] INFO  o.s.b.a.l.ConditionEvaluationReportLoggingListener [ConditionEvaluationReportLoggingListener.java:136]

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-11-09 16:27:43.726 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter [LoggingFailureAnalysisReporter.java:40]

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'server.address' to java.net.InetAddress:

    Property: server.address
    Value: http://host.docker.internal/fhir-dstu3
    Origin: System Environment Property "server_address"
    Reason: failed to convert java.lang.String to java.net.InetAddress

Action:

Update your application's configuration

09-Nov-2020 16:27:43.727 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/usr/local/tomcat/webapps/ROOT.war]
        java.lang.IllegalStateException: Error starting child
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1848)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
                at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
                at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
                at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
                at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
                at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
                at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
                at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
        Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
                ... 37 more
        Caused by: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'errorPageFilterRegistration' defined in org.springframework.boot.web.servlet.support.ErrorPageFilterConfiguration: Unsatisfied dependency expressed through method 'errorPageFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'errorPageFilter' defined in org.springframework.boot.web.servlet.support.ErrorPageFilterConfiguration: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties' : prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server.address' to java.net.InetAddress
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:161)
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
                at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
                at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
                at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:173)
                at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:153)
                at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:95)
                at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5128)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                ... 38 more
        Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'errorPageFilterRegistration' defined in org.springframework.boot.web.servlet.support.ErrorPageFilterConfiguration: Unsatisfied dependency expressed through method 'errorPageFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'errorPageFilter' defined in org.springframework.boot.web.servlet.support.ErrorPageFilterConfiguration: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties' : prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server.address' to java.net.InetAddress
                at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:798)
                at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:539)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
                at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
                at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:211)
                at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:202)
                at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:96)
                at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:85)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:255)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:229)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:186)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158)
                ... 50 more
        Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'errorPageFilter' defined in org.springframework.boot.web.servlet.support.ErrorPageFilterConfiguration: Initialization of bean failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties' : prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server.address' to java.net.InetAddress
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:603)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
                at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
                at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207)
                at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:885)
                at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:789)
                ... 67 more
        Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration': Unsatisfied dependency 
expressed through constructor parameter 0; nested exception is org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties' : prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server.address' to java.net.InetAddress
                at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:798)
                at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:228)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
                at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
                at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:409)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
                at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:617)
                at org.springframework.boot.web.server.ErrorPageRegistrarBeanPostProcessor.getRegistrars(ErrorPageRegistrarBeanPostProcessor.java:76)
                at org.springframework.boot.web.server.ErrorPageRegistrarBeanPostProcessor.postProcessBeforeInitialization(ErrorPageRegistrarBeanPostProcessor.java:67)
                at org.springframework.boot.web.server.ErrorPageRegistrarBeanPostProcessor.postProcessBeforeInitialization(ErrorPageRegistrarBeanPostProcessor.java:56)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
                ... 77 more
        Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'server-org.springframework.boot.autoconfigure.web.ServerProperties': Could not bind properties to 'ServerProperties' : prefix=server, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server.address' to java.net.InetAddress
                at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:92)
                at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:78)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
                at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
                at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1287)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1207)
                at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:885)
                at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:789)
                ... 102 more
        Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'server.address' to java.net.InetAddress
                at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:363)
                at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:323)
                at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$4(Binder.java:447)
                at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:92)
                at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:80)
                at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:56)
                at org.springframework.boot.context.properties.bind.Binder.lambda$bindDataObject$5(Binder.java:451)
                at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:571)
                at org.springframework.boot.context.properties.bind.Binder$Context.withDataObject(Binder.java:557)
                at org.springframework.boot.context.properties.bind.Binder$Context.access$300(Binder.java:512)
                at org.springframework.boot.context.properties.bind.Binder.bindDataObject(Binder.java:449)
                at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:390)
                at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:319)
                at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:308)
                at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:238)
                at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:225)
                at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:90)
                at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:89)
                ... 116 more
        Caused by: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.net.InetAddress] for value 'http://host.docker.internal/fhir-dstu3'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [http://host.docker.internal/fhir-dstu3]
                at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:47)
                at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:191)
                at org.springframework.boot.context.properties.bind.BindConverter$CompositeConversionService.convert(BindConverter.java:170)
                at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:96)
                at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:88)
                at org.springframework.boot.context.properties.bind.Binder.bindProperty(Binder.java:434)
                at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:379)
                at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:319)
                ... 132 more
        Caused by: java.lang.IllegalArgumentException: Parse attempt failed for value [http://host.docker.internal/fhir-dstu3]
                at org.springframework.format.support.FormattingConversionService$ParserConverter.convert(FormattingConversionService.java:223)
                at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:41)
                ... 139 more
        Caused by: java.lang.IllegalStateException: Unknown host http://host.docker.internal/fhir-dstu3
                at org.springframework.boot.convert.InetAddressFormatter.parse(InetAddressFormatter.java:44)
                at org.springframework.boot.convert.InetAddressFormatter.parse(InetAddressFormatter.java:31)
                at org.springframework.format.support.FormattingConversionService$ParserConverter.convert(FormattingConversionService.java:217)
                ... 140 more
        Caused by: java.net.UnknownHostException: http://host.docker.internal/fhir-dstu3: No address associated with hostname
                at java.base/java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
                at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929)
                at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1515)
                at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848)
                at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1505)
                at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1364)
                at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1298)
                at java.base/java.net.InetAddress.getByName(InetAddress.java:1248)
                at org.springframework.boot.convert.InetAddressFormatter.parse(InetAddressFormatter.java:41)
                ... 142 more
09-Nov-2020 16:27:43.736 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/ROOT.war] has finished in [49,881] ms
09-Nov-2020 16:27:43.741 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
09-Nov-2020 16:27:43.753 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [50129] milliseconds
@petermicuch petermicuch changed the title Setting server_address to something running behind reverse proxy seem to now work since 5.1.0 Setting server_address to something running behind reverse proxy seem to NOT work since 5.1.0 Nov 9, 2020
@petermicuch
Copy link
Contributor Author

BTW - in browser I can reach HAPI without issues, so reverse proxy is working as expected.
image

@psavva
Copy link
Contributor

psavva commented Nov 10, 2020

There has been a change in the server address.
You will notice that in the previous version it was like :
http://localhost:8080/hapi-fhir-jpa-stareter/fhir
this has now moved tot he ROOT.
ie: http://localhost:8080/fhir

I would start here :)

@petermicuch
Copy link
Contributor Author

Thanks @psavva That is what I already noticed and changed in reverse proxy and that was not it.

@jvitrifork
Copy link
Collaborator

Please provide your configuration file @petermicuch

@petermicuch
Copy link
Contributor Author

@jvitrifork what configuration do you mean? For hapi, I took whatever is in the github without modifications. Only file I modified was pom.xml to add support for MSSql.

@jvitrifork
Copy link
Collaborator

I dont think this is a HAPI issue.

Reason: failed to convert java.lang.String to java.net.InetAddress does not look like its HAPI specific to me

@petermicuch
Copy link
Contributor Author

@jvitrifork it certainly is change of behavior at least, since the same address we have used with former HAPI version, without issues. It was never complaining. Isn't there just new functionality implemented, that actually tries to access "self" link or does any kind of validation? I am able to ping domain name used for HAPI in our case and I will also try to do that from inside container once I get it out of constant failed state.

@jvitrifork
Copy link
Collaborator

well ... the error Caused by: java.net.UnknownHostException: http://host.docker.internal/fhir-dstu3: No address associated with hostname is not HAPI specific.
If you can start it in docker, that would be step one. Then afterwards assign the hostname that would be step 2 and so on.

@petermicuch
Copy link
Contributor Author

@jvitrifork all understood, I can also read the error and understand its meaning (btw it is a bit different when I run in AKS). What I am trying to point out is, that there must be new checks or something introduced in 5.1.0 as this was working fine before. So I was more expecting answer from involved developer, that "yeah we've added few tweaks in there and there". Anyhow it seems I will have to dig into the code myself to find out what exactly was changed that causes this incompatobility between 5.0.2 and 5.1.0 (no major version update included). Thank you.

@jvitrifork
Copy link
Collaborator

Well ... I more or less rewrote this project to its current version (5.1.0) and up - converting it to a more 'spring boot native' version. Whether I've introduced something or it was introduced in the core project I can't say.

@petermicuch
Copy link
Contributor Author

@jvitrifork don't get me wrong, I appreciate your attempts to help. It would be great to know if there are any tests that run on something else than localhost, because I guess there the error must have been visible as well. I will try to investigate when I free myself. Hapi is definitelly great fhir implementation.

@jamesagnew
Copy link
Contributor

FWIW this does look boot related to me.. See the context in the stack trace:

Caused by: java.lang.IllegalStateException: Unknown host http://host.docker.internal/fhir-dstu3
at org.springframework.boot.convert.InetAddressFormatter.parse(InetAddressFormatter.java:44)
at org.springframework.boot.convert.InetAddressFormatter.parse(InetAddressFormatter.java:31)

If you look at the specific boot code there *InetAddressFormatter:44) it looks like that class wants a raw host name, not a fully qualified URL. I don't know enough about boot to have any idea what would be calling that though or why.

@vladonemo
Copy link
Contributor

The server.address is a Spring Boot property that must be network address (FQDN or IP address). HAPI FHIR JPA Server Starter uses server_address (please note the _ separator) property as baseUrl. However, Spring translates the underscores in environment variables to dots, so your provided server_address is really taken as server.address as well. The functionality is there in Spring to support environments that disallow using dots in the variable names.
Now, I'm not sure how your config looks like, but looking into the AppProperties class, the server_name should be prefixed with hapi.fhir. So try providing env variable hapi_fhir_server_name instead.

@jvitrifork
Copy link
Collaborator

@vladonemo you nailed it. That totally makes sense. Why didn't I think of that. Of course, its right. Previously there was a property called server_address (in 'global' scope) and that is as you state now moved with the hapi.fhir. prefix. - and, at the same time, there is the spring variable server.address which of course now exists. Well spotted!

@jvitrifork
Copy link
Collaborator

btw @petermicuch that would have been pretty clear given the config file / environment variables

@petermicuch
Copy link
Contributor Author

@jvitrifork you wanted config file and that was as I stated same as you have it in git. Nevertheless I pulled in Vlado here today as I am not that much into Java. Even last time he was helping with PR to read ENV variables and override configuration values. Thanks to both of you, I will try it out.

@jvitrifork
Copy link
Collaborator

@petermicuch - If I'm not mistaken, there's no server.address mentioned in the default config file in github - https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml

@petermicuch
Copy link
Contributor Author

Hi @jvitrifork. That is exactly the point, I am migrating from version, where hapi.properties was existing and had server_address into application.yaml where it was moved.... somewhere. I am struggling with mapping a bit.

Let me paste here my old configuration (hapi.properties file was taken as is in git) and my new configuration. It still does not work for me and I am unsure how to actually set server_address, that was originally present in hapi.properties as well as fhir_version. Mapping to new application.yaml is somehow not straight forward, or I am maybe overlooking something obvious. I really do not know. I will need help to solve this.

5.0.2: My original environment variables from my helm chart template for DSTU3 fhir version using image with hapi-properties file are:

          env:
            - name: HAPI_DATABASE_NAME
              value: {{ .Values.dstu3DbName }}
            - name: datasource.url
              value: "jdbc:postgresql://{{ .Values.postgres.nameOverride }}:5432/$(HAPI_DATABASE_NAME)"
            - name: datasource.driver
              value: org.postgresql.Driver
            - name: hibernate.dialect
              value: org.hibernate.dialect.PostgreSQL95Dialect
            - name: server_address
              value: https://{{ .Values.global.hostDomain }}/{{ .Values.dstu3BaseUri }}
            - name: fhir_version
              value: DSTU3
            - name: enforce_referential_integrity_on_write
              value: "{{ .Values.checkReferentialIntegrityOnWrite }}"
            - name: enforce_referential_integrity_on_delete
              value: "{{ .Values.checkReferentialIntegrityOnDelete }}"
            - name: default_page_size
              value: "{{ .Values.defaultPageSize }}"
            - name: max_page_size
              value: "{{ .Values.maxPageSize }}"
            - name: datasource.username
              valueFrom:
                secretKeyRef:
                  name: {{ .Values.postgres.nameOverride }}
                  key: username
            - name: datasource.password
              valueFrom:
                secretKeyRef:
                  name: {{ .Values.postgres.nameOverride }}
                  key: password

5.2.0: My current not-working environment (not sure how to map properties):

          env:
            - name: HAPI_DATABASE_NAME
              value: {{ .Values.dstu3DbName }}
            - name: spring.datasource.url
              value: "jdbc:postgresql://{{ .Values.postgres.nameOverride }}:5432/$(HAPI_DATABASE_NAME)"
            - name: spring.datasource.driver
              value: org.postgresql.Driver
            - name: spring.jpa.properties.hibernate.dialect
              value: org.hibernate.dialect.PostgreSQL95Dialect
            - name: hapi.fhir.server_address  #NOT CORRECT, RIGHT?
              value: https://{{ .Values.global.hostDomain }}/{{ .Values.dstu3BaseUri }}
            - name: hapi.fhir.fhir_version       #NOT CORRECT, RIGHT?
              value: DSTU3
            - name: hapi.fhir.enforce_referential_integrity_on_write
              value: "{{ .Values.checkReferentialIntegrityOnWrite }}"
            - name: hapi.fhir.enforce_referential_integrity_on_delete
              value: "{{ .Values.checkReferentialIntegrityOnDelete }}"
            - name: hapi.fhir.default_page_size
              value: "{{ .Values.defaultPageSize }}"
            - name: hapi.fhir.max_page_size
              value: "{{ .Values.maxPageSize }}"
            - name: spring.datasource.username
              valueFrom:
                secretKeyRef:
                  name: {{ .Values.postgres.nameOverride }}
                  key: username
            - name: spring.datasource.password
              valueFrom:
                secretKeyRef:
                  name: {{ .Values.postgres.nameOverride }}
                  key: password

I got rid of the error with server.address being wrong. But I got another error and I do not think that the server_address puzzle is solved for me yet.
As you can see I am using Postgres as DB. Right now the error I am getting is related to hibernate.dialect, even though I am setting it according to location provided in application.yaml. At least I think that I did mapping from old hapi.properties to new application.yaml correctly.

Here is the error, sorry for long call stack, I did not want to leave anything out.

2020-11-23 15:28:22.075 [main] ERROR o.s.boot.SpringApplication [SpringApplication.java:837] Application run failed
org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hapiServletRegistration' defined in ca.uhn.fhir.jpa.starter.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory 
method 'hapiServletRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ca.uhn.fhir.jpa.starter.JpaRestfulServer': Unsatisfied dependency expressed through field 'fhirSystemDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:161)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:173)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:153)
        at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:95)
        at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5128)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1848)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
        at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hapiServletRegistration' defined in ca.uhn.fhir.jpa.starter.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory method 'hapiServletRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ca.uhn.fhir.jpa.starter.JpaRestfulServer': Unsatisfied dependency expressed through field 'fhirSystemDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' 
defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:483)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:211)
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:202)
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:96)
        at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:85)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:255)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:229)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:186)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158)
        ... 50 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory method 'hapiServletRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ca.uhn.fhir.jpa.starter.JpaRestfulServer': Unsatisfied dependency expressed through field 'fhirSystemDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650)
        ... 67 common frames omitted
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ca.uhn.fhir.jpa.starter.JpaRestfulServer': Unsatisfied dependency expressed through field 'fhirSystemDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBean(AbstractAutowireCapableBeanFactory.java:318)
        at ca.uhn.fhir.jpa.starter.Application.hapiServletRegistration(Application.java:50)
        at ca.uhn.fhir.jpa.starter.Application$$EnhancerBySpringCGLIB$$1a9393d7.CGLIB$hapiServletRegistration$1(<generated>)
        at ca.uhn.fhir.jpa.starter.Application$$EnhancerBySpringCGLIB$$1a9393d7$$FastClassBySpringCGLIB$$ebd5f4b2.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
        at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
        at ca.uhn.fhir.jpa.starter.Application$$EnhancerBySpringCGLIB$$1a9393d7.hapiServletRegistration(<generated>)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
        ... 68 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:361)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
        ... 83 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:227)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1175)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1142)
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:585)
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:548)
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:716)
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:689)
        at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:239)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
        at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:358)
        ... 94 common frames omitted
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
        at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
        at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:176)
        at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118)
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1224)
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1255)
        at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:141)
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378)
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
        ... 109 common frames omitted
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
        at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
        at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
        at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
        at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
        at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
        at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
        ... 126 common frames omitted
23-Nov-2020 15:28:22.084 SEVERE [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/usr/local/tomcat/webapps/ROOT.war]
        java.lang.IllegalStateException: Error starting child
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:706)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1848)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:118)
                at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
                at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
                at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)
                at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:309)
                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
                at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:423)
                at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
                at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:843)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:772)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:342)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)
        Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
                ... 37 more
        Caused by: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hapiServletRegistration' defined in ca.uhn.fhir.jpa.starter.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory method 'hapiServletRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ca.uhn.fhir.jpa.starter.JpaRestfulServer': Unsatisfied dependency expressed through field 'fhirSystemDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception 
is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:161)
                at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
                at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
                at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
                at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
                at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:173)
                at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:153)
                at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:95)
                at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5128)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                ... 38 more
        Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hapiServletRegistration' defined in ca.uhn.fhir.jpa.starter.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory method 'hapiServletRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ca.uhn.fhir.jpa.starter.JpaRestfulServer': Unsatisfied dependency expressed through field 'fhirSystemDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
                at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655)
                at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:483)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1336)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1176)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
                at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
                at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:211)
                at org.springframework.boot.web.servlet.ServletContextInitializerBeans.getOrderedBeansOfType(ServletContextInitializerBeans.java:202)
                at org.springframework.boot.web.servlet.ServletContextInitializerBeans.addServletContextInitializerBeans(ServletContextInitializerBeans.java:96)
                at org.springframework.boot.web.servlet.ServletContextInitializerBeans.<init>(ServletContextInitializerBeans.java:85)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.getServletContextInitializerBeans(ServletWebServerApplicationContext.java:255)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.selfInitialize(ServletWebServerApplicationContext.java:229)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:186)
                at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:158)
                ... 50 more
        Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.web.servlet.ServletRegistrationBean]: Factory method 'hapiServletRegistration' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ca.uhn.fhir.jpa.starter.JpaRestfulServer': Unsatisfied dependency expressed through field 'fhirSystemDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
                at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650)
                ... 67 more
        Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ca.uhn.fhir.jpa.starter.JpaRestfulServer': Unsatisfied dependency expressed through field 'fhirSystemDao'; nested exception 
is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
                at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBean(AbstractAutowireCapableBeanFactory.java:318)
                at ca.uhn.fhir.jpa.starter.Application.hapiServletRegistration(Application.java:50)
                at ca.uhn.fhir.jpa.starter.Application$$EnhancerBySpringCGLIB$$1a9393d7.CGLIB$hapiServletRegistration$1(<generated>)
                at ca.uhn.fhir.jpa.starter.Application$$EnhancerBySpringCGLIB$$1a9393d7$$FastClassBySpringCGLIB$$ebd5f4b2.invoke(<generated>)
                at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
                at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
                at ca.uhn.fhir.jpa.starter.Application$$EnhancerBySpringCGLIB$$1a9393d7.hapiServletRegistration(<generated>)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:566)
                at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
                ... 68 more
        Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySystemDaoR4': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: 
Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
                at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:361)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
                at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
                at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227)
                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
                ... 83 more
        Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [ca/uhn/fhir/jpa/starter/FhirServerConfigR4.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
                at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
                at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
                at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
                at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:227)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1175)
                at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1142)
                at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:585)
                at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:548)
                at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:716)
                at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:689)
                at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:239)
                at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
                at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessProperties(PersistenceAnnotationBeanPostProcessor.java:358)
                ... 94 more
        Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275)
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
                at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
                at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:176)
                at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118)
                at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1224)
                at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1255)
                at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:141)
                at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
                at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391)
                at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378)
                at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
                ... 109 more
        Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
                at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
                at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
                at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
                at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
                at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
                at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
                ... 126 more

Please also note that some time ago, there was PR to make loading from environment variables easy due to usage of K8S/docker and also issue that I think finally got solved by that in acceptable way. But right now mapping of the old to new environment is an issue.

@petermicuch
Copy link
Contributor Author

@jvitrifork my bad. I now found that I need to define for postgres something in addition which was not there before:

            - name: spring.datasource.driverClassName
              value: org.postgresql.Driver

So postgres is now working for me. I am trying out the server_address and fhir_version that is actually inside hapi.fhir section as seen in AppProperties.java and as @vladonemo posted. Will post results and close this issue if all works fine.

@jamesagnew
Copy link
Contributor

If that turns out to work, PR to include that information in the README would be greatly appreciated :)

@petermicuch
Copy link
Contributor Author

Hi @jvitrifork , @jamesagnew, so setting hapi.fhir.server_address now works. I can see this correctly reflected. However setting hapi.fhir.fhir_version does not work. Even when I set DSTU3, I can still see it runs R4 server:
image

It only shows correctly after I set spring.profiles.active to dstu3 as well:
image

This is really a bit confusing and I am not sure about consequences. What would happen if I ran server with hapi.fhir.fhir_version set to DSTU3 and spring.profiles.active set to r4 and later after there is some data already imported spring.profiles.active would be changed to dstu3?

Here is my current important part of settings that work fine for reference (just in case someone hits the same problem):

            - name: hapi.fhir.server_address
              value: https://{{ .Values.global.hostDomain }}{{ .Values.dstu3BaseUri }}
            - name: hapi.fhir.fhir_version
              value: DSTU3
            - name: spring.profiles.active
              value: dstu3

Since the original problem I opened this issue for seems to be not present, I will only create PR as requested by @jamesagnew to improve documentation and then close this issue. However I am not sure how to improve documentation of the "version" problem, since there I need more info.

@jvitrifork
Copy link
Collaborator

  1. There has not been created documentation going from the previous format to the new yaml based format. It now seems evident to me that it would be nice to have such documentation. It was not a priority for me as my thought was that this project mostly (at least to me) is a component that works as a substitute for real systems and a quick prototype thingy as well as an example implementation.
  2. hapi.fhir.fhir_version looks like it is a remnant from the old setup. It is a variable that is not read at any point in time. As such, it has no effect assigning it a value. This is confusing and it should be removed
  3. The FHIR version is assigned only by using the spring.profiles.active

@psavva
Copy link
Contributor

psavva commented Nov 23, 2020 via email

@jvitrifork
Copy link
Collaborator

I don't have strong feelings on this one - hapi.fhir.fhir_version can easily be reintroduced and used with some @Conditional Spring evaluation. Programmatically its the same. Its only a matter of syntax in the config file. If there's a strong feeling about NOT having it as part of the spring.profiles.active I suggest we move it to hapi.fhir.fhir_version.

@petermicuch
Copy link
Contributor Author

@jvitrifork I have to agree with @psavva that cleanup is required and perhaps also a bit of consistency should be kept, not moving things around if not logically required. But you might have your reasons why this was moved, and that is fine, as long as there is easy migration path or perhaps message warning users that property is replaced by new one and will not be available in next version.

There is one more confusion with regards to Postgres usage and hibernate.dialect. Previously this was the only thing needed to tell hapi what driver to use. Today, without specifying spring.datasource.driverClassName you will get exception that Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set, even though you actually provide spring.jpa.properties.hibernate.dialect. Now I wonder which one is needed and will only find out by experimenting. So I guess there are places in the documentation worth to revisit.

As to the note about substitute for real systems: To be honest, this is one of best fhir implementations, if not the best one if you want to experiment with FHIR. I am seriously thinking to contribute more, but I am not Java person really. So maybe more in the area of ease of deployment (i.e. helm charts).

I appreciate effort you are putting into this. Also discussed with @vladonemo few months back, why there is no spring used yet and after some time, here you've done that :-).

@psavva
Copy link
Contributor

psavva commented Nov 23, 2020 via email

@jvitrifork
Copy link
Collaborator

That is news to me that the spring.jpa.properties.hibernate.dialect is now needed. @jamesagnew this was previously automatically calculated, but with your changes to 5.2.0 this is no longer the case. Was that intentional?

@jamesagnew
Copy link
Contributor

Yes - The new SearchBuilder module no longer uses Hibernate, but instead generates search SQL expressions "by hand". As a result it needs to know which flavour of SQL to generate (more or less entirely because of the fact that Oracle doesn't have a boolean datatype... grrrr/wtf). We use the hibernate dialect property to figure that out.

This is the class I added to handle that:

8850e64#diff-cb79a8377bcfe7818c44d17e1f6fa8b24b945f910d30e4c4e32cc6e0af27d9d3

@jvitrifork
Copy link
Collaborator

I would like to change that class to ie. the following:


public class JpaHibernateDialectProvider extends HibernateDialectProvider {

  private final Dialect dialect;

  public JpaHibernateDialectProvider(LocalContainerEntityManagerFactoryBean myEntityManagerFactory) {
    DataSource connection = myEntityManagerFactory.getDataSource();
    try {
      dialect = new StandardDialectResolver()
        .resolveDialect(new DatabaseMetaDataDialectResolutionInfoAdapter(connection.getConnection().getMetaData()));
    } catch (SQLException sqlException) {
      throw new ConfigurationException(sqlException.getMessage(), sqlException);
    }
  }

  @Override
  public Dialect getDialect() {
    return dialect;
  }
}

  • with that implementation, the dialect is automatically deducted from the metadata of the database, which means that the user does not have to specify the dialect once again

@jvitrifork jvitrifork mentioned this issue Nov 23, 2020
@jkiddo
Copy link
Collaborator

jkiddo commented Nov 24, 2020

@jamesagnew here you go. I'll proceed updating the documentation (at least the current doc so that it is on par with fhir_version use instead of the spring profile) if you'll have a look at the PR.

@petermicuch
Copy link
Contributor Author

@jvitrifork I am not sure now, shall I keep

            - name: spring.jpa.properties.hibernate.dialect
              value: org.hibernate.dialect.PostgreSQL95Dialect

or is this not needed with latest commit anymore?

@petermicuch
Copy link
Contributor Author

@jvitrifork I have tested with latest changes locally, but it seems hapi.fhir.fhir_version is ignored although I do not see an issue in your code changes.

Environment of container:

root@hapi-server-dstu3-59d984db98-w6hrr:/usr/local/tomcat# env
hapi.fhir.enforce_referential_integrity_on_delete=true
hapi.fhir.max_page_size=100
spring.datasource.driverClassName=org.postgresql.Driver
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect
spring.datasource.url=jdbc:postgresql://hapi-postgres:5432/vtchapidstu3
hapi.fhir.fhir_version=DSTU3
hapi.fhir.server_address=https://host.docker.internal/fhir-dstu3/fhir
hapi.fhir.default_page_size=100
hapi.fhir.enforce_referential_integrity_on_write=true

Output in logs:

2020-11-25 17:24:00.117 [main] INFO  ca.uhn.fhir.jpa.starter.Application [StartupInfoLogger.java:55] Starting Application on hapi-server-dstu3-59d984db98-w6hrr with PID 1 (/usr/local/tomcat/webapps/ROOT/WEB-INF/classes started 
by root in /usr/local/tomcat)
2020-11-25 17:24:00.126 [main] INFO  ca.uhn.fhir.jpa.starter.Application [SpringApplication.java:651] No active profile set, falling back to default profiles: default
2020-11-25 17:24:03.518 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate [RepositoryConfigurationDelegate.java:126] Bootstrapping Spring Data repositories in DEFAULT mode.
2020-11-25 17:24:04.132 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate [RepositoryConfigurationDelegate.java:182] Finished Spring Data repository scanning in 603ms. Found 46 repository interfaces.
2020-11-25 17:24:06.329 [main] INFO  ca.uhn.fhir.util.VersionUtil [VersionUtil.java:72] HAPI FHIR version 5.2.0 - Rev 50b927b7d2
2020-11-25 17:24:06.335 [main] INFO  ca.uhn.fhir.context.FhirContext [FhirContext.java:197] Creating new FHIR context for FHIR version [R4]
2020-11-25 17:24:07.039 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [PostProcessorRegistrationDelegate.java:335] Bean 'fhirContextR4' of type [ca.uhn.fhir.context.FhirContext] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-11-25 17:24:07.041 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [PostProcessorRegistrationDelegate.java:335] Bean 'myDaoRegistry' of type [ca.uhn.fhir.jpa.api.dao.DaoRegistry] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-11-25 17:24:07.046 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [PostProcessorRegistrationDelegate.java:335] Bean 'org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-11-25 17:24:07.146 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [PostProcessorRegistrationDelegate.java:335] Bean 'spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties' of type [org.springframework.boot.autoconfigure.jdbc.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-11-25 17:24:07.323 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [PostProcessorRegistrationDelegate.java:335] Bean 'dataSource' of type [com.zaxxer.hikari.HikariDataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-11-25 17:24:07.440 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [PostProcessorRegistrationDelegate.java:335] Bean 'appProperties' of type [ca.uhn.fhir.jpa.starter.AppProperties$$EnhancerBySpringCGLIB$$da6b981f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-11-25 17:24:07.446 [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker [PostProcessorRegistrationDelegate.java:335] Bean 'fhirServerConfigR4' of type [ca.uhn.fhir.jpa.starter.FhirServerConfigR4$$EnhancerBySpringCGLIB$$c997dce1] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-11-25 17:24:07.653 [main] INFO  o.s.b.w.s.c.ServletWebServerApplicationContext [ServletWebServerApplicationContext.java:285] Root WebApplicationContext: initialization completed in 7500 ms

I hope I did everything correctly. I pulled latest changes, I build docker image without using cache and I see all new ENV variables that I have added to be sure I am picking correct docker image.

@jvitrifork
Copy link
Collaborator

docker run -p 8080:8080 -e HAPI_FHIR_FHIR_VERSION=DSTU3 yourFancyImageNameworks. Its related too this: docker-library/tomcat#77 - its something with caps and dots '.' that gets converted to '_' or reversee

@petermicuch
Copy link
Contributor Author

Silly me. You are right @jvitrifork even @vladonemo was mentioning that. I thought it will work fine, since it worked yesterday before latest commit. Thanks.

@jkiddo
Copy link
Collaborator

jkiddo commented Nov 25, 2020

Feel free to close this issue @petermicuch

@petermicuch
Copy link
Contributor Author

@jkiddo , sure I am closing, original problem is I think solved.

BTW: It is very cumbersome to set properties as they are defined now in application.yaml via environement variables. Especially things like hapi.fhir.tester. Customization of those after docker image is build is difficult and I was not able to set it once correctly.

@jvitrifork
Copy link
Collaborator

@petermicuch I had a look at it and I've made #177 - which names indices instead of having them unnamed. That enables what you wish for: Being able to eg. do docker run -p 8080:8080 -e HAPI_FHIR_FHIR_VERSION=DSTU3 -e HAPI_FHIR_TESTER_MEDCOM_NAME=Medcom -e HAPI_FHIR_TESTER_MEDCOM_SERVER_ADDRESS="http://fhir.medcom.dk:8080/fhir" -e HAPI_FHIR_TESTER_MEDCOM_FHIR_VERSION=R4 yourFancyImageName

@jamesagnew take a look at what you think. I've also changed some defaults in the config file.

@petermicuch
Copy link
Contributor Author

@jvitrifork let me create another issue where we can discuss that. I was planning to do that today. I have more points to relaxed binding and naming of the variables. I think for arrays read from environment variables, we should use different approach that what we do have currently. I will also provide specific test scenario. But basically named is better then using 0 etc.
https://github.com/spring-projects/spring-boot/wiki/Relaxed-Binding-2.0
https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config-relaxed-binding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants