cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Custom Dialog throws IOException Stream Closed

lieu2
Champ in-the-making
Champ in-the-making
Hello I am getting the following error message after following the instructions at the following website for Adding a custom dialog: http://wiki.alfresco.com/wiki/Adding_a_Custom_Dialog.

In my extension/web-client-config-custom.xml I have the following lines:
    
<config>
      <dialog-container>/jsp/dialog/container.jsp</dialog-container>
          <dialogs>
                  <dialog name="addContent" page="/jsp/extension/add-content-dialog.jsp" managed-bean="DmiAddContentDialog"
                                icon="/images/icons/add_content_large.gif" title="Add Content"
                                description="Adds a reference type to the selected node" />
          </dialogs>
    </config>
    <config>
      <wizard-container>/jsp/wizard/container.jsp</wizard-container>
      <wizards>

         <!– Definition of the create content wizard –>
         <wizard name="createContent" managed-bean="DmiCreateContentWizard"
                 title-id="custom_create_content_wizard_title" description-id="create_content_desc"
                 icon="/images/icons/new_content_large.gif">
            <step name="details" title-id="details" description-id="create_content_step1_desc">
               <!– <page path="/jsp/content/create-content-wizard/details.jsp" –>
               <page path="/jsp/extension/create-content-wizard/details.jsp"
                     title-id="create_content_step1_title"
                     description-id="create_content_step1_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="content" title-id="enter_content" description-id="create_content_step2_desc">
               <condition if="#{DmiCreateContentWizard.mimeType == 'text/html'}">
                  <page path="/jsp/content/create-content-wizard/create-html.jsp"
                        title-id="create_content_step2_title"
                        description-id="create_content_step2_desc"
                        instruction-id="default_instruction" />
               </condition>
               <!– Default to the inline text editor –>
               <page path="/jsp/content/create-content-wizard/create-text.jsp"
                     title-id="create_content_step2_title"
                     description-id="create_content_step2_desc"
                     instruction-id="default_instruction" />
            </step>
            <step name="summary" title-id="summary" description-id="summary_step_description">
                <page path="/jsp/wizard/summary.jsp" title-id="summary" description-id="summary_desc"
                        instruction-id="content_finish_instruction" />
                        </step>
         </wizard>
      </wizards>
   </config>

Exception:

java.io.IOException: Stream closed
        at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:210)
        at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:322)
        at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:353)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlResponseWriterImpl.write(HtmlResponseWriterImpl.java:581)
        at org.alfresco.web.ui.repo.component.UIDialogButtons.encodeBegin(UIDialogButtons.java:77)
        at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:467)
        at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
        at org.apache.jsp.jsp.dialog.container_jsp._jspx_meth_r_005fdialogButtons_005f0(container_jsp.java:1864)
        at org.apache.jsp.jsp.dialog.container_jsp._jspService(container_jsp.java:668)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
        at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
        at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
        at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
        at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy197.doFilter(Unknown Source)
        at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy197.doFilter(Unknown Source)
        at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Apr 22, 2011 1:41:11 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/alfresco] threw exception [javax.servlet.ServletException: javax.servlet.jsp.JspException: Stream closed] with root cause
java.io.IOException: Stream closed
        at org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:210)
        at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:322)
        at org.apache.jasper.runtime.JspWriterImpl.write(JspWriterImpl.java:353)
        at org.apache.myfaces.shared_impl.renderkit.html.HtmlResponseWriterImpl.write(HtmlResponseWriterImpl.java:581)
        at org.alfresco.web.ui.repo.component.UIDialogButtons.encodeBegin(UIDialogButtons.java:77)
        at javax.faces.webapp.UIComponentTag.encodeBegin(UIComponentTag.java:467)
        at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
        at org.apache.jsp.jsp.dialog.container_jsp._jspx_meth_r_005fdialogButtons_005f0(container_jsp.java:1864)
        at org.apache.jsp.jsp.dialog.container_jsp._jspService(container_jsp.java:668)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:391)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
        at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
        at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
        at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
        at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy197.doFilter(Unknown Source)
        at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)        at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at org.alfresco.repo.web.filter.beans.NullFilter.doFilter(NullFilter.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:116)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
        at $Proxy197.doFilter(Unknown Source)
        at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:58)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
Thank you for your help! You guys have been very helpful! I greatly appreciate it!
2 REPLIES 2

lieu2
Champ in-the-making
Champ in-the-making
Hope this information can allow someone to help me. I looked at the generated java code for the JSP for the Exception and I am not sure where the error lies. The error in this method is related javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363) which is called by this method below:

From Catalina/localhost/alfresco/org/apache/jsp/jsp/dialog/container_jsp.java

  private boolean _jspx_meth_r_005fdialogButtons_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_h_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
          throws java.lang.Throwable {
    javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
    javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
    //  r:dialogButtons
    org.alfresco.web.ui.repo.tag.DialogButtonsTag _jspx_th_r_005fdialogButtons_005f0 = (org.alfresco.web.ui.repo.tag.DialogButtonsTag) _005fjspx_005ftagPool_005fr_005fdialogButtons_0026_005fstyleClass_005fid_005fnobody.get(org.alfresco.web.ui.repo.tag.DialogButtonsTag.class);
    _jspx_th_r_005fdialogButtons_005f0.setPageContext(_jspx_page_context);
    _jspx_th_r_005fdialogButtons_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_h_005fform_005f0);
    // /jsp/dialog/container.jsp(193,0) name = id type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_r_005fdialogButtons_005f0.setId("dialog-buttons");
    // /jsp/dialog/container.jsp(193,0) name = styleClass type = null reqTime = true required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
    _jspx_th_r_005fdialogButtons_005f0.setStyleClass("wizardButton");
    int _jspx_eval_r_005fdialogButtons_005f0 = _jspx_th_r_005fdialogButtons_005f0.doStartTag();
    if (_jspx_th_r_005fdialogButtons_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
      _005fjspx_005ftagPool_005fr_005fdialogButtons_0026_005fstyleClass_005fid_005fnobody.reuse(_jspx_th_r_005fdialogButtons_005f0);
      return true;
    }
    _005fjspx_005ftagPool_005fr_005fdialogButtons_0026_005fstyleClass_005fid_005fnobody.reuse(_jspx_th_r_005fdialogButtons_005f0);
    return false;
  }

lieu2
Champ in-the-making
Champ in-the-making
I found my issue after turning up some more debugging as well looking at my web-client-custom-config.xml file again to see what I might have done wrong. After a few more fixes the IOException Stream Closed was due to:

Caused by: java.lang.IllegalAccessError: tried to access field org.alfresco.web.bean.dialog.BaseDialogBean.dictionaryService from class com.mycompany.alfresco.web.bean.content.custom.DmiAddContentDialog
at
com.mycompany.alfresco.web.bean.content.custom.DmiAddContentDialog.getReferences(DmiAddContentDialog.java:85)
… 94 more

Can someone tell me why I cannot access the Dictionary Service when my DmiAddContentDialog extends org.alfresco.web.bean.content.AddContentDialog.

So the hierarchy looks like:
java.lang.Object
  extended by org.alfresco.web.bean.dialog.BaseDialogBean
      extended by org.alfresco.web.bean.wizard.BaseWizardBean
          extended by org.alfresco.web.bean.content.BaseContentWizard
              extended by org.alfresco.web.bean.content.AddContentDialog
All Implemented Interfaces:
    java.io.Serializable, IDialogBean, IWizardBean