title: Need to catch and display the Stack overflow error message
body: <p>I am fetching some 17,500 records from DB and getting below stack overflow error exactly at the resultset execution step.</p>
  
  <pre><code>Query query = dbConnect
                  .createQuery("select nitem from NItem nitem where nitem.id in ("+nitemIdStr+")");
          nitemList = query.getResultList();
  </code></pre>
  
  <p>Stack overflow error</p>
  
  <pre><code>Root cause:
  
  java.lang.StackOverflowError
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:98)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
   at org.apache.openjpa.jdbc.kernel.exps.OrExpression.acceptVisit(OrExpression.java:99)
  
  
   Complete stack:
  
   org.apache.wicket.WicketRuntimeException: Method onRequest of interface org.apache.wicket.behavior.IBehaviorListener targeted at com.rambutan.test.ExportNew$3@17adeb on component [Form [Component id = ajaxexample]] threw an exception
  
  at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
   at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
   at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:247)
   at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226)
   at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:854)
   at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
   at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
   at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
   at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
   at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
  
  java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
   at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
   at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:247)
   at org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226)
   at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:854)
   at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
   at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
   at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
   at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
   at org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
  </code></pre>
  
  <p>I need to catch this error and display it in UI with a message saying "The file export exceeding the stack limit, Please use filter conditions" instead of getting in stack overflow error in the browser. is this possible?</p>