<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=bfovez" rel="nofollow">Bertrand Fovez</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-6494?redirect=false" rel="nofollow">SPR-6494</a></strong> and commented</p>
<p dir="auto">The tag &lt;import resource="..."/&gt; acts differently in version 3.0.0 and 2.5.6.<br>
For example, consider these two xml configuration files, located in a package "context".</p>
<p dir="auto">File: dependent-context.xml</p>
<hr>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance</a>" 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-2.5.xsd%22%3E" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;</a><br>
&lt;bean id="myBean" class="java.lang.String" /&gt;<br>
&lt;/beans&gt;</p>
<p dir="auto">File: super-context.xml</p>
<hr>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>
&lt;beans xmlns="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow">http://www.w3.org/2001/XMLSchema-instance</a>" 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-2.5.xsd%22%3E" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"&gt;</a><br>
&lt;import resource="dependent-context.xml" /&gt;<br>
&lt;/beans&gt;</p>
<p dir="auto">We load the latter, using the following:<br>
new ClassPathXmlApplicationContext("context/super-context.xml");</p>
<p dir="auto">Here is the log using Spring 2.5.6.SEC01:</p>
<hr>
<p dir="auto">11:47:58,903 INFO  [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@19efb05: display name [org.springframework.context.support.ClassPathXmlApplicationContext@19efb05]; startup date [Wed Dec 02 11:47:58 CET 2009]; root of context hierarchy<br>
11:47:58,949 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [context/super-context.xml]<br>
11:47:59,027 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [context/dependent-context.xml]<br>
11:47:59,059 INFO  [ClassPathXmlApplicationContext] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@19efb05]: org.springframework.beans.factory.support.DefaultListableBeanFactory@47393f<br>
11:47:59,059 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@47393f: defining beans [myBean]; root of factory hierarchy</p>
<p dir="auto">Note that the dependent-context.xml file is loaded as "class path resource [context/dependent-context.xml]"</p>
<p dir="auto">Here is the log using Spring 3.0.0.RC3:</p>
<hr>
<p dir="auto">12:06:57,312 INFO  [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@8814e9: startup date [Wed Dec 02 12:06:57 CET 2009]; root of context hierarchy<br>
12:06:57,608 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from class path resource [context/super-context.xml]<br>
12:06:57,686 INFO  [XmlBeanDefinitionReader] Loading XML bean definitions from URL [file:/C:/Workspace/__Test/target/classes/context/dependent-context.xml]<br>
12:06:57,795 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1a9334: defining beans [myBean]; root of factory hierarchy</p>
<p dir="auto">Note that the dependent-context.xml file is new loaded as "URL [file:/C:/Workspace/__Test/target/classes/context/dependent-context.xml]"</p>
<p dir="auto">If the two file are located in different folders on the file system, as it is often the case, the loading fails.</p>
<p dir="auto">This difference generates several major regressions in our existing projects.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0 RC3</p>
<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="398100310" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/11159" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/11159/hovercard" href="https://github.com/spring-projects/spring-framework/issues/11159">#11159</a> Regression about the suppport of the tag  (<em><strong>"duplicates"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=patrick.crocker@gmail.com" rel="nofollow">Patrick Crocker</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7361?redirect=false" rel="nofollow">SPR-7361</a></strong> and commented</p>
<p dir="auto">We are currently working on an enterprise project for one of our biggest clients. We are using Spring 2.0 and Spring Web Flow 1.0 Rc4. While deploying the application to Oracle 9ias 10.1.2.0.2 in our development environment, we encountered the following error. We experienced the same error in Spring 2.0 RC2 and it was fixed in Spring 2.0 RC3 by Rick Evans. The ticket No is SPR - 2290. Kindly fix the bug. I will attach the XMLParser Oracle uses so you guys can test it. This is a critical error and we are unable to move forward.</p>
<p dir="auto">EXCEPTION FROM THE LOG FILE:</p>
<hr>
<p dir="auto">06/10/11 17:58:18 Started<br>
06/10/11 17:58:21 drlm: jsp: init<br>
06/10/11 17:58:21 drlm: context: init<br>
06/10/11 17:58:21 drlm: Loading Spring root WebApplicationContext<br>
06/10/11 17:58:52 drlm: Error initializing servlet<br>
org.springframework.beans.factory.BeanDefinitionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/drlm-servlet.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:77)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:405)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:357)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)<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.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:123)<br>
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:91)<br>
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:294)<br>
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)<br>
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)<br>
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)<br>
at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)<br>
at javax.servlet.GenericServlet.init(GenericServlet.java:258)<br>
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2354)<br>
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4795)<br>
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)<br>
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)<br>
at com.evermind.server.http.HttpApplication.&lt;init&gt;(HttpApplication.java:549)<br>
at com.evermind.server.Application.getHttpApplication(Application.java:890)<br>
at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)<br>
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)<br>
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)<br>
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)<br>
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)<br>
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)<br>
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)<br>
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)<br>
at java.lang.Thread.run(Thread.java:534)<br>
06/10/11 17:58:52 drlm: Error preloading servlet<br>
javax.servlet.ServletException: Error initializing servlet<br>
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4846)<br>
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)<br>
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)<br>
at com.evermind.server.http.HttpApplication.&lt;init&gt;(HttpApplication.java:549)<br>
at com.evermind.server.Application.getHttpApplication(Application.java:890)<br>
at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)<br>
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)<br>
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)<br>
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)<br>
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)<br>
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)<br>
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)<br>
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)<br>
at java.lang.Thread.run(Thread.java:534)<br>
06/10/11 17:58:52 drlm: drlm: init<br>
06/10/11 17:58:52 drlm: Loading WebApplicationContext for Spring FrameworkServlet 'drlm'<br>
06/10/11 17:58:52 drlm: Error initializing servlet<br>
org.springframework.beans.factory.BeanDefinitionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/drlm-servlet.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:77)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:405)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:357)<br>
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)<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.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:123)<br>
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:91)<br>
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:94)<br>
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:294)<br>
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)<br>
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)<br>
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)<br>
at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:83)<br>
at javax.servlet.GenericServlet.init(GenericServlet.java:258)<br>
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2354)<br>
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4795)<br>
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)<br>
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)<br>
at com.evermind.server.http.HttpApplication.&lt;init&gt;(HttpApplication.java:549)<br>
at com.evermind.server.Application.getHttpApplication(Application.java:890)<br>
at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)<br>
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)<br>
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)<br>
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)<br>
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)<br>
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)<br>
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)<br>
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)<br>
at java.lang.Thread.run(Thread.java:534)<br>
06/10/11 17:58:52 drlm: Error preloading servlet<br>
javax.servlet.ServletException: Error initializing servlet<br>
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4846)<br>
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)<br>
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)<br>
at com.evermind.server.http.HttpApplication.&lt;init&gt;(HttpApplication.java:549)<br>
at com.evermind.server.Application.getHttpApplication(Application.java:890)<br>
at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)<br>
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)<br>
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)<br>
at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)<br>
at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)<br>
at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)<br>
at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)<br>
at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)<br>
at java.lang.Thread.run(Thread.java:534)<br>
06/10/11 17:58:52 drlm: dwr-invoker: init<br>
06/10/11 17:58:53 drlm: Started</p>
<p dir="auto">drlm-servlet.xml file:</p>
<hr>
<p dir="auto">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</p>
<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:flow="<a href="http://www.springframework.org/schema/webflow-config" rel="nofollow">http://www.springframework.org/schema/webflow-config</a>"<br>
xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans" rel="nofollow">http://www.springframework.org/schema/beans</a><br>
<a href="http://www.springframework.org/schema/beans/spring-beans-2.0.xsd" rel="nofollow">http://www.springframework.org/schema/beans/spring-beans-2.0.xsd</a><br>
<a href="http://www.springframework.org/schema/webflow-config" rel="nofollow">http://www.springframework.org/schema/webflow-config</a><br>
<a href="http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd%22%3E" rel="nofollow">http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd"&gt;</a></p>
<p dir="auto">&lt;!--</p>
<ul dir="auto">
<li>
<p dir="auto">DispatcherServlet application context for Device Registration and Listing Application web tier.<br>
--&gt;</p>


uk.ltd.getahead.dwr.DWRServlet
dwr-invoker
 true







		
		 
 

flowController
				  drlmMainMenuController                                 


    

	



	
	


<p dir="auto">&lt;flow:executor id="flowExecutor" registry-ref="flowRegistry" repository-type="continuation"/&gt;</p>

<p dir="auto">&lt;flow:registry id="flowRegistry"&gt;<br>
&lt;flow:location path="file:html/WEB-INF/flows/**/*-flow.xml"/&gt;<br>
&lt;/flow:registry&gt;</p>




	
	
	



	
</li>
</ul>
<p dir="auto">&lt;/beans&gt;</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.0 final</p>