gpt4 book ai didi

java - 发现以 element-PropertyPlaceholderConfigurer 开头的无效内容

转载 作者:太空宇宙 更新时间:2023-11-04 06:51:42 25 4
gpt4 key购买 nike

当我向该属性添加多个位置时,出现以下错误。

cvc-complex-type.2.4.d:发现以元素“value”开头的无效内容。此时不需要子元素。

哪个模式因 max 发生而失败。?这个问题有什么解决办法吗?

xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">



<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>constants.properties</value>
<value>constants2.properties</value>
</property>
</bean>

在 Sotirios Delimanolis 修复后更正如下。

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>constants.properties</value>
<value>constants2.properties</value>
<value>file:${pathl}</value>
</list>
</property>
</bean>

知道为什么系统找不到 ${pathl} (系统找不到指定的文件)。 {path1}是constants2.properties的属性。其中pathl=C\:Temp123.properties

最佳答案

您需要更改 locationlocations它需要一个数组。然后包裹value <array> 中的元素元素。

你应该有

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<array>
<value>constants.properties</value>
<value>constants2.properties</value>
</array>
</property>
</bean>

关于java - 发现以 element-PropertyPlaceholderConfigurer 开头的无效内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23233293/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com