Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.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
Java 自动连线=“自动连线”;“自动检测”;它的性质在春天可能吗?_Java_Spring - Fatal编程技术网

Java 自动连线=“自动连线”;“自动检测”;它的性质在春天可能吗?

Java 自动连线=“自动连线”;“自动检测”;它的性质在春天可能吗?,java,spring,Java,Spring,请帮我解决这个问题。我在spring中配置了autowire=“autodetect”。我想使用它,但出现此错误 cvc枚举有效:值“autodetect”对于枚举“[默认值,否,按名称,按类型,构造函数]”无效。它必须是枚举中的值 罪魁祸首是: xsi:schemaLocation=”http://www.springframework.org/schema/beans " 当与2.5和2.0架构一起使用时,将应用自动检测功能。它已从3.0版被弃用+ 尝试: 希望这有帮助。我想使用aut

请帮我解决这个问题。我在spring中配置了autowire=“autodetect”。我想使用它,但出现此错误 cvc枚举有效:值“autodetect”对于枚举“[默认值,否,按名称,按类型,构造函数]”无效。它必须是枚举中的值


罪魁祸首是:

xsi:schemaLocation=”http://www.springframework.org/schema/beans "

当与2.5和2.0架构一起使用时,将应用自动检测功能。它已从3.0版被弃用+

尝试:



希望这有帮助。

我想使用autowire=“autodetect”属性,但我遇到了这样的错误,比如什么?请在问题中添加stacktrace。我在控制台“cvc枚举有效:值'autodetect'对于枚举'[default,no,byName,byType,constructor]'无效。它必须是枚举中的值。”不,正如错误告诉您的,没有此类可用的
autodect
属性。你怎么会认为有?你期望它做什么?我是学生,我正在学习它,所以我使用这个小配置,你能建议我做什么吗?autowire=“autodetect”属性在spring中不允许?谢谢你谢谢你的回复和帮助,我有点困惑,现在在spring 4.2中,我们不能使用autowire=“autodetect”,那么我们使用什么呢?一种方法是使用@Autowired。尽管我通常不在xmls中指定模式,并且总是倾向于使用默认版本。我认为至少在4.2中使用2.5模式应该没有问题。非常感谢您给我时间,并建议我希望我能尽快得到
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">

<bean  id="circle" class="com.Circle_Constructor" autowire="autodetect" ></bean>    
<bean class="com.Point" id="point">
    <property name="x" value="0"></property>
    <property name="y" value="0"></property>
</bean>

</beans>
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

 <bean  id="circle" class="com.Circle_Constructor" autowire="autodetect" >    </bean>    
 <bean class="com.Point" id="point">
    <property name="x" value="0"></property>
    <property name="y" value="0"></property>
 </bean>

 </beans>