Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoConfig not finding all resources in package #42

Open
flavor8 opened this issue Dec 17, 2014 · 7 comments
Open

AutoConfig not finding all resources in package #42

flavor8 opened this issue Dec 17, 2014 · 7 comments

Comments

@flavor8
Copy link

flavor8 commented Dec 17, 2014

I have 7 resources in a particular package, all of which are annotated with import javax.ws.rs.Path;

Two of the resources are not being picked up by AutoConfig. With my debugger active on the addResources method in AutoConfig, I can see that the Reflections library completely misses them, but I don't know why.

@dirkraft
Copy link

I am having a similar problem. Are you also on Java8 and dropwizard/dropwizard-guice 0.8.0?

@dirkraft
Copy link

Well this seems to work so far at least for picking up @Path-annotated resources. Not sure yet if something else will fall out.

    @Override
    public void run(MyConfiguration configuration, Environment environment) throws Exception {
        environment.jersey().packages(getClass().getPackage().getName());
    }

For the record, my versions

    compile 'io.dropwizard:dropwizard-core:0.8.0'
    compile 'com.hubspot.dropwizard:dropwizard-guice:0.8.0'

and I'm on java8.

@jhaber
Copy link
Member

jhaber commented Mar 21, 2015

We're on the latest version of Reflections, I'll try to see if it's a Java 8 incompatibility

@jhaber
Copy link
Member

jhaber commented May 1, 2015

We've been seeing this issue intermittently as well, we're testing with Javassist 3.19.0-GA now to see if it fixes the issue by any chance

@eyce9000
Copy link

I get this issue with java 8 if any of the methods in the resource contain short-hand lambda expressions.

@jhaber
Copy link
Member

jhaber commented Jun 2, 2016

3.19.0-GA didn't do the trick, but maybe 3.20.0-GA will. (The fact that it affects classes with lambdas suggests it's a Javassist issue)

@t0tec
Copy link

t0tec commented Sep 10, 2016

I have an issue with this also (version 1.0.0).
Problem with registering filters (dropwizard-example in DateNotSpecifiedFilter) with the use of @Provider annotation.

and tasks don't get automatically added. Somehow still need to do the following:
environment.admin().addTask(guiceBundle.getInjector().getInstance(EchoTask.class));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants