ICEfaces
  1. ICEfaces
  2. ICE-2112

OutputChart throws java.lang.ClassCastException when running a portlet

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#1
    • Fix Version/s: 1.7DR#1, 1.7
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Portal

      Description

      One of the methods of OutputChart makes a cast to ServletContext. This causes an exception when running in a portal environment. The method is getPath:

          public String getPath() {
              String folder = "/";
              if (getFacesContext() != null &&
                  getFacesContext().getExternalContext() != null) {
                  if (DOMResponseWriter.isStreamWriting()) {
                      folder = "./web/chart/images";
                  } else {
                      folder =
                              ((ServletContext) getFacesContext().getExternalContext()
                                      .getContext()).getRealPath("/charts");
                  }
              }
              return folder;
          }


      I did a quick search of the component section of the repository and only found one other reference in InputFile but it might be legitimate as file upload is handled in a servlet context.

        Issue Links

          Activity

          Hide
          Jack Van Ooststroom added a comment -

          Changed Fix Version to 1.7 DR#1.

          As a tip Mircea suggested to look into a bit of refactoring of this method to use the ResourceRegistry instead of the ServletContext. Adnan, can you check to see if this is a feasible solution for ICEfaces 1.7 DR#1?

          Show
          Jack Van Ooststroom added a comment - Changed Fix Version to 1.7 DR#1. As a tip Mircea suggested to look into a bit of refactoring of this method to use the ResourceRegistry instead of the ServletContext. Adnan, can you check to see if this is a feasible solution for ICEfaces 1.7 DR#1?
          Hide
          Adnan Durrani added a comment -

          Revision 14879. New ResourceRegistry API used.

          Show
          Adnan Durrani added a comment - Revision 14879. New ResourceRegistry API used.

            People

            • Assignee:
              Unassigned
              Reporter:
              Deryk Sinotte
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: