New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atmosphere in Dropwizard: Unable to use Dropwizard-Testing #1868

Closed
phxql opened this Issue Feb 20, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@phxql
Copy link

phxql commented Feb 20, 2015

Hi,

when combining Dropwizard with Atmosphere-Jersey, Dropwizard-Testing will break when using the ResourceTestRule.

I get the following error messages:

ERROR [2015-02-20 16:08:06,098] com.sun.jersey.spi.inject.Errors: The following errors and warnings have been detected with resource and/or provider classes:
  SEVERE: Missing dependency for field: javax.servlet.http.HttpServletRequest org.atmosphere.jersey.BaseInjectableProvider.req
  SEVERE: Missing dependency for field: javax.servlet.http.HttpServletRequest org.atmosphere.jersey.BaseInjectableProvider.req
  SEVERE: Missing dependency for field: javax.servlet.http.HttpServletRequest org.atmosphere.jersey.AtmosphereProviders$BroadcasterProvider.req
  SEVERE: Missing dependency for field: javax.servlet.http.HttpServletRequest org.atmosphere.jersey.BaseInjectableProvider.req
  SEVERE: Missing dependency for field: javax.servlet.http.HttpServletRequest org.atmosphere.jersey.BaseInjectableProvider.req
  SEVERE: Missing dependency for field: protected javax.servlet.http.HttpServletRequest org.atmosphere.jersey.AtmosphereFilter.servletReq
  SEVERE: Missing dependency for field: javax.servlet.http.HttpServletRequest org.atmosphere.jersey.BaseInjectableProvider.req
  SEVERE: Missing dependency for field: javax.servlet.http.HttpServletRequest org.atmosphere.jersey.BaseInjectableProvider.req

com.sun.jersey.spi.inject.Errors$ErrorMessagesException
    at com.sun.jersey.spi.inject.Errors.processErrorMessages(Errors.java:170)
    at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
    at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:199)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)
    at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790)
    at com.sun.jersey.test.framework.spi.container.inmemory.InMemoryTestContainerFactory$InMemoryTestContainer.start(InMemoryTestContainerFactory.java:165)
    at com.sun.jersey.test.framework.JerseyTest.setUp(JerseyTest.java:310)
    at io.dropwizard.testing.junit.ResourceTestRule$1.evaluate(ResourceTestRule.java:149)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

I assume Jersey tries to load the Atmosphere Jersey providers and fails. Is there a way to disable that behaviour?

@phxql

This comment has been minimized.

Copy link

phxql commented Feb 20, 2015

If i remove atmosphere-jersey from classpath and use atmosphere-runtime instead, the error disappears. It is enough to have the atmosphere-jersey on the classpath to provoke that error.

@jfarcand

This comment has been minimized.

Copy link
Member

jfarcand commented Feb 20, 2015

@phxql Well, this is not a bug in Atmosphere but with the integration of Atmosphere with DropWizard. File the bug there :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment