users@jersey.java.net

[Jersey] Re: _at_Context HttpServletRequest request is null

From: jeff saremi <jeffsaremi_at_hotmail.com>
Date: Tue, 15 Dec 2015 10:03:52 -0500

so far i have tried these two containers to no avail:

ResourceConfig theApp = new ApiApp(appParams);

HttpServer server = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, theApp);
SimpleServer server = SimpleContainerFactory.create(BASE_URI, theApp);



From: jeffsaremi_at_hotmail.com
To: users_at_jersey.java.net
Date: Mon, 14 Dec 2015 15:43:32 -0500
Subject: [Jersey] @Context HttpServletRequest request is null




From the printed stack trace i can see the nullpointeexception is throw on the following line:

String addr = request.getRemoteAddr();

which is the first line in my method:
    @Path("parse") @POST @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.TEXT_PLAIN) public String parse(String jsonInput, @Context HttpServletRequest request) {

How can it get the proper object?

thanksJeff