users@jersey.java.net

[Jersey] Re: Beginner problem with ServletContext

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 2 Dec 2010 15:11:32 +0100

On Dec 2, 2010, at 2:32 PM, balistick_at_gmail.com wrote:

> Thanks for the answer Paul. I've modified my pom file by adding the
> grizzly dependency and removing the inmemory one. However, i still
> can't run my test in the IDE, as the servlet context is not injected
> in
> my variable :/ The code runs fine if i deploy it to jetty server.
>
> @Context ServletContext myContext is null at the runtime.
>
> I think i mess up with the WebAppDescriptor builder :
>
> public myProcessorTest() throws Exception{
> super(new WebAppDescriptor.Builder("com.domain").build());
> }
>
> Maybe someone can give me clues on what's wrong here !
>

Hard to say without being able to run your maven project.

Can you try downloading the following and modify:

   http://download.java.net/maven/2/com/sun/jersey/samples/helloworld-webapp/1.4/helloworld-webapp-1.4-project.zip

and test.

Paul.