Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 将web应用导入Eclipse时出现applicationContext.xml错误_Spring_Maven_Spring Mvc - Fatal编程技术网

Spring 将web应用导入Eclipse时出现applicationContext.xml错误

Spring 将web应用导入Eclipse时出现applicationContext.xml错误,spring,maven,spring-mvc,Spring,Maven,Spring Mvc,我有一个带有applicationContext.xml的maven web应用程序,它报告以下错误: 在此行找到多个批注: -cvc复杂类型.2.3:元素“bean”不能有字符[子项],因为该类型的内容类型仅为元素 XML的主体是: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3

我有一个带有applicationContext.xml的maven web应用程序,它报告以下错误:

在此行找到多个批注: -cvc复杂类型.2.3:元素“bean”不能有字符[子项],因为该类型的内容类型仅为元素

XML的主体是:

<?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:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans.xsd
  http://www.springframework.org/schema/tx
  http://www.springframework.org/schema/tx/spring-tx.xsd
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context-2.5.xsd">

  ${build.system.jobscheduler}
</beans>

${build.system.jobscheduler}
删除${build.system.jobscheduler}时,错误消失。这在web/pom.xml中声明为:

<build.system.jobscheduler><![CDATA[<!-- No job scheduler -->]]></build.system.jobscheduler>
]>

有什么想法吗?

发生错误的原因是xml架构:

不允许在
元素中使用此类表达式

我不知道${build.system.jobscheduler}的内容

如果是类名,您可以尝试以下操作:

<beans>
   <bean id="jobschedulerHolder" class="myapp.JobSchedulerHolder">
   <property name="jobschedulerClassName" value="${build.system.jobscheduler}" />
</beans>

如果有作业调度器,将用什么字符串代替变量。