Comments (4)
@xinranxiao yea it seems something is initializing Jersey before you do. Are you initializing jersey2-guice straight from the main()
method or as early as possible and definitively before DW which will trip Jersey.
Secondly I'd look at the classpath and the order in which JARs are being loaded. The jersey2-guice-spi JAR is purposely called 0-jersey2-guice-spi
to move it to the front (but there may be no guarantee). But this is optional and it should work if initialization happens in the main()
method.
from jersey2-guice.
Came here from dropwizard-guice - also encountering what looks like the same issue.
I'm seeing:
WARN [2017-09-21 16:41:23,236] com.squarespace.jersey2.guice.JerseyGuiceUtils: It appears jersey2-guice-spi is either not present or in conflict with some other Jar: ServiceLocatorGeneratorImpl(hk2-locator, 832648870) Exception in thread "main" java.lang.LinkageError: loader (instance of sun/misc/Launcher$AppClassLoader): attempted duplicate class definition for name: "org/glassfish/hk2/api/ServiceLocatorState" at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.jvnet.hk2.internal.ServiceLocatorImpl.<init>(ServiceLocatorImpl.java:207) at com.squarespace.jersey2.guice.GuiceServiceLocator.<init>(GuiceServiceLocator.java:29) at com.squarespace.jersey2.guice.JerseyGuiceUtils.newServiceLocator(JerseyGuiceUtils.java:248) at com.squarespace.jersey2.guice.JerseyGuiceUtils.newServiceLocator(JerseyGuiceUtils.java:227) at com.squarespace.jersey2.guice.JerseyGuiceUtils.newServiceLocator(JerseyGuiceUtils.java:220) at com.hubspot.dropwizard.guice.GuiceBundle.initialize(GuiceBundle.java:126)
from jersey2-guice.
This issue hasn't seen a real update for over 2 years. Is this project currently dead/inactive? I'm seeing the same issue when trying to using dropwizard-guice and swagger2.0. Both use this automated way of discovering resources.
from jersey2-guice.
Hello, the project is currently inactive. We don't have any Jersey 2 w/ Guice projects.
from jersey2-guice.
Related Issues (20)
- base path HOT 3
- Getting a ServletContext HOT 3
- AOP requires registration in two places HOT 4
- JerseyGuiceServletContextListener uses constructor to Initialize injector HOT 1
- Custom scopes are not mapped to hk2 scopes HOT 4
- @Qualifier / @BindingAnnotation annotated dependencies are not being injected into hk2 created services
- How to get custom @Context injections? HOT 1
- 0.8 relies on guice 4.0-SNAPSHOT HOT 5
- Guice scope annotations are ignored HOT 1
- jersey2-guice, Jersey 2.16 and uber-jar HOT 2
- Error injecting constructor, java.lang.IllegalStateException HOT 2
- java.lang.IllegalStateException: ServiceLocatorImpl(GuiceServiceLocator-9,8,1066656936) has been shut down HOT 10
- Lazily construct the Injector in JerseyGuiceServletContextListener so that modules can be added at runtime HOT 1
- Guice binding annotations not working HOT 10
- Guice type conversions for constant bindings don't work for primitive types HOT 2
- java.lang.IllegalStateException: java.lang.NoSuchFieldException: defaultGenerator HOT 1
- Does not work with embedded jetty HOT 4
- OSGi manifest
- Jersey 2.26 compatibility HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jersey2-guice.