не найдено объявлений для элемента 'aws-context: context-region' - PullRequest
0 голосов
/ 17 января 2019

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'.

Может кто-нибудь помочь мне с этой проблемой? Спасибо

Ответы [ 3 ]

0 голосов
/ 17 января 2019

Изменение с:

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 в порядке, перед тестированием. В случае 404 вы можете найти их индивидуально в http://www.springframework.org/schema/cloud/

0 голосов
/ 19 февраля 2019

Я получил ответ от Весенних людей. Они перестали поддерживать это, и они используют schmea.handler. Смотри https://github.com/spring-cloud/spring-cloud-aws/blob/master/spring-cloud-aws-context/src/main/resources/META-INF/spring.handlers

0 голосов
/ 17 января 2019

Проверьте этот код

<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>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...