0

我正在尝试连接到服务

https://staging.identitymanagement.lexisnexis.com/identity-proofing/services/identityProofingServiceWS/v2

这是由 Lexis Nexis 托管的 Web 服务。

遇到以下异常。

  staging.identitymanagement.lexisnexis.com (java.net.UnknownHostException)
  java.net.PlainSocketImpl:177 (null)
  Initialisation Failure: staging.identitymanagement.lexisnexis.com
  java.net.UnknownHostException: staging.identitymanagement.lexisnexis.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.
      connect      (BaseSSLSocketImpl.java:141)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.
     getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)

我正在尝试使用 mule 集成服务来调用它。但是,我们仍然遇到未知主机异常的问题。我还正确添加了相同的代理详细信息。

请指引我前进的方向。

4

1 回答 1

0

对我来说似乎是网络代理问题。 http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html

您是否在服务器启动脚本中的 vm 参数(JAVA_OPTIONS)中添加了代理?它应该看起来像这样。

JAVA_FLAGS=-Dhttp.proxyHost=hostname.example.com -Dhttp.proxyPort=8080
java ${JAVA_FLAGS} ...

我还建议以编程方式设置代理,

public void setProxy() {
    if (isUseHTTPProxy()) {
        // HTTP/HTTPS Proxy
        System.setProperty("http.proxyHost", getHTTPHost());
        System.setProperty("http.proxyPort", getHTTPPort());
        System.setProperty("https.proxyHost", getHTTPHost());
        System.setProperty("https.proxyPort", getHTTPPort());
        if (isUseHTTPAuth()) {
            String encoded = new String(Base64.encodeBase64((getHTTPUsername() + ":" + getHTTPPassword()).getBytes()));
            con.setRequestProperty("Proxy-Authorization", "Basic " + encoded);
            Authenticator.setDefault(new ProxyAuth(getHTTPUsername(), getHTTPPassword()));
        }
    }
于 2013-10-04T09:02:46.600 回答