When I activate the bean validator “XML Parsing Problems Rule,” I get project errors from Spring IDE: “Class is not assignable to [org.springframework.core.type.filter.TypeFilter]: com.acme.frob.ResourceFilter.”
This is what my ResourceFilter class looks like:
This is the portion of the XML that the error points to:Code:public class ResourceFilter implements TypeFilter { @Override public boolean match(MetadataReader metadataReader, MetadataReaderFactory metadataReaderFactory) throws IOException { AnnotationMetadata data = metadataReader.getAnnotationMetadata(); return data.hasAnnotation(Resource.class.getName()); } }
Clearly my ResouceFilter class implements Spring’s TypeFilter—the fact that it works at run-time should be enough evidence.Code:<context:component-scan base-package="com.acme.frob"> <context:include-filter expression="com.acme.frob.ResourceFilter" type="custom"/> </context:component-scan>
This looks like yet another problem with different classes from different class loaders.
In earlier versions of the Spring IDE I had a different error message, but I still cannot activate this “XML Parsing Problems Rule” stuff. Deactivating that option is the only work-around I am aware of.
Cheers
—Phil


Reply With Quote