Getting error with webservices-rest module while upgrading openmrs to 2.5.10.

Hi @dkayiwa ,

I’m trying to upgrade my openmrs from 2.1.1 to 2.5.10 and I’ve multiple modules running inside openmrs including webservices, legacyui and fhir2. The openmrs services are running fine with App Framework Module 2.17.0, Rest Web Services OMOD 2.29.0.b675eb, Legacy UI Module 1.14.0, FHIR2 1.2.2 But when I’m trying to add my customized module (which was working fine with openmrs 2.1.1 and webservices 2.26.0), I’m getting this error.

Does your module’s config.xml have a require module element for the webservicesrest module? Is the module on github?

Yes my module has require module element for webservices rest module as follows - <require_module>org.openmrs.module.webservices.rest</require_module>

Also, as this is a maven project, I’ve dependencies in my pom.xml too - Project pom.xml -

            <dependency>
                <groupId>org.openmrs.module</groupId>
                <artifactId>webservices.rest-api</artifactId>
                <version>1.1</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.openmrs.module</groupId>
                <artifactId>webservices.rest-omod</artifactId>
                <version>1.1</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.openmrs.module</groupId>
                <artifactId>webservices.rest-omod</artifactId>
                <version>1.1</version>
                <classifier>tests</classifier>
                <scope>test</scope>
            </dependency>
            <!--webservices.rest 1.9 ext module-->            
            <dependency>
                <groupId>org.openmrs.module</groupId>
                <artifactId>webservices.rest19ext-api</artifactId>
                <version>1.0-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>org.openmrs.module</groupId>
                <artifactId>webservices.rest19ext-omod</artifactId>
                <version>1.0-SNAPSHOT</version>
            </dependency>

omod & api pom.xml -

        <dependency>
            <groupId>org.openmrs.module</groupId>
            <artifactId>webservices.rest-omod</artifactId>
            <version>2.15</version>
        </dependency>
        <dependency>
            <groupId>org.openmrs.module</groupId>
            <artifactId>webservices.rest-omod</artifactId>
            <classifier>tests</classifier>
        </dependency>

Are you referencing SessionController1_8 anywhere in your module?

Yes it is directly imported in one of my controller. Should I replace it with anything ?

import org.openmrs.module.webservices.rest.web.v1_0.controller.openmrs1_8.SessionController1_8;

That class was removed. Did you want to instead use SessionController1_9?

How can I import this in my controller? The import import org.openmrs.module.webservices.rest.web.v1_0.controller.openmrs1_9.SessionController1_9; is giving me “Not Found” error.

In your pom.xml file, include the webservices.rest-omod-1.9 dependency.

Added

<dependency>
            <groupId>org.openmrs.module</groupId>
            <artifactId>webservices.rest-omod-1.9</artifactId>
            <version>2.17</version>
        </dependency>

But still getting same error.

It will get simpler if you just put your module on github.

That won’t be possible for me due to privacy. However, I can provide you the structure of project and the 3 pom.xml files used in my project. GitHub - chughrahul/projectStructure Will that be sufficient to provide a solution?

Hi @dkayiwa ,

Is there any solution for this ?

Change the version of the module to 2.39.0

Getting this error while upgrading webservices module version in pom.xml -

Could not find artifact org.openmrs.module:webservices.rest-omod:jar:2.39 in openmrs-repo (https://mavenrepo.openmrs.org/nexus/content/repositories/public)

Did you forget the 0 at the end?

My bad. I think that should solve the problem as the project built successfully with that. Thanks. I’ll get back if I find something else.

Hi @dkayiwa ,

We’ve a session call to get the current openmrs session for the user like this -

public Object createNewSession(WebRequest request) throws ResponseException {
		
	return sessionController.get();
}

But now it is giving error after using openmrs1_9.SessionController1_9 instead of openmrs1_8.SessionController1_8. Error is - <!doctype html><html lang="en"><head><title>HTTP Status 500 – Internal Server Er - Pastebin.com

Previously when we were using openmrs1_8.SessionController1_8, our session code was working fine -

public Object createNewSession(WebRequest request) throws ResponseException {
		
	return sessionController.get(request);
}

But now the request parameter is removed and it is giving error.