FHIR2 throwing bean exception error

Hi, I’m getting bean exception error while using fhir2 with Platform 2.2.0.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘fhirConditionServiceImpl_2_2’

@dkayiwa

can you put the full logs on paste bin and drop link here

1 Like

Did you remove / disable the old FHIR module?

1 Like

Yes I removed the old fhir module and added fhir2

Do you have any other modules that use the HAPI FHIR library loaded?

Yes, in one of my modules it is used as follows-

<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<version>${hapiFhirBaseVersion}</version>

<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>${hapiFhirStructuresDstuVersion}</version>

<hapiFhirBaseVersion>5.1.0</hapiFhirBaseVersion>
<hapiFhirStructuresDstuVersion>5.1.0</hapiFhirStructuresDstuVersion>

Are you able to change the code for that module? The easiest thing would be to mark the HAPI dependencies as “provided” in the POM and in your config.xml add:

<require_modules>
    <require_module>org.openmrs.module.fhir2</require_module>
</require_modules>

The slightly more complicated arrangement would be in your config.xml add:

<aware_of_modules>
    <aware_of_module>org.openmrs.module.fhir2</aware_of_module>
</aware_of_modules>

And then add a conditional_resources directive something like (this is probably not a complete list of exclusions necessary):

<conditionalResources>
    <conditionalResource>
        <path>/lib/hapi-.*\.jar</path>
        <loadIfModulesPresent>
            <openmrsModule>
                <moduleId>fhir2</moduleId>
                <version>!</version>
            </openmrsModule>
        </loadIfModulesPresent>
    </conditionalResource>
        <conditionalResource>
        <path>/lib/org\.hl7\.fhir\..*\.jar</path>
        <loadIfModulesPresent>
            <openmrsModule>
                <moduleId>fhir2</moduleId>
                <version>!</version>
            </openmrsModule>
        </loadIfModulesPresent>
    </conditionalResource>
</conditionalResources>

I marked the HAPI dependencies as “provided” in the POM and OpenMRS started successfully but I’m getting an error stating that - " If you are seeing this page, it means that the OpenMRS Platform is running successfully, but no user interface module is installed. Learn about the available User Interface Modules

If you are a developer, you can access the REST API. (See REST documentation for clients)"

I changes the legacyUI module with the latest one and also the openmrs.war file but still this error is not resolved.

Can you share your server side log via pastebin.com?

1 Like

Hi @dkayiwa , @ibacher ,

I reverted the changes I did but I’m still getting the same issue.

Server Logs - openmrs no UI installed error - Pastebin.com

Is this a new install or are you using an existing database from an earlier version? You probably need to recreate your database for the version of OpenMRS you are using.

I reinstalled apache tomcat and it solved the issue. But when I’m adding the scope as provided for the fhir dependency, this issue is arising again.

Which issue are you referring to? And are you able to share your server log via pastebin.com?

Hi @ibacher , @dkayiwa , I’m explaining the whole issue again. I’m using OpenMRS 2.2.0 with FHIR module and everything working fine. However, When I’m replacing the FHIR module with FHIR2 module, I’m getting the beanException error ( FHIR2 error - Pastebin.com ). I’m using the dependency of FHIR in one of my modules as follows -

<groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>hapi-fhir-base</artifactId>
    <version>${hapiFhirBaseVersion}</version>

    <groupId>ca.uhn.hapi.fhir</groupId>
    <artifactId>hapi-fhir-structures-r4</artifactId>
    <version>${hapiFhirStructuresDstuVersion}</version>

    <hapiFhirBaseVersion>5.1.0</hapiFhirBaseVersion>
    <hapiFhirStructuresDstuVersion>5.1.0</hapiFhirStructuresDstuVersion>

When I added the scope as “provided” for these dependencies, I’m getting a page saying that " If you are seeing this page, it means that the OpenMRS Platform is running successfully, but no user interface module is installed. Learn about the available User Interface Modules

If you are a developer, you can access the REST API. (See REST documentation for clients)" The server logs are here for this error - openmrs no UI installed error - Pastebin.com

I’ve added the required dependencies in my module but still I’m getting this different bean error.