users@jersey.java.net

Problem using jersey client in Junit test

From: Gavin Bong <malaisien_at_gmail.com>
Date: Thu, 30 Apr 2009 12:29:43 +0800

I invoke a jersey PUT with the following configuration

        ClientConfig config = new DefaultClientConfig();
        config.getClasses().add( JSONRootElementProvider.class );
        Client client = Client.create(config);

But it is throwing an exception:

Apr 30, 2009 12:22:12 PM
com.sun.jersey.core.spi.component.ProviderFactory
__getComponentProvider
SEVERE: The provider class, class
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider,
could not be instantiated. Processing will continue but the class will
not be utilized
java.lang.InstantiationException:
com.sun.jersey.json.impl.provider.entity.JSONRootElementProvider
        at java.lang.Class.newInstance0(Class.java:340)

My pom file snippet:

        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-client</artifactId>
            <version>1.0.3</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-json</artifactId>
            <version>1.0.3</version>
            <scope>test</scope>
        </dependency>

Am I missing anything else ?

-- 
Sincères salutations,
Gavin Bong
Rien ne sert d'être vivant, s'il faut qu'on travaille - André Breton
If you do things well, do them better. Be daring, be first be
different, be just. - Anita Roddick
http://twitter.com/chihiro