The matching wildcard is strict, but no declaration can be found for element 'context:component-scan
You have not specified the schema location of the context namespace, that is the reason for this specific error:
<beans .....
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
This path of the schema location is wrong:
http://www.springframework.org/schema/beans
The correct path should end with /
:
http://www.springframework.org/schema/beans/
I was having issues with
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'security:http'
and for me I had to add the spring-security-config jar to the classpath
http://docs.spring.io/spring-security/site/docs/3.1.x/reference/ns-config.html
EDIT:
It might be that you have the correct dependency in your pom.
But...
If you are using multiple spring dependencies and assembling into a single jar then the META-INF/spring.schemas
is probably being overwritten by the spring.schemas
of another of your spring dependencies.
(Extract that file from your assembled jar and you'll understand)
Spring schemas is just a bunch of lines that look like this:
http\://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
http\://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd
But if another dependency overwrites that file, then the definition will be retrieved from http, and if you have a firewall/proxy it will fail to get it.
One solution is to append spring.schemas and spring.handlers into a single file.
Check:
Idea to avoid that spring.handlers/spring.schemas get overwritten when merging multiple spring dependencies in a single jar