AnsweredAssumed Answered

Unable to read content using Webservice

Question asked by mahkath on Apr 6, 2009
Latest reply on Oct 7, 2009 by alex_b
Hi All,

When I'm trying to read the content using ContentUtils.getContentAsInputStream() API.

Intermittently I'm getting below exception(red & blue color) in Alfresco and the content is not read.

I'm getting exceptions in both Alfresco and in our Application server.
Exception in red color is thrown in our application server.
Exception in blue color is thrown in Alfresco server.

Can anyone have any idea why this exception happens?

org.alfresco.webservice.util.WebServiceException: Unable to get content as inputStream.
        at org.alfresco.webservice.util.ContentUtils.getContentAsInputStream(ContentUtils.java:128)
        at com.adworks.fotofusion.alfresco.AlfrescoService.readContent(AlfrescoService.java:561)
        at com.adworks.fotofusion.property.video.servlets.GetFlv.doGet(GetFlv.java:77)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://mag-foto:8081/alfresco/download/direct/workspace/SpacesStore/3c7b1f4f-220b-11de-b8ab-7744e7ac7dca/TEST-TEMPLATE-13_lowresflv.flv?ticket=TICKET_b6547b4e20346322b8288977d91ed488cf49253f
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1174)
        at org.alfresco.webservice.util.ContentUtils.getContentAsInputStream(ContentUtils.java:124)
        … 22 more


ERROR http-8081-Processor22 org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/alfresco].[downloadContent] - Servlet.service() for servlet downloadContent threw exception
java.lang.IllegalStateException: Cannot create a session after the response has been committed
   at org.apache.catalina.connector.Request.doGetSession(Request.java:2221)
   at org.apache.catalina.connector.Request.getSession(Request.java:2031)
   at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:832)
   at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:843)
   at org.alfresco.web.app.servlet.BaseServlet.redirectToLoginPage(BaseServlet.java:187)
   at org.alfresco.web.app.servlet.BaseServlet.servletAuthenticate(BaseServlet.java:152)
   at org.alfresco.web.app.servlet.BaseServlet.servletAuthenticate(BaseServlet.java:117)
   at org.alfresco.web.app.servlet.DownloadContentServlet.doGet(DownloadContentServlet.java:100)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
   at java.lang.Thread.run(Thread.java:595)


Thanks in Advance.

Regards,
Mahesh Dathrika

Outcomes