<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=npadgett" rel="nofollow">Nick Padgett</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5660?redirect=false" rel="nofollow">SPR-5660</a></strong> and commented</p>
<p dir="auto">I am currently ingesting JSON through the servlet request body.  In order to take advantage of Spring's data binding, I extend ServletRequestDataBinder and override bind(ServletRequest).  The problem with ServletRequestDataBinder is that I cannot call super.bind(ServletRequest) and still do something useful.  Instead, I am forced to duplicate the code from super.bind(ServletRequest).  See JacksonJsonServletRequestDataBinder.java.</p>
<p dir="auto">Please add a method similar to extensibleBind(ServletRequest) to ServletRequestDataBinder.</p>
<p dir="auto">Or, allow me to register a custom class that can resolve MutablePropertyValues.  This second approach would alleviate the need for me to additionally extend AnnotationMethodHandlerAdapter to register a custom ServletRequestDataBinder.  See JacksonJsonAnnotationMethodHandlerAdapter.java.<br>
\<br>
\</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public class JacksonJsonServletRequestDataBinder extends
        ServletRequestDataBinder {

	public JacksonJsonServletRequestDataBinder(Object target, String objectName) {
		super(target, objectName);
	}

	@Override
	public void bind(ServletRequest request) {
		MutablePropertyValues mpvs = new ServletRequestParameterPropertyValues(request);
		if (request instanceof MultipartHttpServletRequest) {
			MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
			bindMultipartFiles(multipartRequest.getFileMap(), mpvs);
		}
		extensibleBind(request);
		doBind(mpvs);
	}

	protected void extensibleBind(ServletRequest request) {
		// parseJsonObject(request, mpvs);
	}
}"><pre class="notranslate"><code class="notranslate">public class JacksonJsonServletRequestDataBinder extends
        ServletRequestDataBinder {

	public JacksonJsonServletRequestDataBinder(Object target, String objectName) {
		super(target, objectName);
	}

	@Override
	public void bind(ServletRequest request) {
		MutablePropertyValues mpvs = new ServletRequestParameterPropertyValues(request);
		if (request instanceof MultipartHttpServletRequest) {
			MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
			bindMultipartFiles(multipartRequest.getFileMap(), mpvs);
		}
		extensibleBind(request);
		doBind(mpvs);
	}

	protected void extensibleBind(ServletRequest request) {
		// parseJsonObject(request, mpvs);
	}
}
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Component
public class JacksonJsonAnnotationMethodHandlerAdapter extends
        AnnotationMethodHandlerAdapter {
    @Override
    protected ServletRequestDataBinder createBinder(HttpServletRequest request,
            Object target, String objectName) {
        return new JacksonJsonServletRequestDataBinder(target, objectName);
    }
}"><pre class="notranslate"><code class="notranslate">@Component
public class JacksonJsonAnnotationMethodHandlerAdapter extends
        AnnotationMethodHandlerAdapter {
    @Override
    protected ServletRequestDataBinder createBinder(HttpServletRequest request,
            Object target, String objectName) {
        return new JacksonJsonServletRequestDataBinder(target, objectName);
    }
}
</code></pre></div>
<hr>
<p dir="auto">No further details from <a href="https://jira.spring.io/browse/SPR-5660?redirect=false" rel="nofollow">SPR-5660</a></p>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=sivabbl" rel="nofollow">Sivakumar</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-4869?redirect=false" rel="nofollow">SPR-4869</a></strong> and commented</p>
<p dir="auto">I am getting below error while  I  am deploy in to the  weblogic Can any one suggest the solution for this error:</p>
<hr>
<p dir="auto">org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unexpected failure during bean definition parsing<br>
Offending resource: ServletContext resource [/WEB-INF/test-servlet.xml]<br>
Bean 'yyyy'; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Multiple 'property' definitions for property 'zzzz'<br>
Offending resource: ServletContext resource [/WEB-INF/test-servlet.xml]<br>
Bean 'yyyy'<br>
-&gt; Property 'zzzz'<br>
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)<br>
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:288)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:573)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:389)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:358)<br>
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.processBeanDefinition(DefaultBeanDefinitionDocumentReader.java:239)<br>
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:153)<br>
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)<br>
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)<br>
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)<br>
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)<br>
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)<br>
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)<br>
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)<br>
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)<br>
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)<br>
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)<br>
at javax.servlet.GenericServlet.init(GenericServlet.java:258)<br>
at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubImpl.java:1028)<br>
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)<br>
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)<br>
at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:904)<br>
at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:883)<br>
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:822)<br>
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:535)<br>
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:373)<br>
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)<br>
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)<br>
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)<br>
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)<br>
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)<br>
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)<br>
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)<br>
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)<br>
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Multiple 'property' definitions for property 'zzzz'<br>
Offending resource: ServletContext resource [/WEB-INF/test-servlet.xml]<br>
Bean 'editFolder'<br>
-&gt; Property 'zzzz'<br>
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)<br>
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)<br>
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:281)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parsePropertyElement(BeanDefinitionParserDelegate.java:780)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parsePropertyElements(BeanDefinitionParserDelegate.java:659)<br>
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:558)<br>
... 39 more</p>
<p dir="auto">class name org.springframework.web.context.support.XmlWebApplicationContext<br>
is an instance of wac<br>
sc ServletContext(id=29757300,name=webapp,context-path=/webapp)</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.4</p>