我正在努力使AngularJS应用程序正常运行到嵌入式JavaFX Webkit浏览器中。
在初始化期间,应用服务器返回HTTP 401(未授权)是很正常的。应用程序中的Ajax处理程序将设法重定向登录页面,并在以后重新发出失败的请求。
虽然在>时从JVM的默认实现HttpUrlConnection抛出IOException。抛出400错误,并且不会将响应输入流返回给应用程序。
我尝试在发生此IOException时使用getErrorStream()来增强此HTTPUrlConnection,但是时候有了这个:
@Override
public synchronized InputStream getInputStream() throws IOException {
try {
return super.getInputStream();
} catch (IOException e) {
return super.getErrorStream();
}
}
WARNING: Unexpected error
java.lang.NullPointerException
at com.sun.webpane.webkit.network.URLLoader.close(Unknown Source)
at com.sun.webpane.webkit.network.URLLoader.doRun(Unknown Source)
at com.sun.webpane.webkit.network.URLLoader.access$000(Unknown Source)
at com.sun.webpane.webkit.network.URLLoader$1.run(Unknown Source)
at com.sun.webpane.webkit.network.URLLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.webpane.webkit.network.URLLoader.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
仍然没有响应代码进入应用程序。
有什么想法吗?
谢谢