java - http java调用出错了
问题描述
我在 Weblogic 12 上有一个 java 应用程序,我在 REST 中对 SAP 服务器进行 https 调用(GET e 基本身份验证),一切正常工作 30/45 分钟,但在我有“503:服务不可用”之后。如果我从浏览器调用此服务,它总是有效的。
HttpURLConnection conn = (HttpURLConnection) new URL( url.toString()).openConnection();
conn.setRequestProperty("Authorization", "Basic " + authUserEnc);
... //read the response stream
conn.disconnect();
这是错误
java.io.FileNotFoundException: Response: '503: Service Unavailable' for url: 'https://fwp-as3.enelint.global:44331/sap/opu/odata/sap/ZFIOI_O1_Q006_SRV/ZFIOI_O1_Q006(ZVAR_VDMCUI_OI_M='0000022077',ZVAR_VDMCUI_OI_MTo='0000022077')/Results?saml2=disabled'
at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:829)
at weblogic.net.http.SOAPHttpsURLConnection.getInputStream(SOAPHttpsURLConnection.java:42)
at it.exprivia.bexboard.service.impl.VendorServiceImpl.getData(VendorServiceImpl.java:125)
at it.exprivia.bexboard.controller.GrafxController.getVendorGrafxById(GrafxController.java:166)
at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:181)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:202)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:101)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)
at ...
解决方案
推荐阅读
- amazon-web-services - EBS 快照如何存储在 S3 中?EBS = 块存储,S3 = 对象存储
- html - 如何根据子类更改父类 css 属性?
- java - @Embeddable 有自己的 id
- c# - 无法加载文件或程序集 GalaSoft.MvvmLight
- c# - 无法将 lambda 表达式转换为预期的委托类型(int 列表包含 int)
- wpf - 如何强制 WPF 绑定在 F# 中刷新
- jmeter-4.0 - 如何使用 Jmeter 4.0 上传图片/MP4 视频/PDF
- python - Seaborn:避免绘制缺失值(线图)
- java - Recycleview 不显示项目
- javascript - 如何将我的游戏角色保留在画布中?