HTTPClient Example - Exception in thread “main” java.lang.NoSuchFieldError: INSTANCE

后端 未结 8 809
孤城傲影
孤城傲影 2020-11-29 10:22

I am using HttpClient components from Apache for the following simple program and I see the below exception:

Exception in thread \"main\" java.lang.NoSuchFieldErr         


        
8条回答
  •  情歌与酒
    2020-11-29 10:41

    I had this problem. It looks like there is a problem while initializing HttpClient with HttpClientBuilder.create().build(). If you want more immediate solution just use new DefaultHttpClient() to initialize HttpClient.

    HttpClient client = new DefaultHttpClient();
    

提交回复
热议问题