Tomcat Version with deprecation of Tomcat7

Tomcat7 reached end of life March 31 and is no longer hosted by Apache. At Partners in Health, Rwanda, we are upgrading our system and trying to avoid the end of life Tomcat, but have had some issues attempting to use more recent versions of Tomcat (Unable to find taglib "c" for URI: /WEB-INF/view/module/legacyui/taglibs/c-rt.tld - #6 by benb123 and https://issues.openmrs.org/browse/LUI-169).

It seems that Tomcat7 is still the ‘official’ OpenMRS Tomcat version (Step 3 - Install Tomcat - Documentation - OpenMRS Wiki).

What version of Tomcat (or other server) are others using? It seems that most are still on Tomcat7, though I’ve seen a couple references to using Tomcat8. Should we as a community move to a supported version?

1 Like

@tanderson I have once in a while got the above reported error, but on tomcat 7. It started showing up when we moved the user interface out of the platform into the legacyui module.

That being said, there is nothing that am aware of, which should prevent OpenMRS from running on tomcat 8 and 9. I have seen different people (on talk) successfully running OpenMRS on tomcat 8 and 9.

Thanks @dkayiwa, I think we are pretty committed to using the legacyui for at least some content for a while so this remains an open question on our side. We use legacyui both for a base patient dashboard and many of the Rwanda specific functions like billing and pharmacy were designed in 1.9 and adapted for legacyui.

Is it something that you can consistently reproduce? Am asking because it would greatly help for debugging purposes.

We successfully deployed KenyaEMR (running on platform 2.3.3 and 2.4) on tomcat 8 and 9 in over 100 instances

So I’ve managed to reproduce this issue with both Docker and Cargo.

@dkayiwa With this configuration for Cargo (the version in openmrs-core):

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven3-plugin</artifactId>
    <version>1.9.7</version>
    <configuration>
        <container>
            <containerId>tomcat8x</containerId>
            <type>embedded</type>
        </container>
        <deployables>
            <deployable>
                <type>war</type>
                <location>${project.build.directory}/${project.build.finalName}.war</location>
                <properties>
                    <context>/${webapp.name}</context>
                </properties>
            </deployable>
        </deployables>
    </configuration>
</plugin>

It seems as though all the taglibs, etc. were getting expanded into the target/openmrs directory and then made their way into the WAR file.

When I simplified it to:

<plugin>
    <groupId>org.codehaus.cargo</groupId>
    <artifactId>cargo-maven3-plugin</artifactId>
    <version>1.9.7</version>
    <configuration>
        <container>
            <containerId>tomcat8x</containerId>
            <type>embedded</type>
        </container>
    </configuration>
</plugin>

It still seems to launch the WAR file, but without all the extra files. I suspect the expanded files in the WAR was why this issue didn’t come up with Cargo before.

@ibacher are you able to reproduce it with these reference application modules loaded? https://ci.openmrs.org/build/result/artifactUrlRedirect.action?planKey=REFAPP-OMODDISTRO&buildNumber=11704&artifactName=referenceapplication-addons-snapshot

@dkayiwa Yes, it fails with the RefApp too.

@ibacher it so intriguing that i have not succeeded in reproducing it even with your simplified version. Am just running mvn cargo:run from command line.

@dkayiwa Not to ask a really stupid question, but did you run something like mvn clean package or mvn clean install before trying the simplified cargo setup?

@ibacher i did a sanity check with mvn clean install on the parent folder. Then cd into webapp and run cargo. Still no reproduction.

Well, it wouldn’t be a real bug if it wasn’t hard to reproduce, I guess :grinning:.

I have been running OpenMRS enterprise version with tomcat 9 with no more issues, there were connectivity errors at the beginning but it has been resolved as of now. I did the mvn clean install, and ran it through the webapp directory.

1 Like

Thanks for the feedback

@dkayiwa where excatly is this config snippet supposed to run ?

mvn cargo:run from you webapp folder. Just like you used to do mvn jetty:run

1 Like

Thanks .One thing i was checking was wether i could provide params for a specific tomcat version .

You could pass -Dcargo.maven.containerId=??? or just change this openmrs-core/pom.xml at 2.5.0-beta · openmrs/openmrs-core · GitHub

1 Like