The problem has been solved changing the SSL port to 8843, now the connection is set correctly in this port.
Maybe it can not be the same port as AJP redirect port.
Finally, the explanation about my wrong ports numbers is:
My http port number in bindings-jboss-beans.xml (directory: JBOSS_HOME\server\default\conf\bindingservice.beans\META-INF) is 8008, so JPA port is replaced by 8008-71=7937 and SSL port is replaced by 8008+363=8371.
So changing http port number in that file can be another solution for someone who has the same problem.