application_context.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:context="http://www.springframework.org/schema/context"
xmlns:aws-context="http://www.springframework.org/schema/aws/cloud/context"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/cloud/aws/context
http://www.springframework.org/schema/cloud/aws/spring-cloud-aws-context.xsd">
<aws-context:context-region region="us-west-2"/>
<aws-context:context-resource-loader/>
....</beans>
编译后,我得到了:
nested exception is org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 53; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'aws-context:context-region'.
有人可以帮助我解决这个问题吗?谢谢
答案 0 :(得分:1)
更改自:
http://www.springframework.org/schema/cloud/aws/spring-cloud-aws-context.xsd
收件人:
http://www.springframework.org/schema/cloud/spring-cloud-aws-context.xsd
,但是您可以在测试之前检查所有schemaLocations链接是否返回200 ok。如果是404,则可以在http://www.springframework.org/schema/cloud/
下单独找到它们答案 1 :(得分:0)
测试此代码
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aws-context="http://www.springframework.org/schema/cloud/aws/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cloud/aws/context
http://www.springframework.org/schema/cloud/aws/context/spring-cloud-aws-context-1.0.xsd">
<aws-context:context-region region="us-west-2" />
<aws-context:context-credentials>
<aws-context:simple-credentials access-key="XXXXX" secret-key="XXXXXXX" />
<aws-context:context-resource-loader />
</beans>
答案 2 :(得分:0)
我从春季人们那里得到了答案。他们停止维护该文件,并使用schmea.handler。参见https://github.com/spring-cloud/spring-cloud-aws/blob/master/spring-cloud-aws-context/src/main/resources/META-INF/spring.handlers