question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compatiblity with Dropwizard 1.0?

See original GitHub issue

I’m trying to upgrade to Dropwizard 1.0 and I’m getting a failure running a unit test (haven’t tried production yet since I’m fixing the tests first).

I filed it in the Dropwizard product and the fellow there says it looks like an incompatibility in libraries with the Guice module used by dropwizard-guice. Specifically he says “This looks like an incompatibility between HK2 (used by Jersey) and Google Guice which shows by including the dropwizard-guice module.”

Is dropwizard-guice supposed to work with Dropwizard 1.0 or is that still in the works?

Here’s the exception trace I get:

java.lang.IllegalStateException: It appears there is no ServiceLocatorGenerator installed.
                at com.squarespace.jersey2.guice.GuiceServiceLocatorGeneratorStub.create(GuiceServiceLocatorGeneratorStub.java:50)
                at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.internalCreate(ServiceLocatorFactoryImpl.java:312)
                at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.create(ServiceLocatorFactoryImpl.java:293)
                at org.glassfish.jersey.internal.inject.Injections._createLocator(Injections.java:138)
                at org.glassfish.jersey.internal.inject.Injections.createLocator(Injections.java:109)
                at org.glassfish.jersey.internal.RuntimeDelegateImpl.<init>(RuntimeDelegateImpl.java:63)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
                at java.lang.Class.newInstance(Class.java:442)
                at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:118)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:27 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
jhabercommented, Jan 24, 2017

I’ll be following up with jersey2-guice maintainers to see if we can get this fixed on their end. In the meantime you should be able to work around this by adding something like this to your tests:

@BeforeClass
public void ensureServiceLocatorPopulated() {
  JerseyGuiceUtils.reset();
}
6reactions
AndreiNefyodovcommented, Nov 7, 2016

+1 to find a solution to this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Release Notes — Dropwizard
Gzipped content encoded requests and responses are compatible with Servlet 3.1 and Async IO (#2566). Retired use of deprecated Apache StrSubstitutor and ...
Read more >
Releases · dropwizard/dropwizard - GitHub
A damn simple library for building production-ready RESTful web services. - Releases · dropwizard/dropwizard.
Read more >
Version history - Dropwizard-guicey - GitHub Pages
Update dropwizard to 2.1.1 (fixes java 8 issue by allowing afterburner usage); Fix classpath scan ... Update to dropwizard 1.0.5 and fix compatibility...
Read more >
Getting Started - Dropwizard
If you have any questions about how Maven works, Maven: The Complete Reference should have ... [INFO] Including javax.validation:validation-api:jar:1.0.0.
Read more >
Hibernate vs. JPA (hibernate-5.x deprecation warnings after ...
So far I've only published releases compatible with Dropwizard 0.9.0 - 0.9.3. I'd like to get some feedback on the project before releasing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found