<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=aswan" rel="nofollow">Andrew Swan</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9731?redirect=false" rel="nofollow">SPR-9731</a></strong> and commented</p>
<p dir="auto">Currently, <code class="notranslate">MappingJacksonHttpMessageConverter</code> only reads from the request body. It would be useful in some cases to also be able to set an object's fields based on values in the request's headers.</p>
<p dir="auto">Attached are a class and unit test demonstrating how this could be done; this code could be added to Spring as-is or used as a basis for enhancing <code class="notranslate">MappingJacksonHttpMessageConverter</code> in a backward-compatible way (in which case the behaviour would need to be changed slightly so that values in the body took precedence over values in the header, in cases of duplication).</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.2</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/20299/HeaderAwareMappingJacksonHttpMessageConverter.java" rel="nofollow">HeaderAwareMappingJacksonHttpMessageConverter.java</a> (<em>3.14 kB</em>)</li>
<li><a href="https://jira.spring.io/secure/attachment/20300/HeaderAwareMappingJacksonHttpMessageConverterTest.java" rel="nofollow">HeaderAwareMappingJacksonHttpMessageConverterTest.java</a> (<em>2.57 kB</em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=vbose" rel="nofollow">Vigil Bose</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-2290?redirect=false" rel="nofollow">SPR-2290</a></strong> and commented</p>
<p dir="auto">We are getting the below exception when we tried to run the application using spring rc-2.<br>
Since we got the same exception "Spring Form Tag generates a null 'id' when not specified and duplicates the 'name' attribute regardless"</p>
<p dir="auto">Key:	<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398067358" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/6862" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/6862/hovercard" href="https://github.com/spring-projects/spring-framework/issues/6862">#6862</a><br>
Type:	 Bug<br>
Component/s:	SpringWEB<br>
Affects Version/s:	2.0 RC1<br>
Fix Version/s:	2.0 RC2</p>
<p dir="auto"><a href="http://opensource.atlassian.com/projects/spring/browse/SPR-2171" rel="nofollow">http://opensource.atlassian.com/projects/spring/browse/SPR-2171</a></p>
<p dir="auto">I tried with RC2 release and now I am getting the below exception. Can you please have a look at it.</p>
<p dir="auto">org.springframework.beans.factory.access.BootstrapException: Unable to initialize group definition. Group resource name [classpath:beanRefContext.xml], factory key [servicelayer-context]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servicelayer-context' defined in class path resource [beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Line 16 in XML document from class path resource [alert-common-context.xml] is invalid; nested exception is oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'<br>
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servicelayer-context' defined in class path resource [beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Line 16 in XML document from class path resource [alert-common-context.xml] is invalid; nested exception is oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'<br>
Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Line 16 in XML document from class path resource [alert-common-context.xml] is invalid; nested exception is oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'<br>
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Line 16 in XML document from class path resource [alert-common-context.xml] is invalid; nested exception is oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'<br>
Caused by: oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'<br>
at oracle.xml.parser.v2.XMLError.flushErrorHandler(XMLError.java:444)<br>
at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:303)<br>
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:290)<br>
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:196)<br>
at oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:151)<br>
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:66)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:385)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:340)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:315)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:126)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:142)<br>
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:168)<br>
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)<br>
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)<br>
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:283)<br>
at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:92)<br>
at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:77)<br>
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br>
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)<br>
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)<br>
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)<br>
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:82)<br>
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)<br>
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:156)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:548)<br>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:352)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:240)<br>
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:132)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:237)<br>
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:153)<br>
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:254)<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:337)<br>
at org.springframework.context.access.ContextSingletonBeanFactoryLocator.initializeDefinition(ContextSingletonBeanFactoryLocator.java:136)<br>
at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:380)<br>
at org.springframework.web.context.ContextLoader.loadParentContext(ContextLoader.java:319)<br>
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:180)<br>
at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)<br>
at javax.servlet.GenericServlet.init(GenericServlet.java:258)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.loadServlet(HttpApplication.java:2354)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.findServlet(HttpApplication.java:4795)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.initDynamic(HttpApplication.java:1015)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpApplication.&lt;init&gt;(HttpApplication.java:549)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.Application.getHttpApplication(Application.java:890)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpServer.getHttpApplication(HttpServer.java:707)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpSite.initApplications(HttpSite.java:625)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpSite.setConfig(HttpSite.java:278)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpServer.setSites(HttpServer.java:278)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpServer.setConfig(HttpServer.java:179)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.ApplicationServer.setConfig(ApplicationServer.java:1551)<br>
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)<br>
at java.lang.Thread.run(Thread.java:534)</p>
<p dir="auto">-------------------------------------------------alert-common-context.xml definition ----------------------------</p>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;!--</p>
<ul dir="auto">
<li>Application context definition for Alert System Specific common services layer.</li>
<li>Contains bean references to the transaction manager and to the DAOs in</li>
<li>alert-dataAccess-context.xml.<br>
--&gt;</li>
</ul>
<p dir="auto">&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xmlns:aop="<a href="http://www.springframework.org/schema/aop" rel="nofollow">http://www.springframework.org/schema/aop</a>"<br>
xmlns:tx="<a href="http://www.springframework.org/schema/tx" rel="nofollow">http://www.springframework.org/schema/tx</a>"<br>
xmlns:util="<a href="http://www.springframework.org/schema/util" rel="nofollow">http://www.springframework.org/schema/util</a>"<br>
xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a> <a href="http://www.springframework.org/schema/beans/spring-beans.xsd" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans.xsd</a><br>
<a href="http://www.springframework.org/schema/aop" rel="nofollow">http://www.springframework.org/schema/aop</a> <a href="http://www.springframework.org/schema/aop/spring-aop.xsd" rel="nofollow">http://www.springframework.org/schema/aop/spring-aop.xsd</a><br>
<a href="http://www.springframework.org/schema/tx" rel="nofollow">http://www.springframework.org/schema/tx</a> <a href="http://www.springframework.org/schema/tx/spring-tx.xsd" rel="nofollow">http://www.springframework.org/schema/tx/spring-tx.xsd</a><br>
<a href="http://www.springframework.org/schema/util" rel="nofollow">http://www.springframework.org/schema/util</a> <a href="http://www.springframework.org/schema/util/spring-util.xsd%22%3E" rel="nofollow">http://www.springframework.org/schema/util/spring-util.xsd"&gt;</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&lt;!-- ===========================PROPERTY FILE CONFIGURER DEFINITION ============================= --&gt;
 &lt;!-- Configurer that replaces ${...} placeholders with values from properties files --&gt;
 &lt;!-- (in this case, alert properties) --&gt;
 &lt;bean id=&quot;propertyConfigurer&quot; class=&quot;org.springframework.beans.factory.config.PropertyPlaceholderConfigurer&quot;&gt;
      &lt;property name=&quot;locations&quot;&gt;
           &lt;list&gt;
                &lt;value&gt;alert.properties&lt;/value&gt;
                &lt;value&gt;jndi.properties&lt;/value&gt;
           &lt;/list&gt;
      &lt;/property&gt;
             &lt;/bean&gt;	
  &lt;!-- ===================== Alert System Common Business Service Definitions =======================--&gt;
 &lt;bean id=&quot;lookupService&quot; class=&quot;gov.fda.furls.alert.application.common.bus.impl.LookUpServiceImpl&quot;&gt;
      &lt;property name=&quot;lookUpServiceDao&quot; ref=&quot;lookupDao&quot;/&gt;
 &lt;/bean&gt;
  &lt;bean id=&quot;alertTypesService&quot; class=&quot;gov.fda.furls.alert.application.common.bus.impl.AlertTypesServiceImpl&quot;&gt;
      &lt;property name=&quot;alertTypesServiceDao&quot; ref=&quot;alertTypesDao&quot;/&gt;
 &lt;/bean&gt;
 &lt;!--  ================== Account related Business Service Definitions =============================--&gt;
 &lt;bean id=&quot;accountServices&quot; class=&quot;gov.fda.furls.alert.application.common.bus.impl.AccountServiceImpl&quot;&gt;
      &lt;property name=&quot;accountServicesDelegate&quot; ref=&quot;accountServicesDelegate&quot;/&gt;
             &lt;/bean&gt;	
  &lt;bean id=&quot;accountServicesDelegate&quot; class=&quot;gov.fda.furls.alert.application.common.bus.external.delegate.AccountServicesDelegate&quot;&gt;
      &lt;property name=&quot;oaaServicesHome&quot; ref=&quot;oaaServicesHome&quot;/&gt;
      &lt;property name=&quot;accountServicesTransformer&quot; ref=&quot;accountServicesTransformer&quot;/&gt;
 &lt;/bean&gt;
                                                                                                                                                                                                                                                                                                              &lt;bean id=&quot;accountServicesTransformer&quot; class=&quot;gov.fda.furls.alert.application.common.bus.external.transformer.impl.AccountServicesTransformerImpl&quot;&gt;		
      &lt;property name=&quot;fdaRoleList&quot; ref=&quot;fdaRoleList&quot;/&gt;
      &lt;property name=&quot;fdaAlertRoleStartWith&quot; value=&quot;AT_&quot;/&gt;
 &lt;/bean&gt;
  &lt;bean id=&quot;alertRulesService&quot; class=&quot;gov.fda.furls.alert.application.common.bus.impl.AlertRulesServiceImpl&quot;&gt;
      &lt;property name=&quot;alertRulesServiceDao&quot; ref=&quot;alertRulesDao&quot;/&gt;
 &lt;/bean&gt;
  &lt;!-- creates a java.util.List instance with values loaded from the supplied 'sourceList' --&gt;
 &lt;util:list id=&quot;fdaRoleList&quot;&gt;
      &lt;value&gt;AT_FFRM_ADMIN&lt;/value&gt;
      &lt;value&gt;AT_FFRM_UPDATE&lt;/value&gt;
      &lt;value&gt;AT_FFRM_READ&lt;/value&gt;
 &lt;/util:list&gt;"><pre class="notranslate"><code class="notranslate">&lt;!-- ===========================PROPERTY FILE CONFIGURER DEFINITION ============================= --&gt;
 &lt;!-- Configurer that replaces ${...} placeholders with values from properties files --&gt;
 &lt;!-- (in this case, alert properties) --&gt;
 &lt;bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;
      &lt;property name="locations"&gt;
           &lt;list&gt;
                &lt;value&gt;alert.properties&lt;/value&gt;
                &lt;value&gt;jndi.properties&lt;/value&gt;
           &lt;/list&gt;
      &lt;/property&gt;
             &lt;/bean&gt;	
  &lt;!-- ===================== Alert System Common Business Service Definitions =======================--&gt;
 &lt;bean id="lookupService" class="gov.fda.furls.alert.application.common.bus.impl.LookUpServiceImpl"&gt;
      &lt;property name="lookUpServiceDao" ref="lookupDao"/&gt;
 &lt;/bean&gt;
  &lt;bean id="alertTypesService" class="gov.fda.furls.alert.application.common.bus.impl.AlertTypesServiceImpl"&gt;
      &lt;property name="alertTypesServiceDao" ref="alertTypesDao"/&gt;
 &lt;/bean&gt;
 &lt;!--  ================== Account related Business Service Definitions =============================--&gt;
 &lt;bean id="accountServices" class="gov.fda.furls.alert.application.common.bus.impl.AccountServiceImpl"&gt;
      &lt;property name="accountServicesDelegate" ref="accountServicesDelegate"/&gt;
             &lt;/bean&gt;	
  &lt;bean id="accountServicesDelegate" class="gov.fda.furls.alert.application.common.bus.external.delegate.AccountServicesDelegate"&gt;
      &lt;property name="oaaServicesHome" ref="oaaServicesHome"/&gt;
      &lt;property name="accountServicesTransformer" ref="accountServicesTransformer"/&gt;
 &lt;/bean&gt;
                                                                                                                                                                                                                                                                                                              &lt;bean id="accountServicesTransformer" class="gov.fda.furls.alert.application.common.bus.external.transformer.impl.AccountServicesTransformerImpl"&gt;		
      &lt;property name="fdaRoleList" ref="fdaRoleList"/&gt;
      &lt;property name="fdaAlertRoleStartWith" value="AT_"/&gt;
 &lt;/bean&gt;
  &lt;bean id="alertRulesService" class="gov.fda.furls.alert.application.common.bus.impl.AlertRulesServiceImpl"&gt;
      &lt;property name="alertRulesServiceDao" ref="alertRulesDao"/&gt;
 &lt;/bean&gt;
  &lt;!-- creates a java.util.List instance with values loaded from the supplied 'sourceList' --&gt;
 &lt;util:list id="fdaRoleList"&gt;
      &lt;value&gt;AT_FFRM_ADMIN&lt;/value&gt;
      &lt;value&gt;AT_FFRM_UPDATE&lt;/value&gt;
      &lt;value&gt;AT_FFRM_READ&lt;/value&gt;
 &lt;/util:list&gt;
</code></pre></div>
<p dir="auto">&lt;/beans&gt;<br>
NOTE: Line 16 in XML document from class path resource [alert-common-context.xml] is where we source spring-util.xsd in alert-common-context.xml file.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0 RC2</p>
<p dir="auto"><strong>Attachments:</strong></p>
<ul dir="auto">
<li><a href="https://jira.spring.io/secure/attachment/11804/xmlparserv2.jar" rel="nofollow">xmlparserv2.jar</a> (<em>1.16 MB</em>)</li>
</ul>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398081715" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/8664" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/8664/hovercard" href="https://github.com/spring-projects/spring-framework/issues/8664">#8664</a> CLONE -oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType'. Unable to Start OC4J Server</li>
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398104735" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11790" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11790/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11790">#11790</a> oracle.xml.parser.schema.XSDException: Duplicated definition for: 'identifiedType' is back</li>
</ul>