Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Force GuiceServiceLocatorGenerator to be the only ServiceLocatorGenerator #39

Closed
wants to merge 7 commits into from

Conversation

FranOis
Copy link

@FranOis FranOis commented Sep 7, 2016

Even if it wasn't initialized with install, it should create a GuiceServiceLocatorGenerator, which solves the race condition mentioned in the README.md.

Also made it optional to bind things on to GuiceServlet scopes so that even if you are not using GuiceServlets and only want to link Guice to HK2 it still works.

@AlexITC
Copy link

AlexITC commented Dec 26, 2016

@rkapsi have you ever checked this pull request?

@@ -57,6 +57,10 @@ public static void main(String[] args) {

```

#### META-INF

To ensure Jersey/HK2 SPIs will use the proper ServiceLocationGenerator, simply copy the META-INF folder into your root project's resources folder.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this is fair enough but how is it different from adding jersey2-guice-spi to the classpath. Both are subject to classpath ordering.

@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pom file contains some (possibly) private information.

@jhaber
Copy link

jhaber commented Jan 24, 2017

Any chance of getting a release with these changes soon? The change I'm mainly looking for is here. Without this change, an IllegalStateException is thrown any time a Jersey class is used before a jersey2-guice app is started up. This includes Jersey client, URI builder, and lots of other classes that don't need a running jersey2-guice app to work. This mainly causes issues with tests and has been reported by a bunch of people here

@FranOis FranOis closed this Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants