java.net.SocketException: Invalid argument

Oracle Community | h1d3m3 | 8 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    setSoLinger and setReuseAddress Exceptions

    Oracle Community | 8 years ago | h1d3m3
    java.net.SocketException: Invalid argument
  2. 0

    java.net.SocketException: Invalid argument

    Oracle Community | 5 years ago | 899236
    java.net.SocketException: Invalid argument
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    [Umbrella bug for JDK 5/6/7 issue 6799574) Grizzly is suffering performance degradation when setSoLinger and setReuseAddess starts throwing the following exception: [#|2009-01-26T00:33:56.325-0800|WARNING|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=SelectorReaderThread-8084;_RequestID=11ae0030-c392-4217-8408-cfa7efe0a879;|setSoLinger exception java.net.SocketException: Invalid argument at sun.nio.ch.Net.setIntOption0(Native Method) at sun.nio.ch.Net.setSocketOption(Net.java:261) at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:166) at sun.nio.ch.SocketAdaptor.setIntOption(SocketAdaptor.java:296) at sun.nio.ch.SocketAdaptor.setSoLinger(SocketAdaptor.java:331) at com.sun.enterprise.web.connector.grizzly.SelectorThread.setSocketOptions(SelectorThread.java:1893) at com.sun.enterprise.web.connector.grizzly.SelectorReadThread.registerNewChannels(SelectorReadThread.java:93) at com.sun.enterprise.web.connector.grizzly.SelectorReadThread.startEndpoint(SelectorReadThread.java:121) at com.sun.enterprise.web.connector.grizzly.SelectorThread.run(SelectorThread.java:1223) |#] [#|2009-01-26T00:33:56.327-0800|WARNING|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=17;_ThreadName=SelectorReaderThread-8084;_RequestID=11ae0030-c392-4217-8408-cfa7efe0a879;|setReuseAddress exception java.net.SocketException: Invalid argument at sun.nio.ch.Net.setIntOption0(Native Method) at sun.nio.ch.Net.setSocketOption(Net.java:261) at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:166) at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:286) at sun.nio.ch.SocketAdaptor.setReuseAddress(SocketAdaptor.java:399) at com.sun.enterprise.web.connector.grizzly.SelectorThread.setSocketOptions(SelectorThread.java:1910) at com.sun.enterprise.web.connector.grizzly.SelectorReadThread.registerNewChannels(SelectorReadThread.java:93) at com.sun.enterprise.web.connector.grizzly.SelectorReadThread.startEndpoint(SelectorReadThread.java:121) at com.sun.enterprise.web.connector.grizzly.SelectorThread.run(SelectorThread.java:1223) |#] This has been discussed here: https://glassfish.dev.java.net/servlets/ReadMsg?listName=users&msgNo=26597 One user reported: ..that these errors are harmless, however, as you can see below, the throughput of my application was reduced by 50% in the minutes surrounding the spurt of errors: minute requests setSoLinger/setReuseAddress exceptions ----- ----- - 14:23 7620 0 14:24 10063 0 14:25 9714 0 14:26 8847 0 14:28 7370 0 14:29 9787 0 14:30 9104 0 14:31 8171 0 14:32 4066 15 errors in two groups: 8 @ 14:32:33 and 7 @ 14:32:58 14:33 6908 0 14:34 10463 0 14:35 9870 0 14:36 8236 0 14:37 8685 0 14:38 8098 0 My application constantly serves 200-350 requests per second - and has been doing so for 1 week now. This is the only incident that any errors have been thrown since the application began operation.

    Java.net JIRA | 8 years ago | jfarcand
    java.net.SocketException: Invalid argument

  1. tvrmsmith 1 times, last 7 months ago
1 unregistered visitors

Root Cause Analysis

  1. java.net.SocketException

    Invalid argument

    at sun.nio.ch.Net.setIntOption0()
  2. Java RT
    SocketAdaptor.setSoLinger
    1. sun.nio.ch.Net.setIntOption0(Native Method)
    2. sun.nio.ch.Net.setIntOption(Net.java:154)
    3. sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:406)
    4. sun.nio.ch.SocketOptsImpl.setInt(SocketOptsImpl.java:46)
    5. sun.nio.ch.SocketOptsImpl.linger(SocketOptsImpl.java:104)
    6. sun.nio.ch.SocketOptsImpl$IP$TCP.linger(SocketOptsImpl.java:268)
    7. sun.nio.ch.OptionAdaptor.setSoLinger(OptionAdaptor.java:67)
    8. sun.nio.ch.SocketAdaptor.setSoLinger(SocketAdaptor.java:276)
    8 frames
  3. Glassfish Core
    SelectorThread.run
    1. com.sun.enterprise.web.connector.grizzly.SelectorThread.setSocketOptions(SelectorThread.java:1893)
    2. com.sun.enterprise.web.connector.grizzly.SelectorReadThread.registerNewChannels(SelectorReadThread.java:93)
    3. com.sun.enterprise.web.connector.grizzly.SelectorReadThread.startEndpoint(SelectorReadThread.java:121)
    4. com.sun.enterprise.web.connector.grizzly.SelectorThread.run(SelectorThread.java:1223)
    4 frames