3 Replies Latest reply: Aug 5, 2008 3:18 AM by 630184 RSS

    java.lang.OutOfMemoryError when viewing JSP with records from Oracle DB

    630184
      Hi,

      I did an import of data from my damp file.I have exported the file from my other Oracle10g database I have the following error after I try to access data from my table I populated with import:

      javax.servlet.ServletException: Servlet execution threw an exception
           org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

      root cause

      java.lang.OutOfMemoryError: Java heap space
           oracle.jdbc.driver.DateTimeCommonAccessor.getDate(DateTimeCommonAccessor.java:105)
           oracle.jdbc.driver.OracleResultSetImpl.getDate(OracleResultSetImpl.java:737)
           oracle.jdbc.driver.OracleResultSet.getDate(OracleResultSet.java:1637)
           org.apache.tomcat.dbcp.dbcp.DelegatingResultSet.getDate(DelegatingResultSet.java:255)
           com.myapp.app.OrderHelper.getAllOrders(OrderHelper.java:4137)
           com.myapp.app.GetOrderDO.execute(GetOrderDO.java:172)
           org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
           org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
           org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
           org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
           org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

      a fragment of my OrderHelper with line where error occurs (line 4137):

      public class Orders {

      public List getAllOrders(){

      List lineOrders = new ArrayList();
      Connection conn = null;
      Statement stat = null;
      ResultSet rst = null;
      OrdersDTO order = null;
      String select = "SELECT * FROM TBL_ORDERS";

      DbConnection dbConn = new DbConnection();
      try {
      conn = dbConn.getDbConnection(Constants.MY_JNDI);
      stat = conn.createStatement();
      rst = stat.executeQuery(select);

      while(rst.next()){
      order = new OrdersDTO();

      order.setOrderAsmtDate(rst.getDate("order_asmt_date"));////line: 4137

      lineOrders.add(order);
      }
      }catch (SQLException ex) {
      ex.printStackTrace();
      } finally{
      SQLHelper.cleanUp(rst, stat, conn);
      }

      return lineOrders;
      }

      }

      GetOrderDO.java is just my action class which calls the getAllOrders method for my JSP to list orders. Am using Apache Tomcat/5.5.17 and struts 1.2.9 and Orcale10g.

      thnx,
      xsiyez