hapifhir / hapi-fhir

🔥 HAPI FHIR - Java API for HL7 FHIR Clients and Servers
http://hapifhir.io
Apache License 2.0
1.99k stars 1.31k forks source link

hapi-fhir-cli v6.2.4 can't execute 'run-server' command #4454

Open rdanilin opened 1 year ago

rdanilin commented 1 year ago

When I'm trying to run server command, it's failing with (see full output in the hapi.log):

>  hapi-fhir-cli run-server -v r4                                                                                                                                                                                                       
------------------------------------------------------------
🔥  HAPI FHIR 6.2.4 - Command Line Tool
------------------------------------------------------------
Process ID                      : 29867
Max configured JVM memory (Xmx) : 4.0GB
Detected Java version           : 19.0.1
------------------------------------------------------------
2023-01-20 10:30:30.121 [main] INFO  c.u.f.c.LogbackUtil Logging configuration set from file /logback-cli-on.xml
2023-01-20 10:30:30.134 [main] INFO  c.u.f.c.RunServerCommand Preparing HAPI FHIR JPA server on port 8080
2023-01-20 10:30:30.414 [main] INFO  c.u.f.c.RunServerCommand Starting HAPI FHIR JPA server in R4 mode
2023-01-20 10:30:45.276 [main] WARN  o.s.w.c.s.AnnotationConfigWebApplicationContext Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myResourceDaosR4' defined in ca.uhn.fhir.jpa.config.GeneratedDaoAndResourceProviderConfigR4: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Factory method 'resourceDaosR4' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myAccountDaoR4': Unsatisfied dependency expressed through field 'myTerminologySvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'terminologyService': Unsatisfied dependency expressed through field 'myDeferredStorageSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'termDeferredStorageSvc': Unsatisfied dependency expressed through field 'myJobCoordinator'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying b
ean of type 'ca.uhn.fhir.batch2.api.IJobCoordinator' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2023-01-20 10:30:45.291 [main] ERROR o.s.w.c.ContextLoader Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myResourceDaosR4' defined in ca.uhn.fhir.jpa.config.GeneratedDaoAndResourceProviderConfigR4: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Factory method 'resourceDaosR4' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'myAccountDaoR4': Unsatisfied dependency expressed through field 'myTerminologySvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'terminologyService': Unsatisfied dependency expressed through field 'myDeferredStorageSvc'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'termDeferredStorageSvc': Unsatisfied dependency expressed through field 'myJobCoordinator'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'ca.uhn.fhir.batch2.api.IJobCoordinator' available: expected at least 1 bean whic
h qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
    ... 91 common frames omitted
2023-01-20 10:30:45.307 [main] INFO  c.u.f.c.RunServerCommand Server started on port 8080
2023-01-20 10:30:45.307 [main] INFO  c.u.f.c.RunServerCommand Web Testing UI : http://localhost:8080/
2023-01-20 10:30:45.307 [main] INFO  c.u.f.c.RunServerCommand Server Base URL: http://localhost:8080/baseR4/
^C2023-01-20 10:31:59.79 [Thread-0] INFO  ca.uhn.fhir.cli.App HAPI FHIR is shutting down...

Could you please suggest how this can be fixed?

vadi2 commented 10 months ago

6.8.5 seems to have removed run-server entirely:

% hapi-fhir-cli run-server -v r4          
Unrecognized command: run-server

------------------------------------------------------------
🔥  HAPI FHIR 6.8.5 - Command Line Tool
------------------------------------------------------------