2

DefaultHttpClient インスタンスで execute を呼び出すと、NoSuchFieldError が発生し続けます。これらは私が持っているコード行です。

        HttpClient client = new DefaultHttpClient();        
        HttpPost post = new HttpPost("http://10.65.98.158/atlas/rest/comparablesBulk?type=permId");
        StringEntity req = new StringEntity(request.toJSONString(),ContentType.APPLICATION_JSON);
        post.setEntity(req);
        HttpResponse response = client.execute(post);//this is where the error happens

これは私が得るスタックトレースです:

Exception in thread "main" java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
    at org.apache.http.impl.client.DefaultHttpClient.setDefaultHttpParams(DefaultHttpClient.java:175)
    at org.apache.http.impl.client.DefaultHttpClient.createHttpParams(DefaultHttpClient.java:158)
    at org.apache.http.impl.client.AbstractHttpClient.getParams(AbstractHttpClient.java:448)
    at org.apache.http.impl.client.AbstractHttpClient.createClientConnectionManager(AbstractHttpClient.java:309)
    at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:466)
    at org.apache.http.impl.client.AbstractHttpClient.createHttpContext(AbstractHttpClient.java:286)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:851)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
    at AtlasService.main(AtlasService.java:62)
4

0 に答える 0