Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-3138

java.lang.ClassCastException in JSP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.2.7
    • None
    • Tag Libraries
    • None
    • Struts 1.2.7, JDK 1.4.2 and Oracle 10g OC4J.
    • Important

    Description

      Hi All,

      We are facing "java.lang.ClassCastException" in JSP page. Below are JSP code, printStackTrace and compiled JSP (from Application Server) file.

      JSP Code:

      <nested:iterate property="coverage">
      <tr>
      <td class="text" align="left" valign="top" width="198" height="2">
      <html:hidden name="coverage" property="coverageType" indexed="true"/>
      <bean:write name="coverage" property="coverageDescription"/>
      .
      .
      .
      .
      </nested:iterate>

      printStackTrace:

      08/03/26 15:48:07 java.lang.ClassCastException
      08/03/26 15:48:07 at _jsp._quickquote._Coverages._jspService(_Coverages.java:244)
      08/03/26 15:48:07 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
      08/03/26 15:48:07 at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:569)
      08/03/26 15:48:07 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:305)
      08/03/26 15:48:07 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
      08/03/26 15:48:07 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
      08/03/26 15:48:07 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.include(ServletRequestDispatcher.java:121)
      08/03/26 15:48:07 at com.evermind.server.http.EvermindPageContext.include(EvermindPageContext.java:267)
      08/03/26 15:48:07 at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99)
      08/03/26 15:48:07 at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135)
      08/03/26 15:48:07 at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760)
      08/03/26 15:48:07 at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:892)
      08/03/26 15:48:07 at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)
      08/03/26 15:48:07 at _jsp._template._mainLayout._jspService(_mainLayout.java:93)
      08/03/26 15:48:07 at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
      08/03/26 15:48:07 at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
      08/03/26 15:48:07 at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
      08/03/26 15:48:07 at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
      08/03/26 15:48:07 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222)
      08/03/26 15:48:07 at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
      08/03/26 15:48:07 at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
      08/03/26 15:48:07 at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:239)
      08/03/26 15:48:07 at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:302)
      08/03/26 15:48:07 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
      08/03/26 15:48:07 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
      08/03/26 15:48:07 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      08/03/26 15:48:07 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      08/03/26 15:48:07 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222)
      08/03/26 15:48:07 at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
      08/03/26 15:48:07 at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263)
      08/03/26 15:48:07 at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
      08/03/26 15:48:07 at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318)
      08/03/26 15:48:07 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
      08/03/26 15:48:07 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
      08/03/26 15:48:07 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
      08/03/26 15:48:07 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
      08/03/26 15:48:07 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:824)
      08/03/26 15:48:07 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
      08/03/26 15:48:07 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
      08/03/26 15:48:07 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
      08/03/26 15:48:07 at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
      08/03/26 15:48:07 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
      08/03/26 15:48:07 at java.lang.Thread.run(Thread.java:534)

      Error is coming in compiled JSP:

      org.apache.struts.taglib.bean.WriteTag __jsp_taghandler_12=(org.apache.struts.taglib.bean.WriteTag)OracleJspRuntime.getTagHandler(pageContext,org.apache.struts.taglib.bean.WriteTag.class,"org.apache.struts.taglib.bean.WriteTag name property");

      In Struts Action we have used below code

      CoverageModel[] cs = (CoverageModel[])coverageCol.toArray(new CoverageModel[0]);
      f.set("coverage", cs);

      We are facing above exception after 6/8 hours of Application restart. . Some time we not facing above exception till 48hrs.
      5 users accessing application day time.

      e.g.
      If we restart server @ 1 PM then try to login with new browser session at 7 PM or 9 PM, we are facing "java.lang.ClassCastException" on JSP page.

      If we restart Applcation Server then code is working fine. After restart, we not get null pointer class cast exception for next 6/8 hour.

      Please let me know if anybody has any suggestion/solution.

      Thanks and Regards,
      Kailas

      Attachments

        1. Stack_Trace.txt
          4 kB
          Kailas Kore

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kailas_kore Kailas Kore
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: