Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Catch jetty server exceptions when running as standalone

Hi All,

 

Does it possible to catch and handle exception thrown by jetty server ( start.jar )

For example if I want to catch BindException  and tell my user a more informative error why it can happen:

 

Caused by: java.net.BindException: Cannot assign requested address

        at sun.nio.ch.Net.bind0(Native Method)

        at sun.nio.ch.Net.bind(Net.java:567)

        at sun.nio.ch.Net.bind(Net.java:547)

        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java)

        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:86)

        at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChann)

        at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector)

        at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectCh)

        at org.eclipse.jetty.server.ssl.SslSelectChannelConnector.doStart(SslSe)

        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLif)

        at org.eclipse.jetty.server.Server.doStart(Server.java:293)

        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLif)

        at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1)

        at java.security.AccessController.doPrivileged(AccessController.java:27)

        at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:11)

        ... 7 more

 

Usage: java -jar start.jar [options] [properties] [configs]

       java -jar start.jar --help  # for more information

 


Back to the top