nothing dodgy about the pluto code
the problem is with your JSF code as the pluto returns ServletOutputStream as
seen below
org.apache.pluto.container.impl.HttpServletPortletResponseWrapper extends
HttpServletResponseWrapper
@Override
public ServletOutputStream getOutputStream() throws IOException
{
return mimeResponse != null ?
(ServletOutputStream)mimeResponse.getPortletOutputStream() :
DummyServletOutputStream.getInstance();
}
//there is one ref to ByteArrayOutputStream which doesnt make sense since
ImportSupport$ImportResponseWrapper is extending HttpServletResponseWrapper:
class
org.apache.taglibs.standard.tag.common.core.ImportSupport$ImportResponseWrapper
extends javax.servlet.http.HttpServletResponseWrapper{
public
org.apache.taglibs.standard.tag.common.core.ImportSupport$ImportResponseWrapper(org.apache.taglibs.standard.tag.common.core.ImportSupport,
javax.servlet.http.HttpServletResponse);
public java.io.PrintWriter getWriter();
public javax.servlet.ServletOutputStream getOutputStream();
public void setContentType(java.lang.String);
public void setLocale(java.util.Locale);
public void setStatus(int);
public int getStatus();
public java.lang.String getString() throws
java.io.UnsupportedEncodingException;
static java.io.ByteArrayOutputStream
access$000(org.apache.taglibs.standard.tag.common.core.ImportSupport$ImportResponseWrapper);
}
2 suggestions:
get the source
http://fisheye5.cenqua.com/browse/glassfish/appserv-jstl/src/org/apache/taglibs/standard/tag/common/core/ImportSupport.java?r=1.5&k=
1)change all java.io.ByteArrayOutputStream to javax.servlet.ServletOutputStream
(HTTP input and output streams are text streams)
2)make a method which will cast ServletOutputStream to ByteArrayOutputStream
e.g.
downcast to java.io.OutputStream
then upcast to ByteArrayOutputStream
http://java.sun.com/j2se/1.4.2/docs/api/java/io/ByteArrayOutputStream.html
Viel Gluck,
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung.
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
interdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Date: Tue, 20 Apr 2010 14:04:10 -0700
> From: [email protected]
> To: [email protected]
> Subject: ClassCastException using Sun's jsf-portlet.jar in Pluto 2.0
>
>
> Hi, I am attempting to use Sun's jsf-portlet integration with Pluto 2.0. I
> get the following:
>
> Caused by: java.lang.ClassCastException:
> com.sun.faces.portlet.ByteArrayWebOutputStream cannot be cast to
> javax.servlet.ServletOutputStream
> at
> org.apache.pluto.container.impl.HttpServletPortletResponseWrapper.getOutputStream(HttpServletPortletResponseWrapper.java:234)
> at
> org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:792)
> at
> org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:339)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
> at
> org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
> at
> org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
> at
> org.apache.pluto.container.impl.PortletRequestDispatcherImpl.doDispatch(PortletRequestDispatcherImpl.java:174)
> at
> org.apache.pluto.container.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:227)
> at
> com.sun.faces.portlet.ExternalContextImpl.dispatch(ExternalContextImpl.java:147)
> at
> org.springframework.faces.webflow.ExternalContextWrapper.dispatch(ExternalContextWrapper.java:25)
> at
> com.sun.faces.portlet.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:371)
> at
> com.sun.faces.portlet.ViewHandlerImpl.renderView(ViewHandlerImpl.java:235)
> at
> org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:91)
> at org.springframework.faces.webflow.JsfView.render(JsfView.java:89)
> at
> org.springframework.webflow.engine.ViewState.render(ViewState.java:282)
> at
> org.springframework.webflow.engine.ViewState.doEnter(ViewState.java:186)
> at org.springframework.webflow.engine.State.enter(State.java:194)
> at org.springframework.webflow.engine.Flow.start(Flow.java:535)
> at
> org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:364)
> at
> org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:222)
> ... 69 more
>
> The JavaDocs for javax.portlet.MimeResponse indicates the
> getPortletOutputStream() method return value is of type
> java.io.OutputStream. Hence the cast to javax.servlet.ServletOutputStream in
> HttpServletPortletResponseWrapper seems dodgy. Can you confirm if this is an
> issue with Pluto's implementation that needs to be raised?
>
> Thanks,
> Rossen
>
>
>
>
>
> --
> View this message in context:
> http://old.nabble.com/ClassCastException-using-Sun%27s-jsf-portlet.jar-in-Pluto-2.0-tp28287922p28287922.html
> Sent from the Pluto - User mailing list archive at Nabble.com.
>
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4