1

I'm trying to find all methods annotated with a given annotation across a bunch of packages in a Jboss application.

Here's some code:

Reflections reflections = new Reflections(
            new ConfigurationBuilder().setUrls( 
                ClasspathHelper.forPackage("com.myCompany"))
                .setScanners(new MethodAnnotationsScanner()));

Set<Method> methods = reflections.getMethodsAnnotatedWith(MySpecialAnnotation.class);

When I run this in a jUnit test, I get 32 methods and everything is gravy. When I actually run the web application, however, it finds far fewer methods. Namely, it misses methods in the com.myCompany.stripes path, and I see numerous errors in my logs.

e.g.

2015-05-04 11:05:40,649 ERROR main [AbstractKernelController] Error installing to Real: name=vfszip:/Users/me/dev/jboss-5.1.0.GA/server/myCompany/deploy/product.ear/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error deploying: jboss.jacc:service=jacc,id="vfszip:/Users/me/dev/jboss-5.1.0.GA/server/myCompany/deploy/product.ear/tinymce.war/",parent="product.ear"
    at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
    at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:118)
etc...

What am I missing here? Any thoughts on how to fix this?

Chris
  • 1,231
  • 1
  • 17
  • 35
  • We dug into the Reflections package a bit, and found this: https://github.com/ronmamo/reflections/blob/2624a64346ccceb228c9927928c71714f921e014/src/test/java/org/reflections/VfsTest.java#L205 Thanks. – Chris May 04 '15 at 18:47

0 Answers0