Unable to load spring 3 schemas

I am using Spring 3.0.5.RELEASE and today when creating a project with maven I get the following errors in the appicationContext.xml file:

- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-scan'. - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:annotation- config'. - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'tx:annotation- driven'. 

I tried to open the schema links:

but I always get the Forbidden page!

here, as I configure applicationContext.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:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

Please advise how to fix this error.

+2
source share
2 answers

It seems that public schemas are no longer available, so I load the schemas from the jars in the classpath as follows:

 <?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:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xsi:schemaLocation=" http://www.springframework.org/schema/beans classpath:/org/springframework/beans/factory/xml/spring-beans-3.0.xsd http://www.springframework.org/schema/tx classpath:/org/springframework/transaction/config/spring-tx-3.0.xsd http://www.springframework.org/schema/context classpath:/org/springframework/context/config/spring-context-3.0.xsd"> 
+6
source

You seem to have encountered this problem: Spring Beans Scheme is no longer available on the Internet? Are you explicitly defining schemaLocation ?

 <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:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/context/spring-context-3.0.xsd "> 
+4
source

Source: https://habr.com/ru/post/955408/


All Articles