Description of problem: Due to bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6337993 in Java regular expressions implementation we suffer from the stack overflow errors when parsing "long" directives. An example could be some conditional rules for logging like (an artifical example, in reality each of the below IPs would be different): SetEnvIf Remote_Addr "(111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111|111\.111\.111\.111)" specialrequests CustomLog logs/access_log common env=!specialrequests How reproducible: always Steps to Reproduce: 1. Modify httpd.conf and add a long directive similar to the one above 2. run discovery on the agent Actual results: stack overflow error during apache server discovery Expected results: no exceptions, config files parsed successfully Additional info: Workaround is to increase the stack size of the JVM: RHQ_AGENT_ADDITIONAL_JAVA_OPTS='-Xss10M' bin/rhq-agent.sh