I am facing an issue creating a patient, I get the error message below:
<!doctype html>
<html lang="en">
<head>
<title>HTTP Status 400 – Bad Request</title>
<style type="text/css">
h1 {
font-family: Tahoma, Arial, sans-serif;
color: white;
background-color: #525D76;
font-size: 22px;
}
h2 {
font-family: Tahoma, Arial, sans-serif;
color: white;
background-color: #525D76;
font-size: 16px;
}
h3 {
font-family: Tahoma, Arial, sans-serif;
color: white;
background-color: #525D76;
font-size: 14px;
}
body {
font-family: Tahoma, Arial, sans-serif;
color: black;
background-color: white;
}
b {
font-family: Tahoma, Arial, sans-serif;
color: white;
background-color: #525D76;
}
p {
font-family: Tahoma, Arial, sans-serif;
background: white;
color: black;
font-size: 12px;
}
a {
color: black;
}
a.name {
color: black;
}
.line {
height: 1px;
background-color: #525D76;
border: none;
}
</style>
</head>
<body>
<h1>HTTP Status 400 – Bad Request</h1>
<hr class="line" />
<p><b>Type</b> Exception Report</p>
<p><b>Message</b> No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no
properties discovered to create BeanSerializer (to avoid exception, disable
SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain:
org.openmrs.module.webservices.validation.ValidationException["errors"]->org.springframework.validation.BindException["bindingResult"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"])
</p>
<p><b>Description</b> The server cannot or will not process the request due to something that is perceived to be a
client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
</p>
<p><b>Exception</b></p>
<pre>com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.springframework.validation.DefaultMessageCodesResolver and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: org.openmrs.module.webservices.validation.ValidationException["errors"]->org.springframework.validation.BindException["bindingResult"]->org.springframework.validation.BeanPropertyBindingResult["messageCodesResolver"])
com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1277)
com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400)
com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71)
com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:728)
com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:755)
com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:178)
com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1516)
com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1006)
org.springframework.web.servlet.view.json.AbstractJackson2View.writeContent(AbstractJackson2View.java:228)
org.springframework.web.servlet.view.json.AbstractJackson2View.renderMergedOutputModel(AbstractJackson2View.java:172)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:316)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1373)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1118)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1057)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.openmrs.module.web.filter.ForcePasswordChangeFilter.doFilter(ForcePasswordChangeFilter.java:60)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:73)
org.openmrs.web.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:65)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.webservices.rest.web.filter.AuthorizationFilter.doFilter(AuthorizationFilter.java:105)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.webservices.rest.web.filter.ContentTypeFilter.doFilter(ContentTypeFilter.java:64)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:106)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:93)
org.openmrs.module.owa.filter.OwaFilter.doFilter(OwaFilter.java:61)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.spa.filter.SpaFilter.doFilter(SpaFilter.java:53)
org.openmrs.module.web.filter.ModuleFilterChain.doFilter(ModuleFilterChain.java:71)
org.openmrs.module.web.filter.ModuleFilter.doFilter(ModuleFilter.java:57)
org.openmrs.web.filter.OpenmrsFilter.doFilterInternal(OpenmrsFilter.java:105)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:156)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108)
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108)
org.openmrs.web.filter.StartupFilter.doFilter(StartupFilter.java:108)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
</pre>
<p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p>
<hr class="line" />
<h3>Apache Tomcat/8.5.39 (Ubuntu)</h3>
</body>
</html>
Using Postman. I am wondering why it failed
This one failed:
{
"person":{
"names":[
{
"givenName": "Adolf",
"familyName": "Hitler"
}
],
"gender": "M",
"birthdate": "1889-04-20",
"dead":true,
"deathDate":"1945-04-30",
"causeOfDeath":"Committed suicide by poisoning",
"addresses": [
{
"address1": "Street 123, Main Stree",
"cityVillage": "Berlin",
"country": "Germany",
"postalCode": "560037",
"address4": "0779030237",
"address5": "0782169348",
"address6": "f_irasa@yahoo.com"
}
]
},
"identifiers": [
{
"identifier":"10007F",
"identifierType":"05a29f94-c0ed-11e2-94be-8c13b969e334",
"location":"8d6c993e-c2cc-11de-8d13-0010c6dffd0f",
"preferred":true
}
]
}
This one was successful
{
"person":{
"names":[
{
"givenName": "Napoleon",
"familyName": "Bonaparte"
}
],
"gender": "M",
"birthdate": "1920-12-01",
"addresses": [
{
"address1": "Street 123, Main Stree",
"cityVillage": "Paris",
"country": "France",
"postalCode": "560037",
"address4": "0779030237",
"address5": "0782169348",
"address6": "f_irasa@yahoo.com"
}
]
},
"identifiers": [
{
"identifier":"1003C3",
"identifierType":"05a29f94-c0ed-11e2-94be-8c13b969e334",
"location":"8d6c993e-c2cc-11de-8d13-0010c6dffd0f",
"preferred":true
}
]
}