Hi. I'm using pax-web-jetty-bundle-6.1.0.jar with Apache Felix.
I noticed that in my setup there are two threads that create
a JettyServerImpl each:
2018-01-18 15:27:31 DEBUG [paxweb-config-1-thread-1] - JettyServerImpl -
Starting JettyServerImpl{}
2018-01-18 15:27:31 DEBUG [paxweb-config-2-thread-1] - JettyServerImpl -
Starting JettyServerImpl{}
I have only one jetty.xml file, why are two threads used to initialize
JettyServerImpl instances ?
I'm asking because occasionally I'm getting an exception:
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.Net.bind(Unknown Source)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at
org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:351)
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:319)
at
org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
at
org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:235)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.server.Server.doStart(Server.java:401)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at
org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:350)
I did a number of tests and the probability of getting that exception
depends on the log level (oddly), meaning if the startup is delayed by the
logging. Therefore I suspect there can be a race condition between the two
threads.
There is no other service blocking ports 8080/8443 on my machine. I'm
confident that sometimes two server sockets are allocated simultaneously,
through those two threads.
Silvano
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google Groups
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.