-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
How to use guice beans #140
Comments
It looks like jetty (9.4.33) regression appeared with dropwizard 2.0.15. To fix this just update to 2.0.16 or 2.0.17 (which brings fixed jetty). For reference: Also, this is not guicey: guiceBundle = GuiceBundle.<KrylovMasterConfiguration>newBuilder()
.addModule(new ConfigModule())
.addModule(new ResourceModule())
.addModule(new CoreServiceModule())
.addModule(new AuthModule())
// .addModule(new CommonModule()) // Needed for workflow and workspace, do not remove
//.addModule(new ZookeeperClientModule()) //Needed for workflow and workspace, do not remove
.addModule(new DefaultServerModule())
.addModule(new DefaultWorkspaceModule())
.addModule(new ExtensionModule())
.addModule(new RateLimitModule())
//.enableAutoConfig(getClass().getPackage().getName()) // disable this to prevent accidental registration.
.setConfigClass(KrylovMasterConfiguration.class)
.build(); Most likely, you are using dropwizard-guice (or dropwizard-guicier) here |
@xvik I am working on a legacy system, it may be not that easy to upgrade the version, is there any other solution ? <dropwizard.version>1.3.5</dropwizard.version>
<dropwizard-guice.version>1.3.5.0</dropwizard-guice.version> |
I was trying to say that you're using a different library dropwizard-guice and not dropwizard-guicey (confusing names, I know). The library has been deprecated in favor of dropwizard-guicier, which is also seems to be abandoned now, but anyway it may fit your current needs. Or you can migrate to dropwizard-guicey (version 4.2.2 will work for dropwizard 1.3). The configuration above would change to: guiceBundle = GuiceBundle.builder()
.modules(
new ConfigModule(),
new ResourceModule(),
new CoreServiceModule(),
new AuthModule(),
//new CommonModule(), // Needed for workflow and workspace, do not remove
//new ZookeeperClientModule(), //Needed for workflow and workspace, do not remove
new DefaultServerModule(),
new DefaultWorkspaceModule(),
new ExtensionModule(),
new RateLimitModule())
//.enableAutoConfig(getClass().getPackage().getName()) // disable this to prevent accidental registration.
.build(); But it would be better to enable auto-configuration so guicey could register extensions for you. This guicey version can't register them directly from guice declarations (feature available only in newer versions). |
seems if i added guice bundle in my application, i cannot use
DynamicFeature
correctlymokies/ratelimitj#48
The text was updated successfully, but these errors were encountered: