我在 Java 中的 WebEngine 中的 cookie 有问题。当我尝试打开指定的 url 时,我收到该异常:
lip 13, 2017 3:18:25 PM com.sun.webkit.network.URLLoader doRun
WARNING: Unexpected error
java.lang.IllegalArgumentException: Invalid cookie name-value pair
at java.net.HttpCookie.parseInternal(HttpCookie.java:823)
at java.net.HttpCookie.parse(HttpCookie.java:202)
at java.net.HttpCookie.access$100(HttpCookie.java:58)
at java.net.HttpCookie$12.parse(HttpCookie.java:977)
at sun.net.www.protocol.http.HttpURLConnection.filterHeaderField(HttpURLConnection.java:2927)
at sun.net.www.protocol.http.HttpURLConnection.getFilteredHeaderFields(HttpURLConnection.java:2964)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:3008)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderFields(HttpsURLConnectionImpl.java:283)
at com.sun.webkit.network.URLLoader.extractHeaders(URLLoader.java:988)
at com.sun.webkit.network.URLLoader.didReceiveResponse(URLLoader.java:765)
at com.sun.webkit.network.URLLoader.receiveResponse(URLLoader.java:497)
at com.sun.webkit.network.URLLoader.doRun(URLLoader.java:164)
at com.sun.webkit.network.URLLoader.lambda$run$98(URLLoader.java:129)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.webkit.network.URLLoader.run(URLLoader.java:128)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
它会导致网页上的错误。我需要打开这个 URL。在 Firefox 或 Chrome 中一切正常。如何解决?