java - root-context.xml] 无效;嵌套异常是 org.xml.sax.SAXParseException;cvc-elt.1:找不到元素“beans”的声明
问题描述
我在多个问题中看到了同样的错误,并尝试了每个解决方案。似乎没有任何效果。我修剪了错误以便更容易粘贴错误在第 7 行的引用。这是我的xml代码。TIA EDIT 我添加了调用 root-context.xml 的代码
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-app_2_5.xsd"
version="2.5">
<display-name>Subject</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/root-context.xml</param-value>
</context-param>
</web-app>
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemLocation="
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
<beans:import resource="security-context.xml" />
<beans:bean id="subjectProps"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<beans:property name="locations">
<beans:list>
<beans:value>WEB-INF/spring/subject.properties</beans:value>
<beans:value>WEB-INF/spring/subject_sql.properties</beans:value>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="subjectUtilProperites"
class="main.java.mil.serena.subject.common.SubjectProperties">
<beans:property name="properties" ref="subjectProps"/>
</beans:bean>
<beans:bean id="publicationUtilProperties"
class="main.java.mil.serena.web.common.properties.SubPubProperties">
<beans:property name="properties" ref="subjectProps"/>
</beans:bean>
</beans>
解决方案
改变
xsi:schemLocation="
至
xsi:schemaLocation="
^
推荐阅读
- angular - 你如何解决“属性''不存在类型'typeof import”错误?
- statistics - SAS 循环用于测试 PROC MIXED 中的协方差结构并保存/附加输出
- android - 从 jacoco 报告中排除数据绑定包
- wordpress - 与用户关联的 ACF img 的 update_field 存在问题
- msbuild - 参数值中的 msbuild 任务条件运算符
- java - 如何在 Java 下将 for 循环转换为流?
- reactjs - 如何将底部导航与从另一个按钮 MUI 更改的路线同步?
- typescript - 在 createTheme 中自定义 MuiDataGrid 时修复 Typescript 错误
- java - JTextField 根据最大输入宽度,计算字符串宽度
- javascript - 通过设置 timeStabilizer 函数使用 Javascript 触发同步的 CSS 动画