org.openmrs.api.db.DAOException

Error while running sql: CREATE TABLE IF NOT EXISTS `xforms_xform` ( `form_id` int(11) NOT NULL, `xform_xml` longtext, `layout_xml` longtext, `creator` int(11) NOT NULL default '0', `date_created` datetime NOT NULL default '0000-00-00 00:00:00', `changed_by` int(11) default NULL, `date_changed` datetime default NULL, PRIMARY KEY (`form_id`), KEY `user_who_created_xform` (`creator`), KEY `form_with_which_xform_is_related` (`form_id`), CONSTRAINT `user_who_created_xform` FOREIGN KEY (`creator`) REFERENCES `users` (`user_id`), CONSTRAINT `user_who_last_changed_xform` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 . Message: Unknown data type: "USER_WHO_CREATED_XFORM"; SQL statement: CREATE TABLE IF NOT EXISTS `xforms_xform` ( `form_id` int(11) NOT NULL, `xform_xml` longtext, `layout_xml` longtext, `creator` int(11) NOT NULL default '0', `date_created` datetime NOT NULL default '0000-00-00 00:00:00', `changed_by` int(11) default NULL, `date_changed` datetime default NULL, PRIMARY KEY (`form_id`), KEY `user_who_created_xform` (`creator`), KEY `form_with_which_xform_is_related` (`form_id`), CONSTRAINT `user_who_created_xform` FOREIGN KEY (`creator`) REFERENCES `users` (`user_id`), CONSTRAINT `user_who_last_changed_xform` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 [50004-135]

Samebug tips1

Check if you're not creating unused SQL entities, as it might cause this exception.


rafaelrafael

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web832

  • via Unknown by Jon Skeet,
  • via Unknown by Jon Skeet,
  • via GitHub by talnicolas
    ,
  • Stack trace

    • org.openmrs.api.db.DAOException: Error while running sql: CREATE TABLE IF NOT EXISTS `xforms_xform` ( `form_id` int(11) NOT NULL, `xform_xml` longtext, `layout_xml` longtext, `creator` int(11) NOT NULL default '0', `date_created` datetime NOT NULL default '0000-00-00 00:00:00', `changed_by` int(11) default NULL, `date_changed` datetime default NULL, PRIMARY KEY (`form_id`), KEY `user_who_created_xform` (`creator`), KEY `form_with_which_xform_is_related` (`form_id`), CONSTRAINT `user_who_created_xform` FOREIGN KEY (`creator`) REFERENCES `users` (`user_id`), CONSTRAINT `user_who_last_changed_xform` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 . Message: Unknown data type: "USER_WHO_CREATED_XFORM"; SQL statement: CREATE TABLE IF NOT EXISTS `xforms_xform` ( `form_id` int(11) NOT NULL, `xform_xml` longtext, `layout_xml` longtext, `creator` int(11) NOT NULL default '0', `date_created` datetime NOT NULL default '0000-00-00 00:00:00', `changed_by` int(11) default NULL, `date_changed` datetime default NULL, PRIMARY KEY (`form_id`), KEY `user_who_created_xform` (`creator`), KEY `form_with_which_xform_is_related` (`form_id`), CONSTRAINT `user_who_created_xform` FOREIGN KEY (`creator`) REFERENCES `users` (`user_id`), CONSTRAINT `user_who_last_changed_xform` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 [50004-135] at org.openmrs.util.DatabaseUtil.executeSQL(DatabaseUtil.java:144) at org.openmrs.api.db.hibernate.HibernateAdministrationDAO.executeSQL(HibernateAdministrationDAO.java:340) at org.openmrs.api.impl.AdministrationServiceImpl.executeSQL(AdministrationServiceImpl.java:802) 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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy30.executeSQL(Unknown Source) 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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.openmrs.aop.LoggingAdvice.invoke(LoggingAdvice.java:122) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:50) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy51.executeSQL(Unknown Source) 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.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at com.sun.proxy.$Proxy51.executeSQL(Unknown Source) at org.openmrs.module.ModuleFactory.runDiff(ModuleFactory.java:739) at org.openmrs.module.ModuleFactory.startModuleInternal(ModuleFactory.java:567) at org.openmrs.api.context.Daemon$1.run(Daemon.java:58) Caused by: org.h2.jdbc.JdbcSQLException: Unknown data type: "USER_WHO_CREATED_XFORM"; SQL statement: CREATE TABLE IF NOT EXISTS `xforms_xform` ( `form_id` int(11) NOT NULL, `xform_xml` longtext, `layout_xml` longtext, `creator` int(11) NOT NULL default '0', `date_created` datetime NOT NULL default '0000-00-00 00:00:00', `changed_by` int(11) default NULL, `date_changed` datetime default NULL, PRIMARY KEY (`form_id`), KEY `user_who_created_xform` (`creator`), KEY `form_with_which_xform_is_related` (`form_id`), CONSTRAINT `user_who_created_xform` FOREIGN KEY (`creator`) REFERENCES `users` (`user_id`), CONSTRAINT `user_who_last_changed_xform` FOREIGN KEY (`changed_by`) REFERENCES `users` (`user_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 [50004-135] at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)[...]

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Unknown visitor
    Unknown visitorOnce,
    andyglickandyglick
    14 times, last one
    tvrmsmithtvrmsmith
    Once,
    aidoanaidoan
    6 times, last one
    guizmaiiguizmaii
    34 times, last one
    143 more bugmates