users@jersey.java.net

[Jersey] Re: Missing dependency error in jersey 1.12 grizzly server

From: Guilhem <guilhem.legal_at_geomatys.fr>
Date: Mon, 26 Mar 2012 14:06:42 +0200

Alright, that's done :

http://java.net/jira/browse/JERSEY-1047

I don't know if i correctly fill all the fields.

Guilhem Legal

Le 26/03/2012 13:45, Pavel Bucek a écrit :
> I download the helloworld samples from :
>
> https://maven.java.net/content/repositories/releases/com/sun/jersey/samples/helloworld/1.12/
>
>
> Add the maven dependency to : jersey-grizzly2-servlet
>
> And add an injected field to the HelloWorld resource :
>
> @Context
> private ServletContext context;
>
>
> I get this error when i'll try to run :
>
> INFO: Initiating Jersey application, version 'Jersey: 1.12 02/15/2012
> 04:51 PM'
> 20 mars 2012 10:09:57 com.sun.jersey.spi.inject.Errors
> processErrorMessages
> GRAVE: The following errors and warnings have been detected with
> resource and/or provider classes:
> SEVERE: Missing dependency for field: private
> javax.servlet.ServletContext
> com.sun.jersey.samples.helloworld.resources.HelloWorldResource.context
> Exception in thread "main"
> 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:773)
> at
> com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:172)
> at
> com.sun.jersey.api.container.ContainerFactory.createContainer(ContainerFactory.java:134)
> at
> com.sun.jersey.api.container.grizzly2.GrizzlyServerFactory.createHttpServer(GrizzlyServerFactory.java:242)
> at com.sun.jersey.samples.helloworld.Main.startServer(Main.java:75)
> at com.sun.jersey.samples.helloworld.Main.main(Main.java:81)
>
>
> I see in the dependency graph that the jar org.glassfish.javax.servlet
> is included so the class "javax.servlet.ServletContext" shoule be found.