2
I’m trying to create a friendly error page in case LDAP is off the air, but unfortunately the only answer I have is j_spring_security_check
.
I tried to map the exception in web.xml
, but I was unsuccessful.
<error-page>
<exception-type>java.net.SocketTimeoutException</exception-type >
<location>/408</location>
</error-page>
<error-page>
<exception-type>java.net.SocketTimeoutException</exception-type >
<location>/408</location>
</error-page>
Console error:
GRAVE: Servlet.service() for servlet [mvc-dispatcher] in context with path [/gpa-pesquisa] threw exception org.springframework.ldap.CommunicationException: 171.18.0.15:389; nested exception is javax.naming.CommunicationException: 171.18.0.15:389 [Root exception is java.net.SocketTimeoutException: connect timed out]
at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:108)
at org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:356)
at org.springframework.ldap.core.support.AbstractContextSource.doGetContext(AbstractContextSource.java:140)
at org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:159)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:357)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:309)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:616)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:586)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:1651)
at br.ufc.quixada.npi.ldap.dao.LdapUsuarioDao.getByCpf(LdapUsuarioDao.java:76)
Thank you, in my case I was giving error because I had mapped in the controller the error 500 only for the GET method and should map both for GET and POST.
– João Marcos Epifanio