On 28/06/10 14:36, Laurent Garrigues wrote:
> Hi Bruno, thanks for your answer
>
> I have no idea if it's a basic/digest authentication or a SSL/certificate.
> When I use the browser, it does not open the login pop-up.
>
> If I remove "jettyServer.start();" it works fine, but not in jetty:
> "22 juin 2010 16:26:46 org.restlet.ext.simple.SimpleServerHelper start
> INFO: Starting the Simple server"
>
> I had missed an error in the log :
>
> java.net.BindException: Address already in use
>       at sun.nio.ch.Net.bind(Native Method)
>       at 
> sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
>       at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
>       at 
> org.simpleframework.transport.connect.Acceptor.bind(Acceptor.java:173)
>       at 
> org.simpleframework.transport.connect.Acceptor.<init>(Acceptor.java:90)
>       at 
> org.simpleframework.transport.connect.Listener.<init>(Listener.java:80)
>       at 
> org.simpleframework.transport.connect.ListenerManager.listen(ListenerManager.java:92)
>       at 
> org.simpleframework.transport.connect.SocketConnection.connect(SocketConnection.java:128)
>       at 
> org.restlet.ext.simple.HttpsServerHelper.start(HttpsServerHelper.java:329)
>       at org.restlet.Server.start(Server.java:424)
>       at org.restlet.Component.startServers(Component.java:558)
>       at org.restlet.Component.start(Component.java:519)
>       at org.opensi.ws.Serveur.main(Serveur.java:115)
>
> Eerily, it work fine with the java client.

What's happening here is that you're starting Jetty by hand, and then 
the connector is trying to start its server connector (from what you're 
saying, it seems it's using the Simple connector according to the way 
you've set it up).
As a result, the first Jetty handler (probably not fully configured for 
the Restlet application) is the one that uses the port, the actual 
Restlet component is never really listening.

You should never start handlers by hand with Restlet (or at least not 
this way).
If you want to use the Jetty connector rather than the Simple connector, 
remove org.restlet.ext.simple.XXXXXX.jar from your classpath and put 
org.restlet.ext.jetty.XXXXX.jar instead: that's the way to select the 
connector implementation.


Best wishes,

Bruno.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2626979

Reply via email to