新的项目要与Salesforce系统通信,实现API 联合开发。
当调用API 执行login call 的时候 出现如下的错误
com.sforce.ws.ConnectionException: Failed to parse detail: START_TAG seen ...</sf:exceptionMessage><sf:upgradeURL>... @1:755 due to: com.sforce.ws.ConnectionException: unable to find end tag at: START_TAG seen ...</sf:exceptionMessage><sf:upgradeURL>... @1:755
at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.java:246)
at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:210)
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:156)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:99)
at com.sforce.soap.enterprise.EnterpriseConnection.login(EnterpriseConnection.java:1217)
at com.sforce.soap.enterprise.EnterpriseConnection.<init>(EnterpriseConnection.java:387)
at com.sforce.TestLogin.main(TestLogin.java:22)
经过排查原来是 JDK的版本导致, 我用的jdk 1.7,TLS的版本太低, 所以导致了解析出错的问题。
解决的办法有两个
1,使用JDK 1.8, 我并没有升级自己的JDK, 依然用JDK 1.7
2,设置JVM 加入配置 -Dhttps.protocols=TLSv1.1,TLSv1.2
问题得到解决。