users@jersey.java.net

[Jersey] Re: Jersey 1.5 won't start

From: James Jones <jjones_at_whiteboardfederal.com>
Date: Tue, 25 Jan 2011 13:23:42 -0500

And just a little more information:

After debugging through my code line by line, I finally got to read
the message before it was output to the log in an unhelpful manner.
It was actually complaining about:
Missing dependency for constructor public myResource
(javax.rs.ws.core.UriInfo, javax.servlet.http.HttpServletRequest,
javax.ws.core.Response) at parameter index 2.


So, it does seem to be related to not doing the null injecting of
improper resolution.

My class is defined as:

@Path("/service")
@PerSession
@Produces("some output type")
public class MyResource extends MyBaseResource {

public MyResource(@Context UriInfo uriInfo, @Context
HttpServletRequest request, @Context Response response){
super(request);
}

So, it can't figure out the javax.rs.ws.core.Response dependency?

As I mentioned before, I'm brand new to Jersey, so I apologize in
advance for having no clue as to what the proper protocol should be
(I've been grepping through the jersey-samples trying to find similar
apps and instances up until now).

Thanks again for the help!

P.S. I also reviewed this thread:
http://jersey.576304.n2.nabble.com/Missing-dependency-for-constructor-td5394116.html
but didn't find it of any assistance, but at least got more background
on the dependency injection changes.
}

On 1/25/11, jjones_at_whiteboardfederal.com <jjones_at_whiteboardfederal.com> wrote:
> The error message is more or less as I typed it:
>
>
> (When i'm preloading the app)
>
> Servlet Jersey Web Application Failed to preload on startup in Web
> application: "something.war".
> com.sun.jersey.spi.inject.Errors$ErrorMessagesException
> at
> com.sun.jersey.spi.inject.Errors.processErrorMesssages(Errors.java:170)
> at com.sun.jersey.spi.inject.Errors.postProcess(Errors.java:136)
> at
> com.sun.jersey.spi.inject.Errors.processErrorMesssages(Errors.java:199)
> at com.sub.jersey.server.imple.application.WebApplicationIpl.initiate(
> WebApplicationImpl.java:697)
> at com.sub.jersey.server.imple.application.WebApplicationIpl.initiate(
> WebApplicationImpl.java:692)
> at
> com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletC
> ontainer.java:488)
> ........
>
> and it continues like that through the stacktrace.
>


-- 
Thanks,
Jamie
--------------------------------
Jamie Jones
Email: jjones_at_whitebaordfederal.com
Phone: 202-279-5196
---------------------------------