Announcement Announcement Module
Collapse
No announcement yet.
Scan refresh not matching inside a particular jar for annotation filter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Scan refresh not matching inside a particular jar for annotation filter

    Using Spring 3.1

    Trying find all classes via the ClassPathBeanDefinitionScanner with the following annotation:
    javax.ws.rs.ext.Provider.class

    Using an include filter. If i scan for classes that are in a JAR file that I created and published to the local repo I get no hits. If I scan on "org.jboss.resteasy" I get lots of hits. Something goes nuts in the findAllClassPathResources method of the PathMatchingResourcePatternResolver class:
    Enumeration resourceUrls = getClassLoader().getResources(path);

    The path matcher should be the AntPathMatcher class but the doMatch method never gets called. So I am at a loss as how to keeping debugging. Idea?

    Lets say I search on "abc.is.a.package" which is only in JAR "abc.specific" and get nothing. But if I search on "abc.is" which is in JAR "abc.specific" and "abc.commons" then I get hits on the "abc.commons" JAR. Visible in logs:
    .PathMatchingResourcePatternResolver:466) - Looking for matching resources in jar file.....

    Somehow the "abc.specific" just won't be searched. Even if it contains "abc.is.*" packages.

  • #2
    Add directory entries (Eclipse)

    Found the following which solved my problem:
    http://stackoverflow.com/questions/4...dependent-jars

    It is an Eclipse setting that I didn't know about. Might be general knowledge ;-) but it ate up about 4 hours of my day.

    Comment

    Working...
    X