GithubHelp home page GithubHelp logo

Comments (4)

rkapsi avatar rkapsi commented on June 18, 2024

@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.

tmwilder avatar tmwilder commented on June 18, 2024

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.

jessechahal avatar jessechahal commented on June 18, 2024

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.

rkapsi avatar rkapsi commented on June 18, 2024

Hello, the project is currently inactive. We don't have any Jersey 2 w/ Guice projects.

from jersey2-guice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.