Hi,
Actually this class not found was because of debug.
Now I see the code that is required has been invoked in TailFilter
s.getHandler().sessionClosed(session);
But in case of TLS error there is not an event for TailFilter and its
sessionClosed is not invoked.
In Apache ftp server we extended SslFilter where it can be invoked the code
above in sessionClosed
of this filter. Do you think it is suitable workaround and can you confirm the
issue related to new design of TLS in Mina and is it related to
https://issues.apache.org/jira/projects/DIRMINA/issues/DIRMINA-1180? Do you
plan to return the old behavior in case of tls error to invoke
s.getHandler().sessionClosed(session); in TailFilter or other filter or it will
not be guaranteed?
Regards,
Tatyana
On Friday, April 24, 2026 at 06:14:00 PM GMT+3, T.Nalbantova via dev
<[email protected]> wrote:
Hi,
The feature is null and there is not an exception at this code, but when I
tested both Mina 2.2.1 and 2.2.5 and debug in parallel seems this code is not
invoked for 2.2.5
((AbstractIoService)
session.getService()).getListeners().fireSessionDestroyed(session);
fireSessionDestroyed is not invoked I think because of ClassNotFoundException
of AbstractIoService and now I will investigate is there something missing in
our setup.
The same method in Mina is working for 2.2.1
Regards,Tatyana
On Wednesday, April 22, 2026 at 02:45:21 AM GMT+3, Emmanuel Lecharny
<[email protected]> wrote:
Hi
On 4/21/26 16:49, T.Nalbantova via dev wrote:
> Actually the issue is from Mina 2.2.3 and now I try to find how to
>fix/workaround sessionClosed to be invoked in case of TLS error, because
>sessionClosed invokes the method onDisconnect of the apache ftplet.
If you get a TLS error, an SSLException should be thrown, and at the
end, it should be handled in the AbstractPollingIoProcess.read(session
method:
...
} catch(Exception e) {
if((einstanceofIOException) &&
(!(einstanceofPortUnreachableException)
|| !AbstractDatagramSessionConfig.class.isAssignableFrom(config.getClass())
|| ((AbstractDatagramSessionConfig) config).isCloseOnPortUnreachable())) {
scheduleRemove(session);
}
IoFilterChain filterChain= session.getFilterChain();
filterChain.fireExceptionCaught(e);
}
}
The fireExceptionCaught method will close the session immediately:
/**
* {@inheritDoc}
*/
@Override
publicvoidfireExceptionCaught(Throwable cause) {
callNextExceptionCaught(head, session, cause);
}
privatevoidcallNextExceptionCaught(Entry entry, IoSession session,
Throwable cause) {
// Notify the related future.
ConnectFuture future= (ConnectFuture)
session.removeAttribute(SESSION_CREATED_FUTURE);
if(future== null) {
try{
IoFilter filter= entry.getFilter();
NextFilter nextFilter= entry.getNextFilter();
filter.exceptionCaught(nextFilter, session, cause);
} catch(Throwable e) {
LOGGER.warn("Unexpected exception from exceptionCaught handler.", e);
}
} else{
// Please note that this place is not the only place that
// calls ConnectFuture.setException().
if(!session.isClosing()) {
// Call the closeNow method only if needed
session.closeNow();
}
future.setException(cause);
}
}
I have not a running test atm, so it's from the top of my head...