You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Stan Pinte <st...@wanadoo.be> on 2001/07/23 12:51:00 UTC

org.apache.jetspeed.portal.portlets.ServletInvokerPortlet examples or experiences...

hello,

I posted mails to the jetspeed-user and jetspeed-cvs lists previous week. I 
guess they were badly written, because I could'nt get an answer.

I reformulate: I am trying to include a Servlet I have written in a 
jetspeed portal. Therefore, I am using the class 
org.apache.jetspeed.portal.portlets.ServletInvokerPortlet.

I am having problems with this class. My servlet is invoked, but, when 
returning from the service() method, something goes wrong in the 
jetspeed/turbine framework, in one of Jetspeed classes:

I am getting the following exception, which points to some problem related 
to the usage of the servlet framework. It seems the OutputStream buffer is 
being specified its size, after having been written to, or having been 
flushed.

Horrible Exception: java.lang.IllegalStateException: especificando el 
buffer despues de escrbirlo al writer
         at 
org.apache.tomcat.core.ResponseImpl.setBufferSize(ResponseImpl.java:365)
         at 
org.apache.tomcat.facade.HttpServletResponseFacade.setBufferSize(HttpServletResponseFacade.java:277)
         at 
org.apache.jetspeed.modules.pages.JetspeedJspPage.doBuildBeforeAction(JetspeedJspPage.java:92)
         at 
org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:137)
         at org.apache.turbine.modules.Page.build(Page.java:90)
         at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:123)
         at org.apache.turbine.Turbine.doGet(Turbine.java, Compiled Code)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at 
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at 
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at 
org.apache.tomcat.facade.RequestDispatcherImpl.doInclude(RequestDispatcherImpl.java:400)
         at 
org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:270)
         at com.focusnet.util.HttpUtil.redirect(HttpUtil.java:91)
         at com.focusnet.test.MyServlet.service(MyServlet.java:89)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at 
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at

This is the same exception you would get if you would fo the following in a 
servlet

OutputStream out = Response.getOutputStream(); //get a ref to the buffer
out.print(...); //prints out some content to the buffer
out.flush(); //flush it...(sends it to the client)
Response.setBufferSize(aBufferSize); //set the size of the response buffer...

So I suspect Something is wrong somewhere, in the way the jetspeed/turbine 
framework handles the servlet...and its returned content. In my servlet,  I 
use the RequestDispatcher.forward(...) method to redirect the output to 
JSP, for content rendering. I tried changing this to 
RequestDispatcher.include(...), but the exception I get is still the same.

So the question are the following:

-has anyone tested this class?
-has anyone experienced the same symptoms?
-has anyone got a full comprehension of what is happening with the servlet 
OutputStream, and in whcih order it is processed/consumed/used in the 
jetspeed/turbine framework?
-has anyone got the same problem with another Portlet class?

I am taking the following actions: I will delve into the jetspeed code, and 
see

-how other portlets use the ServletFramework to render content
-how the OutpuStream is being called by in the framework...

thanks a lot,

Stan.


Stanislas Pinte
Computer Consultant

Sales Director
Alto Software

20 Pl St Jacques
B-4000 Liège
Tel+Fax: +32 -(0)4 221 35 08
GSM: +32 -(0)478 57 61 80
web: http://www.altosw.be
email: stan@altosw.be