在HP Tandem中获取Java Streams的问题(不间断)

时间:2009-11-18 18:26:45

标签: java stream tandem hp-nonstop

我们正在Tandem NonStop系统之间移植一个简单​​的Java应用程序,从G系列到H系列。 Java版本是1.5.0_02。

执行基本I / O任务(如从客户端套接字获取输出流或打开客户端套接字)时,我们会收到类似

的异常

java.io.IOException: Value out of range

java.net.SocketException: Value out of range

(“超出范围的价值”是Tandem本地术语,好吧,我想的一切都是。)

有没有人遇到过类似的问题?即I / O损坏,例如搞乱JNI?

我认为系统出了问题,但它可能在哪里?

谢谢。

编辑:

按要求添加摘录

示例代码段(a) - 使用Runtime.exec ()(改编)

Properties envVars = new Properties();
Process p = r.exec("/bin/env");
envVars.load(p.getInputStream());

堆栈跟踪(a):

java.io.IOException: Value out of range (errno:4034)
    at java.io.FileInputStream.readBytes(Native Method)
    at java.io.FileInputStream.read(FileInputStream.java:194)
    at java.lang.UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:221)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:254)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
    at sun.nio.cs.StreamDecoder$CharsetSD.readBytes(StreamDecoder.java:411)
    at sun.nio.cs.StreamDecoder$CharsetSD.implRead(StreamDecoder.java:453)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:183)
    at java.io.InputStreamReader.read(InputStreamReader.java:167)
    at java.io.BufferedReader.fill(BufferedReader.java:136)
    at java.io.BufferedReader.readLine(BufferedReader.java:299)
    at java.io.BufferedReader.readLine(BufferedReader.java:362)
    at util.Environment.getVariables(Environment.java:39)

最后一行失败,输出被重定向到控制台(!)。

示例代码段(b) - 使用HttpURLConnection

public WorkerThread (HttpURLConnection conn, String requestData, Logger logger)
{
    this.conn = conn;
    ...
}


public void run ()
{
    OutputStream out = conn.getOutputStream ();
}

堆栈跟踪(b):

java.net.SocketException: Value out of range (errno:4034)
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
  at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
  at java.net.Socket.connect(Socket.java:507)
  at sun.net.NetworkClient.doConnect(NetworkClient.java:155)
  at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
  at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
  at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:280)
  at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:337)
  at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:176)
  at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:736)
  at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:162)
  at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:828)
  at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)

案例(a)可以避免,因为它是以前JRE版本(!)的其他问题的解决方法,但是与套接字相同的行为真的很讨厌。

2 个答案:

答案 0 :(得分:0)

错误代码4034似乎表明特定服务器未在NonStop群集中运行。您确定您的系统设置正确吗?

答案 1 :(得分:0)

更新:问题是由虚假的.so库造成的。