While working with spring framework in eclipse, sometimes suddenly xmls fail to validate by throwing following marker error in eclipse.
Multiple markers at this line
- cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element
'context:component-scan'.
- schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring-
context.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the
document is not <xsd:schema>.
It could be a problem that spring jars are not accessible in the class path or different version of spring xsd files are cached in eclipse.
More frequently if you go offline, then eclipse starts showing this error(Eventhough if you connect to internet again). You can get rid off this error by clearing cached xsd templates and re-validating them.
Go to eclipse preferences, search for 'cache'(Generally it is under Network Connections), select all xsd files and remove them. After removing xsd files revalidate xmls files.
No comments:
Post a Comment