Problem with the RequestMapping of the Controller when deploying my own module

Hello, I have created my own module for OpenMRS based on OpenMRS SDK - Documentation - OpenMRS Wiki. OpenMRS version is 2.3.0. Java version and Tomcat version are also correct. First, the legacy UI was working fine but after deploying my module the UI is failing.

Maybe there is a problem with the RequestMapping of the Controller. But I am not sure because no error is given by OpenMRS. Or maybe its because of my config.xml, the code is given below.

Nevertheless, always a HTTPS Status 404 - Not Found error occurs when running the system.

The code for the request mapping is the following:

@Controller(“deviceconnector.DeviceconnectorController”) @RequestMapping(value = “module/deviceconnector/deviceconnector.form”) public class DeviceconnectorController {

/** Logger for this class and subclasses */ protected final Log log = LogFactory.getLog(getClass());

@Autowired UserService userService;

/** Success form view name */ private final String VIEW = “/module/${rootArtifactid}/${rootArtifactid}”;

/**

  • Initially called after the getUsers method to get the landing form name

  • @return String form view name*/

@RequestMapping(value = “/”, method = RequestMethod.GET) public String onGet() { //log.debug(“Test controller”); return VIEW; }

Here is my config.xml:

Sorry for bad quality, but “new users cannot upload attachments”.

The problem is in your configurations in moduleApplicationContext.xml file, it shows either you didn’t define your bean class package path to the exact controller class. Thats why deviceConnector.List Url path was not reached by the ui controller file check how we define our path in any module

Thanks for your answer. But how do I know what to write in my bean class? When I look into the other module beans then there is “a lot of” code. So what I am supposed to write when beginning from scratch? I am not quiet sure what code is mandatory that it works and what is not…

Could the documentation about moduleApplicationContext.xml (Module Creator's Cheat Sheet - Documentation - OpenMRS Wiki) be outdated? Cause it doesn’t work either…

And my service creation looks like this: grafik

Is something missing?

Cant exactly tell what you are trying to accomplish because this is basing on code. is this something on GitHub that you can share and i give you a draft about how it can be done

So this is my RequestMapping for my Get Method.

@RequestMapping(value = “module/deviceconnector/deviceconnector.list”) public class DeviceconnectorController {

protected final Log log = LogFactory.getLog(getClass());

@Autowired UserService userService;

private final String VIEW = “/module/${rootArtifactid}/${rootArtifactid}”;

@RequestMapping(value = “/”, method = RequestMethod.GET) public String onGet() { //log.debug(“Test controller”); return VIEW; }

Can you please first take a look at this /chapter: Creating-Your-First-Module / OpenMRS Developers Guide. make sure you follow the convention of how they created each step of the workflow, it will give you a basic overview of how you can spear head your module. thanks

could you make a pull request that reflects your code and drop it here

@sharif, @herbert24
Here is the github link to the projekt : GitHub - MaxOS825/openmrs-module-deviceconnector: OpenMRS Module for adding medical devices

And thanks for your help!