3 Replies Latest reply on Aug 23, 2009 11:46 AM by jberdat2

    No such method --> org.jboss.portal.portlet.impl.jsr168.api.

      Hello,

      On my xhtml page I've the following tag:

      <a:mediaOutput element="img" cacheable="false" session="true" createContent="#{quoteAction.generateChart}" mimeType="image/png" />
      


      And it seems that this entry causes the following exception as it is looking for an outputstream to write the image:

      15:39:45,557 ERROR [home_prototype_portal_quote_portlet_QuoteListPortlet] The portlet threw an exception
      javax.faces.FacesException: java.lang.NoSuchMethodException: org.jboss.portal.portlet.impl.jsr168.api.ResourceResponseImpl.getOutputStream()
       at org.ajax4jsf.resource.FacesResourceContext.getOutputStream(FacesResourceContext.java:124)
       at org.ajax4jsf.resource.UserResource.send(UserResource.java:108)
      


      And obviously, the method getOutputStream does not exists as it is getPortletOutputStream. Does someone knows what I could have misconfigured.

      Regards,


        • 1. Re: No such method --> org.jboss.portal.portlet.impl.jsr168.
          wesleyhales

          Try this when you generate the chart:

          Object responseObject = FacesContext.getCurrentInstance().getExternalContext().getResponse();
           if (responseObject instanceof RenderResponse) {
           BufferedRenderResponseWrapper brrw = (BufferedRenderResponseWrapper)responseObject;
           RenderResponse response = brrw.getResponse();
           response.getPortletOutputStream().write(getFiles().get((Integer)object).getData());
          
           }else{
           //servlet response
           stream.write(getFiles().get((Integer)object).getData());
           }
          
          


          • 2. Re: No such method --> org.jboss.portal.portlet.impl.jsr168.

            The problem is that the request is not even reaching my method for generating the chart. It crashes when trying to get the outputStream (maybe a question for rich faces guys). The ajax4jsf tag need to have a method with the following parameters: genChart(OutputStream out, Object value)

            So I think I've misconfigured something, because org.ajax4jsf.resource.FacesResourceContext.getOutputStream lookup the stream on ResourceResponseImpl.getOutputStream instead of ResourceResponseImpl.getPortletOutputStream.

            • 3. Re: No such method --> org.jboss.portal.portlet.impl.jsr168.

              I've done the following which solved my problem. I overwrite the class:
              org.jboss.portal.portlet.impl.jsr168.api.MimeResponseImpl

              and added the following:


              public OutputStream getOutputStream() throws IOException {
              return this.getPortletOutputStream();
              }