Unknown entity and email service

0 views
Skip to first unread message

Che-Wei Kuo

unread,
Jun 13, 2013, 1:03:56 PM6/13/13
to d...@openmrs.org
hello all,

I have two questions ,one is about Unknown entity ,the other one is about how to follow TRUNK-3182 add email service?

About Unknown entity I can make sure I had created *.hbm.xml.they work alone successed.

write mappingFiles like this , it will show me Unknown entity: org.openmrs.module.dicomecg.DicomEcgAttribute
<mappingFiles>
  DicomEcg.hbm.xml
</mappingFiles>
<mappingFiles>
  DicomEcgAttribute.hbm.xml
</mappingFiles>
<mappingFiles>
  DicomEcgConfirm.hbm.xml
</mappingFiles>

write mappingFiles like this ,no one can work, how to let me using more then one hibernate file?
<mappingFiles>
  ${omodHbmConfig}
</mappingFiles>

Here is my GitHub



Wyclif Luyima

unread,
Jun 13, 2013, 5:25:29 PM6/13/13
to Developers
Hi Kuo,

For the first issue, in your module config.xml file, you need to add this

<mappingFiles>
    DicomEcg.hbm.xml
    DicomEcgAttribute.hbm.xml
    DicomEcgConfirm.hbm.xml
</mappingFiles>


If you have unit tests that need to access persistent objects for the mappings above, you need to add the following to your test-hibernate.cfg.xml

<hibernate-configuration>
    <session-factory>
      <mapping resource=" DicomEcg.hbm.xml" />
      <mapping resource="  DicomEcgAttribute.hbm.xml" />
      <mapping resource="  DicomEcgConfirm.hbm.xml" />
    </session-factory>
</hibernate-configuration>


As for the second question, it seems like there are still some ongoing discussions around that ticket and i wouldn't advise you to work on it for now.

Wyclif



--
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/
 
 



--
Wyclif Luyima
Regenstrief Institute Inc.

Confidentiality Notice: The contents of this message and any files transmitted with it may contain confidential and/or privileged information and are intended solely for the use of the named addressee(s). Additionally, the information contained herein may have been disclosed to you from medical records with confidentiality protected by federal and state laws. Federal regulations and State laws prohibit you from making further disclosure of such information without the specific written consent of the person to whom the information pertains or as otherwise permitted by such regulations. A general authorization for the release of medical or other information is not sufficient for this purpose.

If you have received this message in error, please notify the sender by return e-mail and delete the original message. Any retention, disclosure, copying, distribution or use of this information by anyone other than the intended recipient is strictly prohibited.

Che-Wei Kuo

unread,
Jun 13, 2013, 7:59:49 PM6/13/13
to d...@openmrs.org
Thank for your help ,Wyclif

I had added the mappingFiles as you say ,then update my module I get the Unable to refresh the WebApplicationContext error.
Is there have some setting need to set at moduleApplicationContext.xml or config.xml?

I got  this error message at first,

the error message

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 instantiate default
tuplizer
[org.hibernate.tuple.entity.PojoEntityTuplizer]




Wyclif Luyima於 2013年6月14日星期五UTC+8上午5時25分29秒寫道:

Rafal Korytkowski

unread,
Jun 14, 2013, 2:57:22 AM6/14/13
to Developers List
Hi,

You've got some error in your mapping files (hbm.xml). Check for typos. If you cannot find it, share with us the content of mapping files and corresponding classes.


-Rafał

Che-Wei Kuo

unread,
Jun 14, 2013, 3:09:42 AM6/14/13
to d...@openmrs.org
Hi ,Rafal
Thank you for your suggestion , i will check it after class

Kuo



2013/6/14 Rafal Korytkowski <ra...@openmrs.org>

Friedman, Roger (CDC/CGH/DGHA) (CTR)

unread,
Jun 14, 2013, 7:45:26 AM6/14/13
to d...@openmrs.org

This is almost always due to a problem with hbm.xml file as Rafa says.  The error message is gigantic and extends off the page, just copy and paste to a text editor.  The problem is described almost at the end of the message.

Che-Wei Kuo

unread,
Jun 14, 2013, 11:12:24 AM6/14/13
to d...@openmrs.org
Hi, Rafal 

Here is my GitHub ,  I had found some errors at DicomEcgAttribute.hbm.xml and liquibase.xml.
After change the error it's can update module when add mappingfiles like this

<mappingFiles>
    DicomEcg.hbm.xml
    DicomEcgAttribute.hbm.xml
</mappingFiles>

now i think my problem is at DicomEcgConfirm.xml file 
because i can not update module when i add it and map it 
but i can not found the error

Kuo

Rafal Korytkowski於 2013年6月14日星期五UTC+8下午2時57分22秒寫道:

Che-Wei Kuo

unread,
Jun 14, 2013, 11:16:15 AM6/14/13
to d...@openmrs.org
Roger thanks for your suggestion , i try to do what you say but nothing change.


2013/6/14 Friedman, Roger (CDC/CGH/DGHA) (CTR) <rd...@cdc.gov>

Wyclif Luyima

unread,
Jun 14, 2013, 12:55:54 PM6/14/13
to Developers
Kuo, it is good practice to have unit tests, so that you don't have to always install and run the module to find bad logic or hibernate mappings.

Wyclif

Che-Wei Kuo

unread,
Jun 14, 2013, 1:14:23 PM6/14/13
to d...@openmrs.org
sorry,what is unit tests? how to have it or install it?
would you give some links? thank you

Kuo


2013/6/15 Wyclif Luyima <wyc...@openmrs.org>

Wyclif Luyima

unread,
Jun 14, 2013, 3:13:51 PM6/14/13
to Developers
At a high-level, unit testing refers to the practice of testing certain functions and areas or units of code. This gives the developer the ability to verify that their functions work as expected. That is to say that for any function and given a set of inputs, they can determine if the function is returning the proper values or not or even if it fails with exceptions probably due to bad input values.
There are so many articles on the internet about unit testing in software development and its relevance, here is what we have on our wiki about unit testing and it points you to other resources.

Wyclif

Ben Wolfe

unread,
Jun 14, 2013, 11:51:08 PM6/14/13
to Developers

What's the full stack trace either from the module start page or from the server logs?  Could have something about a property not matching or libraries not matching maybe. Google says something about javaassist jar not being there, but that should be handled by openmrs.

If you narrowed it down to that file, you could try taking out parts of the hbm file until you find it.

Ben

Reply all
Reply to author
Forward
0 new messages