J'ai mis à jour Dropwizard dans mon projet et mon problème en cours d'exécution de tests unitaires, bien que le démarrage du service fonctionne correctement et que toutes les API se comportent normalement. mes versions:Aucun ServiceLocatorGenerator installé Erreur lors de l'exécution de tests dans Dropwizard
Dropwizard: 1.1.0
Jersey: 2.25.1
Guice: 4.1.0
hk2-api: 2.5.0-b36
hk2-utils: 2.5.0-b36
javax.ws.rs-api : 2.1-m05
ci-dessous est l'erreur quand je suis en cours d'exécution "test mvn"
java.lang.RuntimeException: java.lang.ClassNotFoundException: Provider org.glassfish.jersey.internal.RuntimeDelegateImpl could not be instantiated: java.lang.IllegalStateException: It appears there is no ServiceLocatorGenerator installed.
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:153)
at javax.ws.rs.ext.RuntimeDelegate.getInstance(RuntimeDelegate.java:121)
at javax.ws.rs.core.Response$ResponseBuilder.newInstance(Response.java:848)
at javax.ws.rs.core.Response.status(Response.java:590)
at javax.ws.rs.core.Response.status(Response.java:601)
at javax.ws.rs.core.Response.ok(Response.java:622)
...... ** some more lines here **
Caused by: java.lang.ClassNotFoundException: Provider org.glassfish.jersey.internal.RuntimeDelegateImpl could not be instantiated: java.lang.IllegalStateException: It appears there is no ServiceLocatorGenerator installed.
at javax.ws.rs.ext.FactoryFinder.newInstance(FactoryFinder.java:123)
at javax.ws.rs.ext.FactoryFinder.find(FactoryFinder.java:226)
at javax.ws.rs.ext.RuntimeDelegate.findDelegate(RuntimeDelegate.java:137)
https://github.com/dropwizard/dropwizard/issues/1772 et https://github.com/HubSpot/dropwizard-guice/issues/95 - Cela ressemble à un problème d'intégration de dépendances. – zloster
En fait, une requête pull est en attente au projet 'jersey2-guice' qui devrait résoudre le problème. Voir ce commentaire: https://github.com/Squarespace/jersey2-guice/pull/39#issuecomment-274853295 – zloster