问题描述
- Cannot create a secure XMLInputFactory
-
public static String postData1(String urlAddress, String encodedType,Map params) {try {
URL url = new URL(urlAddress);
URLConnection conn = url.openConnection();
conn.setRequestProperty("accept", "*/*");
conn.setRequestProperty("connection", "Keep-Alive");
conn.setRequestProperty("user-agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");conn.setDoOutput(true); conn.setDoInput(true); conn.setUseCaches(false); // Post请求不用设置缓存 conn.getOutputStream(); // 获取返回数据 BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "utf-8")); String line = null; StringBuffer sb = new StringBuffer(); while ((line = in.readLine()) != null) { sb.append(line); } in.close(); // 关闭流 return sb.toString(); } catch (Exception e) { e.printStackTrace(); } return ""; } 使用上述的代码访问webservice,如果不加conn.getOutputStream(),返回soap协议正确,如果加上这一句,报错500,服务器那边显示错误:不能创建一个安全的xmlInputFactory:java.lang.RuntimeException: Cannot create a secure XMLInputFactory。 这是什么原因呢?在线等待,大家帮帮忙......
解决方案
http://blog.csdn.net/fengcheqidong/article/details/40423517
终于解决了!!!
解决方案二:
BI Java 补丁错误处理 :Cannot login to the SAP J2EE Engine using user and password as provided in the Filesystem Secure Store. Enter va
Cannot create PoolableConnectionFactory
AnyConnect cannot confirm it is connected to your secure gateway.
时间: 2024-10-03 20:40:04