Hello,
I try to start, stop and restart the HttpNio transportIn using the
org.apache.axis2.engine.ListenerManager
But with the second start the logger writes a Fatal error.
So what's wrong? Can anybody help me please?
LOG:
===============================
DEBUG - Starting Listener...
INFO - HTTP Listener starting on port : 8084
DEBUG - Using backport of the util.concurrent package..
INFO - Listener Shutdown
INFO - Listener shut down
INFO - Sender Shutdown
INFO - Sender shut down
DEBUG - Starting Listener...
INFO - HTTP Listener starting on port : 8084
DEBUG - Using backport of the util.concurrent package..
FATAL - Encountered an I/O error: Address already in use: bind
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
at
org.apache.http.impl.nio.reactor.DefaultListeningIOReactor.listen(DefaultListeningIOReactor.java:173)
at
org.apache.axis2.transport.nhttp.HttpCoreNIOListener.startServerEngine(HttpCoreNIOListener.java:89)
at
org.apache.axis2.transport.nhttp.HttpCoreNIOListener.access$100(HttpCoreNIOListener.java:51)
at
org.apache.axis2.transport.nhttp.HttpCoreNIOListener$1.run(HttpCoreNIOListener.java:197)
at java.lang.Thread.run(Unknown Source)
INFO - Listener Shutdown
INFO - Listener shut down
INFO - Sender shut down
AXIS2.XML
========================
only HttpCoreNIOListener is activated.
<transportReceiver
class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener" name="http">
<parameter locked="false" name="port">8084</parameter>
TEST METHOD:
================================
public static void main(String[] args) throws Exception
{
ListenerManager listenerManager;
ConfigurationContext configctx;
String repoLocation;
String confLocation;
File axis2Directory;
axis2Directory = new File("path/to/your/axis2");
repoLocation = new File(axis2Directory,
"repository").getAbsolutePath();
confLocation = new File(axis2Directory,
"conf/axis2.xml").getAbsolutePath();
configctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
repoLocation, confLocation);
listenerManager = new ListenerManager();
listenerManager.init(configctx);
listenerManager.start();
listenerManager.stop();
listenerManager.destroy();
listenerManager = new ListenerManager();
listenerManager.init(configctx);
listenerManager.start(); //<-- Fatal error is logged here
listenerManager.stop();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]