Skip to content

First steps tutorial in standalone mode encounters socket exception due to uninitialized value #743

Open
@lonerzzz

Description

@lonerzzz

Hi,

I have attempted to follow the tutorial at http://restlet.org/learn/2.0/firstSteps#part04 using the latest 2.1 code and running in standalone mode but have encountered the following exception.

Starting the internal [HTTP/1.1] server on port 8182
The server socket was closed

java.net.SocketException: Invalid argument: no further information
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setSocketOption(Unknown Source)
at sun.nio.ch.SocketChannelImpl.setOption(Unknown Source)
at sun.nio.ch.SocketAdaptor.setIntOption(Unknown Source)
at sun.nio.ch.SocketAdaptor.setTrafficClass(Unknown Source)
at org.restlet.engine.connector.ConnectionHelper.configure(ConnectionHelper.java:264)
at org.restlet.engine.connector.ServerConnectionController.onSelected(ServerConnectionController.java:108)
at org.restlet.engine.connector.ConnectionController.selectKeys(ConnectionController.java:308)
at org.restlet.engine.connector.ConnectionController.doRun(ConnectionController.java:171)
at org.restlet.engine.connector.Controller.run(Controller.java:159)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

The problem appears to be because the setTrafficClass call against the Socket is being done with an inappropriate default value "0". I was trying to see where these values should originate but not having any luck and this being a tutorial, I thought I would pass on the message to be fixed instead.

I can supply an exported eclipse project if that helps.

Jason

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions