Results 1 to 3 of 3

Thread: Spring IDE: Project Error With ‘component-scan’ and “XML Parsing Problems Rule”

  1. #1
    Join Date
    Mar 2009
    Location
    Hamburg, Germany
    Posts
    21

    Default Spring IDE: Project Error With ‘component-scan’ and “XML Parsing Problems Rule”

    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:

    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());
        }
    }
    This is the portion of the XML that the error points to:

    Code:
    <context:component-scan base-package="com.acme.frob">
        <context:include-filter expression="com.acme.frob.ResourceFilter" type="custom"/>
    </context:component-scan>
    Clearly my ResouceFilter class implements Spring’s TypeFilter—the fact that it works at run-time should be enough evidence.

    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

  2. #2
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    Phil,

    this has been fixed for the upcoming STS 2.2.0.RELEASE and Spring IDE 2.2.7.SR01 release which are being released early next week.

    Christian
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  3. #3
    Join Date
    Mar 2009
    Location
    Hamburg, Germany
    Posts
    21

    Default

    That's good news, Christian.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •