[ 
https://issues.apache.org/jira/browse/JCS-207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Thomas Vandahl resolved JCS-207.
--------------------------------
    Fix Version/s: jcs-3.1
         Assignee: Thomas Vandahl
       Resolution: Fixed

Fixed in master

> JCSAdmin.jsp throws ClassCastException java.util.LinkedList cannot be cast to 
> [Lorg.apache.commons.jcs3.admin.CacheRegionInfo
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCS-207
>                 URL: https://issues.apache.org/jira/browse/JCS-207
>             Project: Commons JCS
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: jcs-3.0
>            Reporter: Reval Pal
>            Assignee: Thomas Vandahl
>            Priority: Minor
>             Fix For: jcs-3.1
>
>
> The sample JCSAdmin.jsp on URL 
> https://raw.githubusercontent.com/apache/commons-jcs/master/commons-jcs-core/src/main/java/org/apache/commons/jcs3/admin/JCSAdmin.jsp
>  as referred to by https://commons.apache.org/proper/commons-jcs/faq.html
> {quote}
> Where can I get the admin jsp?
> You can download the admin jsp here .
> {quote}
> Throws exception when running:
> {code}
> org.apache.jasper.JasperException: JBWEB004038: An exception occurred 
> processing JSP page /JCSAdmin.jsp at line 254
> 254
> 251:          Retrieve (key) <input type="text" name="key"> &nbsp;
> 252:          (region) <select name="cacheName">
> 253: <%
> 254:   CacheRegionInfo[] listSelect = (CacheRegionInfo[]) context.get( 
> "cacheInfoRecords" );
> 255:   for (CacheRegionInfo record : listSelect)
> 256:   {
> 257:  %>
> Caused by: java.lang.ClassCastException: java.util.LinkedList cannot be cast 
> to [Lorg.apache.commons.jcs3.admin.CacheRegionInfo;
>       at org.apache.jsp.JCSAdmin_jsp._jspService(JCSAdmin_jsp.java:389)
>       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
>       at 
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
> {code}
> h3. Solution
> 3 places to fix:
> 1)
> {code} line 203 :
> <%
>       CacheElementInfo[] list = (CacheElementInfo[]) context.get( 
> "elementInfoRecords" );
>     for (CacheElementInfo element : list)
>     {
> %>
> {code}
> should be
> {code}
> <%
>     for (CacheElementInfo element : 
> (java.util.List<CacheElementInfo>)context.get( "elementInfoRecords" ))
>     {
> %>
> {code}
> 2)
> {code} line 253
> <%
>   CacheRegionInfo[] listSelect = (CacheRegionInfo[]) context.get( 
> "cacheInfoRecords" );
>   for (CacheRegionInfo record : listSelect)
>   {
> {code}
> should be
> {code}
> <%
>     for (CacheRegionInfo record : 
> (java.util.List<CacheRegionInfo>)context.get( "cacheInfoRecords" ))
>     {
> {code}
> 3)
> {code} line 279
> <%
>       CacheRegionInfo[] list = (CacheRegionInfo[]) context.get( 
> "cacheInfoRecords" );
>     for (CacheRegionInfo record : listSelect)
>     {
> %>
> {code}
> should be
> {code}
> <%
>     for (CacheRegionInfo record : 
> (java.util.List<CacheRegionInfo>)context.get( "cacheInfoRecords" ))
>     {
> %>
> {code}
> (*) Also some styling nitpicking:
> {code} line 229
>     <pre>
>       <%=stats%>
>     </pre>
> {code}
> should be
> {code}
> <pre>
> <%=stats%>
> </pre>
> {code}
> (removes the spaces in the rendered page).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to