title: SEVERE [http-nio2-8444-exec-242] java.lang.StackOverflowError
body: <p>We have a web portal here developed by a 3rd party team that we no longer work with unfortunately. This web portal is used to make calls to our Active Directory via LDAP to authenticate users so they can requests activation keys for their mobile devices.</p>
  
  <p>We are seeing these errors thrown every so often and the service does not work for these users:</p>
  
  <pre><code>25-Sep-2017 16:09:38.830 SEVERE [http-nio2-8444-exec-242] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [PortalServlet] in context with path [/selfserviceportal] threw exception [Servlet execution threw an exception] with root cause
   java.lang.StackOverflowError
  at java.util.regex.Pattern$5.isSatisfiedBy(Unknown Source)
  at java.util.regex.Pattern$5.isSatisfiedBy(Unknown Source)
  at java.util.regex.Pattern$CharProperty.match(Unknown Source)
  at java.util.regex.Pattern$Curly.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$SliceI.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Pattern$Loop.match(Unknown Source)
  at java.util.regex.Pattern$GroupTail.match(Unknown Source)
  at java.util.regex.Pattern$Curly.match0(Unknown Source)
  at java.util.regex.Pattern$Curly.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$Curly.match0(Unknown Source)
  at java.util.regex.Pattern$Curly.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$SliceI.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Pattern$Loop.matchInit(Unknown Source)
  at java.util.regex.Pattern$Prolog.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$GroupTail.match(Unknown Source)
  at java.util.regex.Pattern$Loop.match(Unknown Source)
  at java.util.regex.Pattern$GroupTail.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$Curly.match0(Unknown Source)
  at java.util.regex.Pattern$Curly.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$SliceI.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Pattern$Loop.match(Unknown Source)
  at java.util.regex.Pattern$GroupTail.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$Curly.match0(Unknown Source)
  at java.util.regex.Pattern$Curly.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$SliceI.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Pattern$Loop.match(Unknown Source)
  at java.util.regex.Pattern$GroupTail.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$Curly.match0(Unknown Source)
  at java.util.regex.Pattern$Curly.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$SliceI.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Pattern$Loop.matchInit(Unknown Source)
  at java.util.regex.Pattern$Prolog.match(Unknown Source)
  at java.util.regex.Pattern$GroupTail.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$Curly.match0(Unknown Source)
  at java.util.regex.Pattern$Curly.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$SliceI.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$GroupTail.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$Curly.match0(Unknown Source)
  at java.util.regex.Pattern$Curly.match(Unknown Source)
  at java.util.regex.Pattern$BmpCharProperty.match(Unknown Source)
  at java.util.regex.Pattern$SliceI.match(Unknown Source)
  at java.util.regex.Pattern$GroupHead.match(Unknown Source)
  at java.util.regex.Matcher.match(Unknown Source)
  at java.util.regex.Matcher.matches(Unknown Source)
  at com.good.selfservice.ldap.ActiveDirectory.searchInDistinguishedName(ActiveDirectory.java:121)
  at com.good.selfservice.ldap.ActiveDirectory.searchContextInDistinguishedName(ActiveDirectory.java:95)
  at com.good.selfservice.ldap.ActiveDirectory.findADGroupOfObject(ActiveDirectory.java:235)
  at com.good.selfservice.ldap.ActiveDirectory.findADGroupOfObject(ActiveDirectory.java:262)
  </code></pre>
  
  <p>The java:262 line is repeated many times until it stops and then recovers...</p>
  
  <p>I'm not a developer so could someone help me with this?</p>
  
  <p>Thanks a lot!</p>