[英]Eclipse is saying that static field of a class cannot be resolved
盡管HttpComponents文檔說類DefaultConnectionReuseStrategy
有一個名為INSTANCE
的靜態字段,但是Eclipse告訴我這是未解決的。
我已經嘗試了我所知道的一切(檢查版本,重建代碼等),但是沒有任何東西可以解決。 有誰知道是什么引起了這個問題?
代碼是:
socket = serverSocket.accept();
DefaultBHttpServerConnectionFactory connFactory = DefaultBHttpServerConnectionFactory.INSTANCE;
HttpServerConnection conn = connFactory.createConnection(socket);
ConnectionReuseStrategy connReuseStrat = DefaultConnectionReuseStrategy.INSTANCE;
HttpService httpService = new HttpService(httpproc, connReuseStrat, new DefaultHttpResponseFactory(), null, null);
HttpContext context = new BasicHttpContext(null);
httpService.handleRequest(conn, context);
Eclipse中包含的Apache HTTPComponents版本是4.2.x,它沒有INSTANCE字段-這在4.3中似乎是新的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.