2
错误运行时,可以发现:没有声明可以为元素的构造函数,ARG“
Caused by: org.xml.sax.SAXParseException; lineNumber: 34; columnNumber: 30; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'constructor-arg'.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
来源:
<spring:bean id="HandlerA_id" name="HandlerA" class="Handler">
<constructor-arg>
<ref bean="BeanA"></ref>
</constructor-arg>
</spring:bean>
编辑器可识别的构造带参数的标签,并给出在总结滚下。 在配置文件中,XSI:的schemaLocation值包含(其中包括):
"...http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd..."
如果检查通过该网址XSD,你可以看到,构造带参数的标签有效期为组beanElements这是一个'bean'中允许的复杂类型
在某些情况下,运行时未正确验证XML吗?
Doh!...当然!谢谢 :) – Rondo