Looks like the OAuth provider implementation is not getting picked up.
Are you using package scanning or some other way of including the
DefaultOAuthProvider in your ResourceConfig?
If you don't understand what I am talking about, please let me know how
your web.xml looks like.
Thanks,
Martin
On 15.7.2011 12:09, Corben wrote:
> Dear all,
>
> I've started using Jersey to make a REST web service to be protected with oAuth. I'm not an expert in these topics, so any help is really appreciated.
>
> I've followed this tutorial:
> http://java.net/projects/jersey/downloads/download/s314285_oauth.zip
>
> Even if I tried to follow it not on the actual exercise, but to modify with Eclipse (instead of NetBeans) an existing Dynamic Web Project that will run on TomCat (instead of Glassfish). Additional information: I'm not using Maven, and I'm modifying an existing and working REST web service using Jersey running on TomCat.
>
> Thanks to the tutorial, I've been able to follow all the steps for the creation of a Service Provider (in the oAuth meaning), and the project compiles properly. However while starting up it gives the following errors:
>
> INFO: Initiating Jersey application, version 'Jersey: 1.8 06/24/2011 12:39 PM'
> 15-lug-2011 11.41.02 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 constructor public com.sun.jersey.oauth.server.api.OAuthServerFilter(com.sun.jersey.api.core.ResourceConfig,com.sun.jersey.oauth.server.spi.OAuthProvider) at parameter index 1
> SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.api.providers.DefaultOAuthProvider org.eservices4life.tclouds.AuthorizationResource.provider
> SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.spi.OAuthProvider com.sun.jersey.oauth.server.api.resources.AccessTokenRequest.provider
> SEVERE: Missing dependency for field: private com.sun.jersey.oauth.server.spi.OAuthProvider com.sun.jersey.oauth.server.api.resources.RequestTokenRequest.provider
> 15-lug-2011 11.41.02 org.apache.catalina.core.StandardContext filterStart
> GRAVE: Exception starting filter Jersey Filter
> 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:771)
> at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:766)
> at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:488)
> at ...
> ...
>
> At first I tought to a problem of dependencies, but I've tried to include all the possible libraries, without any difference. I've also tried asked a friend to make the war file of the example solution with NetBeans+Glassfish, and extracting the jars from his war, but still no differences.
>
> I'm using Jersey1.8.
>
> I've been struggling with this problem for a couple of days now, and google couldn't really help, so I don't know what else should I try.
> Any hint is really welcome!!
>
> Thanks,
> Corben
>