Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-44880

SAMIGO - Error on log when printing PDF assessment that contains a BASE64 image

    XMLWordPrintable

    Details

    • 21 Status:
      Resolved
    • 20 status:
      Resolved
    • Test Plan:
      Hide

      You should paste base64 images on CKeditor: https://jira.sakaiproject.org/browse/SAK-44308

      Add an assessment with a multiple choice question

      As instructions paste a base64 image

      Print PDF

      No error on log and the image should appear on the PDF

      Show
      You should paste base64 images on CKeditor: https://jira.sakaiproject.org/browse/SAK-44308 Add an assessment with a multiple choice question As instructions paste a base64 image Print PDF No error on log and the image should appear on the PDF

      Description

      Error on log when printing PDF assessment that contains a BASE64 image

      16-dic-2020 09:55:29.105 ERROR [ajp-nio-127.0.0.1-8014-exec-10] org.sakaiproject.tool.assessment.pdf.itext.HTMLWorker.startElement /home/tomcat/https:/aulavirtual.um.esdata:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAF6CAYAAACDavgnAAAgAElEQVR4nOydeXwUVbr3w30/74xz37lzvTOjc0fH0RkREVxhZHBkUURxAWWTJSwJa9hC2ILsoCh....ijIAiCIOgQYxQEQRAEHWKMgiAIgqBDjFEQBEEQdIgxCoIgCIIOMUZBEARB0CHGKAiCIAg6xBgFQRAEQYcYoyAIgiDoEGMUBEEQBB1ijIIgCIKgQ4xREARBEHSIMQqCIAiCDjFGQRAEQdAhxigIgiAIOv4/4RmYru/YiqQAAAAASUVORK5CYII= (Nombre de fichero demasiado largo)
      java.io.FileNotFoundException: /home/tomcat/https:/aulavirtual.um.esdata:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAF6CAYAAACDavgnAAAgAElEQVR4nOydeXwUVbr3w30/74xz37lzvTOjc0fH0RkREVxhZHBkUURxAWWTJSwJa9hC2ILsoCh...ijIAiCIOgQYxQEQRAEHWKMgiAIgqBDjFEQBEEQdIgxCoIgCIIOMUZBEARB0CHGKAiCIAg6xBgFQRAEQYcYoyAIgiDoEGMUBEEQBB1ijIIgCIKgQ4xREARBEHSIMQqCIAiCDjFGQRAEQdAhxigIgiAIOv4/4RmYru/YiqQAAAAASUVORK5CYII= (Nombre de fichero demasiado largo)
      	at java.io.FileInputStream.open0(Native Method)
      	at java.io.FileInputStream.open(FileInputStream.java:195)
      	at java.io.FileInputStream.<init>(FileInputStream.java:138)
      	at java.io.FileInputStream.<init>(FileInputStream.java:93)
      	at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
      	at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
      	at java.net.URL.openStream(URL.java:1067)
      	at com.lowagie.text.Image.getInstance(Unknown Source)
      	at com.lowagie.text.Image.getInstance(Unknown Source)
      	at org.sakaiproject.tool.assessment.pdf.itext.HTMLWorker.startElement(HTMLWorker.java:262)
      	at org.sakaiproject.tool.assessment.pdf.HTMLWorker.startElement(HTMLWorker.java:181)
      	at com.lowagie.text.xml.simpleparser.SimpleXMLParser.processTag(Unknown Source)
      	at com.lowagie.text.xml.simpleparser.SimpleXMLParser.go(Unknown Source)
      	at com.lowagie.text.xml.simpleparser.SimpleXMLParser.parse(Unknown Source)
      	at org.sakaiproject.tool.assessment.pdf.itext.HTMLWorker.parse(HTMLWorker.java:152)
      	at org.sakaiproject.tool.assessment.pdf.HTMLWorker.parseToList(HTMLWorker.java:75)
      	at org.sakaiproject.tool.assessment.ui.bean.print.PDFAssessmentBean.getStream(PDFAssessmentBean.java:1068)
      	at org.sakaiproject.tool.assessment.ui.bean.print.PDFAssessmentBean.getPDFAttachment(PDFAssessmentBean.java:847)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.apache.el.parser.AstValue.invoke(AstValue.java:247)
      	at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
      	at org.apache.jasper.el.JspMethodExpression.invoke(JspMethodExpression.java:74)
      	at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
      	at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      	at javax.faces.component.UICommand.broadcast(UICommand.java:330)
      	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:870)
      	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1418)
      	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
      	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:201)
      	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:670)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:426)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      	at org.sakaiproject.jsf.util.SamigoJsfTool.dispatch(SamigoJsfTool.java:360)
      	at org.sakaiproject.jsf2.util.JsfTool.doPost(JsfTool.java:250)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712)
      	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:459)
      	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:352)
      	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
      	at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:508)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1500)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doToolBuffer(SiteHandler.java:1262)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.bufferContent(SiteHandler.java:1096)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doSite(SiteHandler.java:508)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:280)
      	at org.sakaiproject.portal.charon.handlers.SiteHandler.doGet(SiteHandler.java:164)
      	at org.sakaiproject.portal.charon.handlers.WorksiteHandler.doPost(WorksiteHandler.java:69)
      	at org.sakaiproject.portal.charon.SkinnableCharonPortal.doPost(SkinnableCharonPortal.java:1173)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.sakaiproject.util.RequestFilter.doFilter(RequestFilter.java:475)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
      	at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
      	at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:431)
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      16-dic-2020 09:56:17.872 ERROR [ajp-nio-127.0.0.1-8014-exec-11] org.sakaiproject.tool.assessment.pdf.itext.HTMLWorker.startElement /home/tomcat/https:/aulavirtual.um.esdata:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAF6CAYAAACDavgnAAAgAElEQVR4nOydeXwUVbr3w30/74xz37lzvTOjc0fH0RkREVxhZHBkUURxAWWTJSwJa9hC2ILsoCh 
      
      

       

      Solution: https://stackoverflow.com/questions/13843736/parsing-html-to-pdf-with-itext-image-base64

        Gliffy Diagrams

          Zeplin

            Attachments

              Issue Links

                Activity

                  People

                  Assignee:
                  jesusmmp Jesus Maria Mendez
                  Reporter:
                  jesusmmp Jesus Maria Mendez
                  Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                    Dates

                    Created:
                    Updated:
                    Resolved:

                      Git Integration