Skip to main content

MIMEParsingException in REST

No replies
Joined: 2009-06-17

I have a question about MIMEParsingException.
I use JEE 6 with NetBeans 6.8. I write a simple REST web service in Java to print "hello world", it runs well.
Then I write a REST web services client (Java Main Class) to test REST :

public class HelloWorldClient {

* @param args the command line arguments
public static void main(String[] args) {
ClientConfig config = new DefaultClientConfig();
Client client = Client.create(config);
WebResource service = client.resource(getBaseURI());
String xml = service.path("resources").path("helloworld").accept(MediaType.TEXT_XML).get(String.class);

private static URI getBaseURI() {
return UriBuilder.fromUri("http://localhost:8080/HelloWorldApplication").build();

It complies without error, but when I run it, it throws MIMEParsingException at this line :
Client client = Client.create(config);

Exception in thread "main" com.sun.jersey.spi.service.ServiceConfigurationError: jersey-client-components: A dependent class, org/jvnet/mimepull/MIMEParsingException, of the class com.sun.jersey.multipart.impl.MultiPartReader implementing the provider class java.lang.Object is not found. The provider implementation is ignored.
at com.sun.jersey.spi.service.ServiceFinder.access$200(
at com.sun.jersey.spi.service.ServiceFinder$
at com.sun.jersey.spi.service.ServiceFinder$
at com.sun.jersey.spi.service.ServiceFinder.toClassArray(
at com.sun.jersey.api.client.Client.(
at com.sun.jersey.api.client.Client.(
at com.sun.jersey.api.client.Client.create(
at helloWorld.client.HelloWorldClient.main(

Who can resolve this problem ? Thanks a lot.