欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

AIX上运行Jetty碰到A system call received a parameter that is not valid

程序员文章站 2024-01-31 08:30:22
...

Jetty在window上、linux上运行都没有问题,在AIX上运行碰到如下异常:

 

java.net.SocketException: A system call received a parameter that is not valid.
        at sun.nio.ch.Net.localInetAddress(Native Method)
        at sun.nio.ch.Net.localAddress(Net.java:185)
        at sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java:421)
        at sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:179)
        at java.net.Socket.getLocalSocketAddress(Socket.java:719)
        at org.eclipse.jetty.io.nio.ChannelEndPoint.<init>(ChannelEndPoint.java:68)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.<init>(SelectChannelEndPoint.java:59)
        at org.eclipse.jetty.server.nio.SelectChannelConnector.newEndPoint(SelectChannelConnector.java:306)
        at org.eclipse.jetty.server.nio.SelectChannelConnector$ConnectorSelectorManager.newEndPoint(SelectChannelConnector.java:399)
        at org.eclipse.jetty.io.nio.SelectorManager$SelectSet.createEndPoint(SelectorManager.java:812)
        at org.eclipse.jetty.io.nio.SelectorManager$SelectSet.doSelect(SelectorManager.java:425)
        at org.eclipse.jetty.io.nio.SelectorManager.doSelect(SelectorManager.java:225)
        at org.eclipse.jetty.server.nio.SelectChannelConnector$1.run(SelectChannelConnector.java:268)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
        at java.lang.Thread.run(Thread.java:803)

 

网上查找类似问题:

http://www-01.ibm.com/support/docview.wss?uid=swg1PK42970

应该是IBM JDK的一个bug,只能升级JDK版本了

下载地址:http://www.ibm.com/developerworks/java/jdk/aix/service.html

安装过程:http://fxyc.iteye.com/blog/751084

 

APAR status

    *
      Closed as program error.

Error description

    *

      Error Message: java.net.SocketException: A system call received
      a parameter that is not valid.
      Stack Trace: java.lang.Error: java.net.SocketException: A system
      call received a parameter that is not valid.
       at sun.nio.ch.Net.localAddress(Net.java(Inlined Compiled Code))
       at
      sun.nio.ch.SocketChannelImpl.localAddress(SocketChannelImpl.java
      (Compiled Code))
       at
      sun.nio.ch.SocketAdaptor.getLocalAddress(SocketAdaptor.java:178)
       at java.net.Socket.getLocalSocketAddress(Socket.java:660)
       at
      com.ibm.ws.tcp.channel.impl.NBAcceptChannelSelector.performReque
      st(NBAcceptChannelSelector.java:271)
       at
      com.ibm.ws.tcp.channel.impl.ChannelSelector.run(ChannelSelector.
      java:233)
       at java.lang.Thread.run(Thread.java:570)
      .

Local fix

    *

Problem summary

    *

      getLocalSocketAddress, getLocalPort returns invalid argument.

Problem conclusion

    *

      This defect will be fixed in:
      1.4.2 SR9
      .
      As per java API doc getLocalSocketAddress() and getLocalPort()
      should not throw any exception. If socket is not bound,
      getLocalPort returns -1 and null for getLocalSocketAddress.
      .
      To obtain the fix:
      Install build 20070613 or later