module starting error

3 views
Skip to first unread message

awanth sen

unread,
Dec 2, 2013, 4:03:50 AM12/2/13
to d...@openmrs.org
Hi

Im getting an error on starting a module in Openmrs,

Can someone please help me in understanding what this error is actually about and how to solve it?
i built the omod using IntellJ IDEA

this is the full error:
Unable to refresh the WebApplicationContext
Error creating bean with name 'messageSourceServiceTarget' defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean 'mutableResourceBundleMessageSource' while setting bean property 'activeMessageSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mutableResourceBundleMessageSource' defined in class path resource [applicationContext-service.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor#0' defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean 'transactionInterceptor' while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionInterceptor' defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationContext-service.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-service.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to parse order-by fragment
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:755)
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:413)
 ** org.openmrs.module.ModuleUtil.refreshApplicationContext(ModuleUtil.java:781)
 ** org.openmrs.module.web.WebModuleUtil.refreshWAC(WebModuleUtil.java:846)
 ** org.openmrs.module.web.WebModuleUtil.startModule(WebModuleUtil.java:278)
 ** org.openmrs.module.web.controller.ModuleListController.onSubmit(ModuleListController.java:177)
org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:272)
org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:268)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 ** org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:65)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 ** org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:76)
 ** org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:58)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 ** org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:111)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 ** org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 ** org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 ** org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:109)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:679)

Lluis Martinez

unread,
Dec 2, 2013, 4:26:18 AM12/2/13
to d...@openmrs.org
Do you have any Hibernate mapping with an invalid order-by attribute perhaps ?

Invocation of init method failed; nested exception is
org.hibernate.HibernateException: Unable to parse order-by fragment

> --
> OpenMRS Developers: http://go.openmrs.org/dev
> Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
> Manage your OpenMRS subscriptions at https://id.openmrs.org/
>
> To unsubscribe from this group and stop receiving emails from it, send an
> email to dev+uns...@openmrs.org.

Daniel Kayiwa

unread,
Dec 2, 2013, 5:02:41 AM12/2/13
to dev
It looks like a library conflict which you can narrow down by identifying the module whose installation started it all.
--
If we keep uppermost in our minds the unkind and unjust acts of others, we shall find it impossible to love them as Christ has loved us; but if our thoughts dwell upon the wondrous love and pity of Christ for us, the same spirit will flow out to others.

awanth sen

unread,
Dec 2, 2013, 5:39:26 AM12/2/13
to d...@openmrs.org
Hi both,
I dont have any other module in my implementation. this is the first module im trying to load.

it  has an sqldiff file which creates the table:

    <sql>
            CREATE TABLE IF NOT EXISTS `myreg` (
            `registration_fee_id` int(11) NOT NULL AUTO_INCREMENT,
            `fee` decimal(19,2) NOT NULL,
            `patient_id` int(11) NOT NULL,
            `created_by` int(11) NOT NULL,
            `created_on` datetime NOT NULL,
            PRIMARY KEY (`registration_fee_id`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
        </sql>

then the hbm file:
<class name="Registration" table="myreg" batch-size="500">

        <id name="id" type="int" column="registration_fee_id"
            unsaved-value="0">
                <generator class="native"/>
        </id>
        <property name="createdOn" column="created_on" />
        <property name="fee" column="fee" />
        <many-to-one name="patient" column="patient_id" class="org.openmrs.Patient"/>
        <many-to-one name="createdBy" column="created_by" class="org.openmrs.User"/>
    </class>

then the Model class:

public class Registration {

    private static final long serialVersionUID = 1L;

    private Integer id;
    private Patient patient;
    private Date createdOn;
    private User createdBy;
    private BigDecimal fee;   
.........

Is there anything wrong here?

thanks

Dkayiwa,

I went through this post before posting the question here. It doesnt have an groovy dependency hence i added all theh lines mentioned there, but when i put the suggested lines in my pom files the module doesnt even build as it gives the following error,

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar (default-jar) on project registration-api: Error assembling JAR: For artifact {org.codehaus.groovy:groovy:null:jar}: The version cannot be empty. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :registration-api

Process finished with exit code 1


Thanks
regards
Awanthika

------------------------------------------------------------------------------------------->>
AWANTHIKA SENARATH
Undergraduate
Department of Electronics and Telecommunication Engineering
University of Moratuwa

Daniel Kayiwa

unread,
Dec 2, 2013, 5:40:33 AM12/2/13
to dev
Is your module some where like github for me to look at?

awanth sen

unread,
Dec 5, 2013, 11:52:36 PM12/5/13
to d...@openmrs.org
Hi Daniel,

Im sorry the module is not something that is developed by me and Im not in a position to share it yet. Ill try to show you the code once i get permission

thank you for your help
Awanthika
Reply all
Reply to author
Forward
0 new messages