UI Framework error: viewProvider doesn't have a view

Platform Version: 1.11.2 OpenMRS Version: 2.2

Hello expert, I am developing a module and I am struggling to get past this weird UI framework error. viewProvider does not have a view named <my.gsp page file>

The .gsp page is present in the Webapp/pages folder. There is another .gsp page in the same folder which is showing just fine.

The corresponding controller is working fine too as I put some log messages and they are showing up in the tomcat log file.

I am not sure whats causing this error. Any one please help me. I must say debugging .gsp and UI framework errors are really time consuming.

The trace is below.

org.openmrs.ui.framework.UiFrameworkException: viewProvider cardiovascularprofile does not have a view named modifyCVprofile
	at org.openmrs.ui.framework.page.PageFactory.getView(PageFactory.java:292)
	at org.openmrs.ui.framework.page.PageFactory.processThisFragment(PageFactory.java:181)
	at org.openmrs.ui.framework.page.PageFactory.process(PageFactory.java:114)
	at org.openmrs.ui.framework.page.PageFactory.handle(PageFactory.java:84)
	at org.openmrs.module.uiframework.PageController.handlePath(PageController.java:110)
	at org.openmrs.module.uiframework.PageController.handleUrlWithDotPage(PageController.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:61)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:72)
	at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:54)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:109)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:230)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:745)
Full Error
org.openmrs.ui.framework.UiFrameworkException: viewProvider cardiovascularprofile does not have a view named modifyCVprofile
	at org.openmrs.ui.framework.page.PageFactory.getView(PageFactory.java:292)
	at org.openmrs.ui.framework.page.PageFactory.processThisFragment(PageFactory.java:181)
	at org.openmrs.ui.framework.page.PageFactory.process(PageFactory.java:114)
	at org.openmrs.ui.framework.page.PageFactory.handle(PageFactory.java:84)
	at org.openmrs.module.uiframework.PageController.handlePath(PageController.java:110)
	at org.openmrs.module.uiframework.PageController.handleUrlWithDotPage(PageController.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:844)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:61)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:72)
	at org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:54)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:109)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:230)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:105)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:620)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:745)

A bug has been filed to fix the webapp/pages folder parsing code to get the view.

We have a similar issue with the Cashier and Inventory modules, but only intermittently. Simply restarting the web app (in tomcat) “fixes” the issue which makes me think that there is some timing issue in how the UI Framework loads view providers. We haven’t had the time to follow up on the root cause but I’ll look at it more closely the next time it happens.

Thanks! Can you add the JIRA issue number for the bug here? That way if other people find a similar problem they’ll know where to look for more information. :+1:

Here is the Bug Number:

Thanks

1 Like

Hello, How did you fix it? I have the same error “org.openmrs.ui.framework.UiFrameworkException: viewProvider jasperreport does not have a view named helloWorld”. I’m trying to use uiframework in jasperreports module on bahmni virtual box v0.88 (openmrs version 2.0.4). I followed instructions https://wiki.openmrs.org/display/docs/Using+the+UI+Framework+in+Your+Module and https://wiki.openmrs.org/display/docs/UI+Framework+Step+By+Step+Tutorial

@msaule Check the following:

  1. Your module called jasperreport is started

  2. There is the page helloWorld.gsp (check the capitalization) is placed in the folder omod/src/main/webapp/pages/ folder

Hello,

  1. Yes, it’s started
  2. Yes, i have helloWorld.gsp file in my folder omod/src/main/webapp/pages/

@msaule

  1. Do you have this UI Framework configuration in your webModuleApplicationContext.xml

    <bean class="org.openmrs.ui.framework.StandardModuleUiConfiguration"> <property name="moduleId" value="${project.parent.artifactId}" /> </bean>

  2. Check if you have the ui framework as a required module in your config.xml , and also as a dependency in your omod/pom.xml

<require_module> org.openmrs.module.uiframework </require_module>

I have this configuration, but it is not working for me:

  1. in \bahmni\openmrs-module-jasperreports\pom.xml
  <dependency>
        <groupId>org.openmrs.module</groupId>
        <artifactId>uiframework-api</artifactId>
        <version>3.8</version>
        <type>jar</type>
        <scope>provided</scope>
    </dependency>
  1. in \bahmni\openmrs-module-jasperreports\omod\pom.xml

    <dependency>
        <groupId>org.openmrs.module</groupId>
        <artifactId>uiframework-api</artifactId>
     </dependency>
    
  2. in webModuleApplicationContext.xml <bean class="org.openmrs.ui.framework.StandardModuleUiConfiguration"> <property name="moduleId" value="${project.parent.artifactId}"/> </bean>

  3. in \bahmni\openmrs-module-jasperreports\omod\src\main\resources\config.xml <require_module> org.openmrs.module.uiframework </require_module>

@msaule is the jasperreports module the custom module you are using? if you can change the dependency uiiframework-api to uiframework-omod in the pom.xml files

I changed it, but still have the same error(

Can we look at your compiled module (.omod)? Or simply its source?

Ok. This is a link for my omod file https://drive.google.com/file/d/0ByZBYvdpGeSLcS1oc1FNS0lNTVk/view

Which url are you accessing to get this error?

localhost/openmrs/jasperreport/helloWorld.page

It looks like you have not created a controller for your new helloWorld page. I think you need to create one (look at org.openmrs.module.jasperreport.web.controller.ReportListController for an example) to set up to route to helloWorld.jsp. Note that things have changed considerably in the new UI (2.x) and you don’t have to have a controller for each page.

My team manages the Jasper Reports module which I see that you are working with. Is there some specific functionality that you are looking to change or add?

Thanks for reply. I just want to change user interface of module and do it like in bahmni