Dec 5th, 2011, 04:07 PM
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:
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.
Dec 7th, 2011, 07:24 AM
Add directory entries (Eclipse)
Found the following which solved my problem:
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.
Tags for this Thread