Viewing 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #28958

    Since we get no log messages at all and no timeout, my colleague has run a dtruss (a sort of strace for mac) to see what system calls we can see.

    It reads images but doesn’t then seem to do anything with them.
    It appears to stop after looking for PD4CanvasHandler.class. This has something to do with Rhino as you can see from the following link, but this may not be significant, because presumably it should just look for the class and not worry if it doesn’t find it.

    html-pdf-faq-f1/html5-canvas-anyone-working-on-such-a-thing-for-pd4ml-t370.html

    Perhaps we should send you a trace. If this might be useful can you tell us where to send it? We will try to make it as clean and concise as possible.

    We also tried just increasing memory for Tomcat, but to no avail.
    As I think I mentioned in another post, our production server, which runs on open BSD with the same maven configuration, has no problems, so it seems to be a system problem.

    #28959

    Thank you for the input!

    So, most probably, it hangs in the following code:

    [language=java:1376b11o]private boolean hasCanvasInterpreter() {
    Class c;
    try {
    try {
    c = Class.forName(PD4Constants.PD4ML_EXTERNAL_CANVAS_HANDLER);
    } catch (ClassNotFoundException e) {
    try {
    c = Thread.currentThread().getContextClassLoader().loadClass(PD4Constants.PD4ML_EXTERNAL_CANVAS_HANDLER);
    } catch (ClassNotFoundException e1) {
    c = ResourceCache.class.getClassLoader().loadClass(PD4Constants.PD4ML_EXTERNAL_CANVAS_HANDLER);
    }
    }
    } catch (Exception e) {
    return false;
    }

    if ( c != null ) {
    return true;
    }

    return false;
    }[/language:1376b11o]

    I see nothing dangerous in it. It looks like it hits some class loader implementation specific issues.

    #28960

    Is the trace any use to you?

    #28961

    P.S. our OSX is a bit more advanced than yours.

    We have OSX 10.7.4

    #28962

    I’ve just sent to you a link to an updated version. Please check if our workaround helps.

    #28963

    Unfortunately not.
    We still have the same problem.

    #28964

    Next week we plan to analyze the problem in depth and find a solution

    #28965

    Ok, thankyou.
    Clearly we’re a bit worried about this so please keep us posted. Thanks.

    #28966

    In the meantime we tried a variety of environments. Here is my current state:
    [language=xml:1c85moiu]igors-imac:bin igor$ sudo ./daemon.sh version
    Password:
    Still running according to PID file /Library/Tomcat//logs/catalina-daemon.pid, PID is 5901
    jsvc (Apache Commons Daemon) 1.0.10
    Copyright (c) 1999-2011 Apache Software Foundation.
    java version “1.6.0_33”
    Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
    Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
    commons daemon version “1.0.10”
    commons daemon process (id: 5914, parent: 5913)
    Server version: Apache Tomcat/7.0.27
    Server built: Mar 31 2012 03:43:36
    Server number: 7.0.27.0
    OS Name: Mac OS X
    OS Version: 10.7.4
    Architecture: x86_64
    JVM Version: 1.6.0_33-b03-424-11M3720
    JVM Vendor: Apple Inc.[/language:1c85moiu]

    The servlet code I used for tests:
    [language=java:1c85moiu]import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.net.URL;

    import javax.servlet.ServletOutputStream;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;

    import org.zefer.pd4ml.PD4Constants;
    import org.zefer.pd4ml.PD4ML;

    public class PD4MLServlet extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {

    URL url = new URL(“http://pd4ml.com/xindex.htm”);

    PD4ML html = new PD4ML();
    html.setPageSize( PD4Constants.A4 );
    html.setPageInsets( new java.awt.Insets(20, 50, 10, 10) );
    html.setHtmlWidth( 850 );

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    html.render( url, baos );

    byte[] result = baos.toByteArray();

    response.setContentType(“application/pdf”);
    response.setHeader(“Content-disposition”,”inline; filename=test.pdf”);
    response.setHeader(“Pragma”, “cache”);
    response.setHeader(“Expires”, “0”);
    response.setHeader(“Cache-control”, “private”);

    response.setContentLength(result.length);
    ServletOutputStream sos = response.getOutputStream();
    sos.write( result );
    }
    }[/language:1c85moiu]

    Everything works just fine. So it should be an issue of an interfere of PD4ML with some other libs on your side. Please try the servlet – it the conversion fails, try to exclude libs one-by-one from your project until it started to work. It would be great if you share the results with us.

    #28967

    I have tried your test servlet in a brand new web app, with only log4j log libraries and sl4j, and it just blocked, exactly as in all the other circumstances. So it’s not a library issue.

    It’s unlikely that the issue is related to libraries because it all works on linux with the same libraries.

    We have Tomcat 6 by the way, not 7. Don’t know if that makes any difference but it might.

    #28968

    The only suspicious classes may interfere with Tomcat belong to org.w3c package in ss_css2.jar. Try to temporarily remove ss_css2.jar. Does it block or throw an exception in the case?

    Another point is that PD4ML uses AWT classes (for example, fonts). In server-side scenarios it requires headless mode of JVM. Make sure Tomcat runs with -Djava.awt.headless=true JVM parameter.

    #28969

    We’ve had Tomcat headless for years, and we’ve been using PD4ML for years so that can be excluded.

    Removing ss_css2.jar throws an exception:
    java.lang.ClassNotFoundException: org.w3c.css.sac.CSSException
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
    org.zefer.html.doc.PD4MLHtmlParser.o00000(Unknown Source)
    org.zefer.html.doc.PD4MLHtmlParser.(Unknown Source)
    org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.taglib.PD4MLTransformerTag.render(Unknown Source)
    org.zefer.pd4ml.taglib.PD4MLTransformerTag.doEndTag(Unknown Source)
    org.apache.jsp.includedocs.houseInclude.PrintPdf_jsp._jspService(PrintPdf_jsp.java:294)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet._serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)

    #28970

    Try to unpack and temporarily to use the attached ss_css2.jar

    Please note – it is an inconsistent version of the lib – for troubleshooting purposes only.

    #28971

    I get an exception with this .jar as follows:
    java.lang.ClassNotFoundException: org.w3c.css.sac.Parser
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
    java.lang.ClassLoader.defineClass1(Native Method)
    java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2331)
    org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:976)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1451)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
    java.lang.Class.forName0(Native Method)
    java.lang.Class.forName(Class.java:169)
    org.zefer.html.doc.PD4MLHtmlParser.o00000(Unknown Source)
    org.zefer.html.doc.PD4MLHtmlParser.(Unknown Source)
    org.zefer.pd4ml.PD4ML.o00000(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.PD4ML.render(Unknown Source)
    org.zefer.pd4ml.taglib.PD4MLTransformerTag.render(Unknown Source)
    org.zefer.pd4ml.taglib.PD4MLTransformerTag.doEndTag(Unknown Source)
    org.apache.jsp.includedocs.houseInclude.PrintPdf_jsp._jspService(PrintPdf_jsp.java:294)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
    org.apache.jasper.servlet.JspServlet._serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
    org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
    org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
    org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)

    #28972

    P.S. please forgive my slow replies

    I’ve finally configured email notifications, however, so I can reply quicker,
    though I will be on hols from 14th July

Viewing 15 posts - 16 through 30 (of 33 total)

The forum ‘Deployment / Configuration issues’ is closed to new topics and replies.