[ 
https://issues.apache.org/jira/browse/DIRMINA-1185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17904158#comment-17904158
 ] 

Alexander B commented on DIRMINA-1185:
--------------------------------------

I did a Thread.sleep with different durations (max 10000ms). But no difference.

But I found out, that the user specific server.xml should be the reason.
* In case I dont have a user specific server.xml, it works. So inside of my 
fat-jar there is no file conf/server.xml.
* In case I have a server.xml (inside the fat-jar under conf) and configure it 
for HTTP, it does not work either. (Using _<Connector port="8080" 
protocol="HTTP/1.1" connectionTimeout="20000"/>_ ) instead of the 
HTTPS-Connector
* In case I have a server.xml and configure it for HTTPS, it does not work 
(same behaviour)

So it should be a general problem; not a http-vs-https problem. I continue to 
figure out what it is. Maybe i can reproduce it by preparing a minimal example 
in the next days.

> Question about Unbinding NioAcceptor
> ------------------------------------
>
>                 Key: DIRMINA-1185
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-1185
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.8
>            Reporter: Alexander B
>            Priority: Major
>
> Hi there,
> We have an application (Tomcat7 , Java8), which uses Mina 2.1.8. The 
> intention is to open a port (in this example 2004) and close this connection 
> object in case nobody will be connected. Then after a moment a new binding 
> should be performed on this object.
> Until today this Tomcat ran on HTTP. I have switched to HTTPS and actually I 
> did not touch any code, which includes/extends any Mina-classes. 
> In the first case (Tomcat running on HTTP), there is an instance of 
> NioSocketAcceptor, which will be `unbind()`, if there is no connection after 
> a specific time. Then a reconnect (new bind on port 2004) will be performed 
> and the same port will be opened again. This works fine.
> In the second case (Tomcat running on HTTPS with the following changes: I 
> created a keystore, integrated it into the project and adapted tomcat's 
> server.xml) after a specific time I called unbind() on the 
> NioSocketAccepter-object and then a reconnect we will performed again. In 
> this moment, the new binding crashes with the message :
> ```
> java.io.IOException: Error while binding on 0.0.0.0/0.0.0.0:2004
>         at 
> org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:301)
>         at 
> org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:52)
>         at 
> org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.registerHandles(AbstractPollingIoAcceptor.java:621)
>         at 
> org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:518)
>         at 
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
> Caused by: java.net.BindException: Address already in use: bind
>         at sun.nio.ch.Net.bind0(Native Method)
>         at sun.nio.ch.Net.bind(Net.java:461)
>         at sun.nio.ch.Net.bind(Net.java:453)
>         at 
> sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:222)
>         at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85)
>         at 
> org.apache.mina.transport.socket.nio.NioSocketAcceptor.open(NioSocketAcceptor.java:296)
>         ... 7 common frames omitted
> ```
> Do you know, if there are any issues regarding the unbinding process in Mina 
> in combination with a running Tomcat on HTTPS? Or do I have to change any 
> implementation including mina classes?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org

Reply via email to