У меня много проблем один за другим.Позвольте мне записать это правильно -
Я реализую кэш Springframework, и это был мой оригинальный SpringCacheConfig.xml -
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:hz="http://www.hazelcast.com/schema/spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.hazelcast.com/schema/spring http://www.hazelcast.com/schema/spring/hazelcast-spring.xsd">
Это нормально работало на моем ноутбуке, но на тестовой ВМ,мы не смогли загрузить файлы схемы XSD из Интернета.
Поэтому я изменил расположение схемы на classpath -
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cache="http://www.springframework.org/schema/cache"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:hz="http://www.hazelcast.com/schema/spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:spring-beans.xsd
http://www.springframework.org/schema/cache classpath:spring-cache.xsd
http://www.springframework.org/schema/context classpath:spring-context.xsd
http://www.hazelcast.com/schema/spring classpath:hazelcast-spring.xsd">
Итак, теперь файлы XSD были подобраны.Но загруженный файл spring-context.xsd имеет следующее содержимое -
<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="https://www.springframework.org/schema/beans/spring-beans-4.3.xsd"/>
<xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="https://www.springframework.org/schema/tool/spring-tool-4.3.xsd"/>
Поэтому я снова переместил их в classpath.
После этих изменений, если я сейчас выполню наш код, яполучаю следующую ошибку -
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
Offending resource: class path resource [SpringCacheConfig.xml]
Я пытался решить эту проблему многими предыдущими постами, но не смог.
Пом уже включает банки, связанные с пружинным контекстом -
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${springframework.version}</version>
</dependency>
Эти банки не упакованы в основной сосуд, но доступны в модулях
/system/layers/thirdparty/org/springframework/main/spring-context-4.3.1.RELEASE.jar.
Но почему банку не удалось найти?
Я также попробовал плагин затенения, но все еще банки с зависимостями не включены - Как создать исполняемый jar на основе Spring с Maven?
Что еще мне следует подумать?
У меня нет файлов, связанных с META-INF / spring.handlers и т. Д. Spring, внутри jar.Может ли это быть проблемой?