Error while building

I’m trying to use Condition class in (coreapps) . The build fails with the error: cannot find symbol Condition. Though I have given import org.openmrs.Condition I’m encountering the following error during build :

Any help is appreciated. Thank you :slight_smile:

that error is usually thrown when the compiler can not find the variable or object used.

and am seeing this
org.openmrs.module.emrapi.conditionslist.contract does not exist

can you paste one class here where you have used the Condition class??

Does this mean that I will also have to import org.openmrs.module.emrapi.conditionslist.contract.Condition as well? Here is the class where I’m trying to use Condition:

have you made any change in the EditConditionPageController class ?? i cant see the error lines the compiler was complaining about.

can you paste it as it was at the time of compliling ??

on line 42 ,
@RequestParam("condition") Condition condition,

are you sure we have a converter for the condition class ??

or have you personally written a converter for the condition ??

Here is the class: and here is the error:

I didn’t understand what you meant by converter?

example is when you do @RequestParam("patientId") Patient patient,

The patient converter converts a patient id to a patient object of the same id.

Am not sure we have a converter for a condition object also
as you did here
@RequestParam("condition") Condition condition,

youll have to register/create it your self

here is a list of converters


Thank you @mozzy . I will try this out and report to you :slight_smile:

1 Like

can you first try rebuilding without this line

@RequestParam("condition") Condition condition,

, and we see whether it will complain of the import ??

I’m getting this error even on keeping just imports.

What version of reff app are you running ??

specifically which version of the core are you running ??

are running a core version less than 2.2 in you installation ??

I’m running openMRSVersion 1.12.0

Now the error comes up at run time and at compile time it seems fine. could you try running core version 2.2. the condition class was introduced from core 2.2…

I’m getting this error : , on upgrading version of OpenMRS in pom.xml to 2.2.0

sorry , it actually occurs at compile time , not run time.

Are you sure when you make that import ,eclipse doesnt detect any error ??

Yes, It isn’t showing any error there. :confused:

a quick question , in the previous work in the your GSOC project, didnt you work with a Condition class at all? probably in the API not necessarily in the controller??