HTML to PDF / DOCX / RTF Java converter library Forums PD4ML v3 Archived Forums (Read Only) Troubleshooting image rendering not working for me (Websphere 4 on aix)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26270

    Im doing a proof of concept before we buy pd4ml, i have hit a show stopping problem. i believe its environmental, but im stuck figuring it out….

    Main problem:

    not being able to put ANY images into the rendered pdf document.
    they exist, have correct permissions and are accessible directly from the browser…
    so im unsure whats going on.

    Note: when i dont have any images the document renders fine and displays correctly in the browser.

    Environment:
    PD4ML Version: PD4ML 351b8 Pro (eval)

    WebSphere 4.0.7 on AIX 5.2
    jdk 1.3 – i know its a dinosaur.. but.. thats out of my control.

    Xvfb (virtual frame buffer) has been installed.
    not sure if the opengl extensions were installed though.

    following process is running (shows Xvfb)

    /usr/lpp/X11/bin/X :2 -vfb -force -x abx -x dbe -x GLX

    following lines added to start of the websphere startup script
    DISPLAY=127.0.0.1:2.0<br /> export DISPLAY<br />
    (note that the doco online says to use the following but it didnt work
    DISPLAY=3D127.0.0.1:0.0 nor did DISPLAY=3D127.0.0.1:2.0)
    When i added the 3d bit, i couldnt actually render any PDF files.

    The following tests are a result of running the ‘index4.jsp’ testfile (below). obviously i commented out each other test case so only a single test was running at once, and, if all test cases are commented out.. then the PDF renders fine in the browser. (minus picture of course).

    Test File:
    <%@ taglib uri="/WEB-INF/pd4ml.tld" prefix="pd4ml" %><%@page contentType="text/html; charset=ISO8859_1" %><pd4ml:transform<br /> screenWidth="800"<br /> pageFormat="A4"<br /> pageOrientation="portrait"<br /> pageInsets="10,10,10,10,points"<br /> enableImageSplit="false"<br /> encoding="default"<br /> fileName="myoutput.pdf"<br /> inline="true"<br /> debug="true"<br /> ><br /> <br /> <br /> <html><br /> <head><br /> <br /> <%<br /> String url = request.getScheme() + "://" +<br /> request.getServerName() + ":" +<br /> request.getServerPort() +<br /> request.getContextPath() + "/";<br /> %><br /> <BASE id="theBase" href="<%=url%>"><br /> </head><br /> <br /> <body><br /> <br /> Server Base Path = <%=url%><br /> <BR><BR><br /> <br /> <br /> <%--<br /> TEST 1<br /> This FAILS in pd4ml, works fine direct in browser<br /> <IMG src="http://testserver/wayne/wayne/my_logo.jpg" width=200 height=200><br /> --%><br /> <br /> <br /> <%--<br /> TEST 2<br /> This Fails but works fine as jsp, and when you look at the log and directly access the url shown there<br /> <IMG src="wayne/my_logo.jpg"><br /> --%><br /> <br /> <%--<br /> TEST 3<br /> <br /> This also Fails, but the file actually exists in the location.<br /> file permissions are ok, (owned by same user as the web app with rwx)<br /> <IMG src="file:///icsdata/red.gif" width=200 height=200><br /> --%><br /> <br /> <BR><BR><br /> Hello, World A4!<br /> </body><br /> </html><br /> </pd4ml:transform>

    Test Results:

    =======
    test1
    =======
    pdf is displayed, but minus picture.

    stdout.log
    [9/22/09 21:43:28:471 EST] 20c3b6bd SystemOut U version: PD4ML 351b8 Pro (eval)<br /> [9/22/09 21:43:28:480 EST] 20c3b6bd SystemOut U done in 9ms.<br /> [9/22/09 21:46:02:684 EST] 20c3b6bd SystemOut U version: PD4ML 351b8 Pro (eval)<br /> [9/22/09 21:46:02:693 EST] 20c3b6bd SystemOut U image not yet in cache: http://testserver/wayne/wayne/my_logo.jpg<br /> [9/22/09 21:46:02:693 EST] 20c3b6bd SystemOut U not yet in cache: http://testserver/wayne/wayne/my_logo.jpg;jsessionid=ZRF5GMB45OC4NKEXNQI3SVA<br /> [9/22/09 21:46:02:693 EST] 20c3b6bd SystemOut U testserver<br /> [9/22/09 21:46:02:693 EST] 20c3b6bd SystemOut U image http://testserver/wayne/wayne/my_logo.jpg has zero length.<br /> [9/22/09 21:46:02:693 EST] 20c3b6bd SystemOut U can not load image: http://testserver/wayne/wayne/my_logo.jpg<br /> [9/22/09 21:46:02:699 EST] 20c3b6bd SystemOut U done in 15ms.

    stderr.log
    blank

    i loading the image directly in the browser loads the picture fine. its a relatively small pic (64k..)

    =======
    test2
    =======
    pdf is displayed, but minus picture.

    stdout.log
    [9/22/09 21:51:24:520 EST] 20c3b6bd SystemOut U version: PD4ML 351b8 Pro (eval)<br /> [9/22/09 21:51:24:528 EST] 20c3b6bd SystemOut U image not yet in cache: http://testserver:80/wayne/wayne/my_logo.jpg<br /> [9/22/09 21:51:24:528 EST] 20c3b6bd SystemOut U not yet in cache: http://testserver:80/wayne/wayne/my_logo.jpg;jsessionid=SF03EONOLUX4QGIDSFI1I3Y<br /> [9/22/09 21:51:24:529 EST] 20c3b6bd SystemOut U testserver<br /> [9/22/09 21:51:24:529 EST] 20c3b6bd SystemOut U image http://testserver:80/wayne/wayne/my_logo.jpg has zero length.<br /> [9/22/09 21:51:24:529 EST] 20c3b6bd SystemOut U can not load image: wayne/my_logo.jpg<br /> [9/22/09 21:51:24:531 EST] 20c3b6bd SystemOut U done in 11ms.

    stderr.log
    blank

    same thing again, copying the url into the browser loads the picture.

    ========
    test3
    =========
    server takes about 45 seconds then returns Error 500, internal Server error.
    no PDF at all obviously.

    stdout.log:
    <br /> [9/22/09 21:55:55:364 EST] 20c3b6bd SystemOut U version: PD4ML 351b8 Pro (eval)<br /> [9/22/09 21:55:55:373 EST] 20c3b6bd SystemOut U image not yet in cache: file:/icsdata/red.gif<br /> [9/22/09 21:55:55:373 EST] 20c3b6bd SystemOut U not yet in cache: file:/icsdata/red.gif<br /> [9/22/09 21:56:35:716 EST] 20c3b6bd WebGroup X Servlet Error: : java.lang.OutOfMemoryError

    Now I know what you’re thinking… increase the JVM size with the recommended -Xmx512m… well these logs are from -Xmx768m.
    I think outofmemory error is not the root cause, because the more memory i give it the longer it waits then errors with out of memory.

    stderr.log:

    BlockElement(body) {margin-left=8, margin-right=8, font-family=[Ljava.lang.String;@2c167687, margin-bottom=8, margin-top=8, font-size=16, line-height=1.2000000476837158, display=block}<br /> ContentElement(pd4content) [ ] {font-family=[Ljava.lang.String;@2c167687, display=block, line-height=1.2000000476837158, font-size=16}<br /> ContentElement(pd4content) [ This also Fails, but the file actually exists in the location.] {font-family=[Ljava.lang.String;@2c167687, display=block, line-height=1.2000000476837158, font-size=16}<br /> <br /> java.lang.NoSuchMethodError: javax.servlet.ServletContext: method getServletContextName()Ljava/lang/String; not found<br /> at org.zefer.cache.c.getResourceAsBytes(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getObject(Unknown Source)<br /> at org.zefer.cache.ResourceCache.getImage(Unknown Source)<br /> at org.zefer.html.doc.n.Ôõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.Óõ0000(Unknown Source)<br /> at org.zefer.html.doc.n.while(Unknown Source)<br /> at org.zefer.html.doc.b.b.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.b.d.o00000(Unknown Source)<br /> at org.zefer.html.doc.ab.o00000(Unknown Source)<br /> at org.zefer.html.doc.Document.layout(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.o00000(Unknown Source)(Compiled Code)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.PD4ML.render(Unknown Source)<br /> at org.zefer.pd4ml.taglib.PD4MLTransformerTag.render(Unknown Source)<br /> at org.zefer.pd4ml.taglib.PD4MLTransformerTag.doEndTag(Unknown Source)<br /> at wayne._index4_jsp_4._jspService(_index4_jsp_4.java:164)<br /> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:142)<br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)<br /> at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:323)<br /> at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:503)<br /> at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:651)<br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)<br /> at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827)<br /> at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167)<br /> at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297)<br /> at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110)<br /> at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472)<br /> at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012)<br /> at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913)<br /> at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:721)<br /> at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:374)<br /> at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:118)<br /> at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134)<br /> at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:239)<br /> at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)<br /> at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java:106)<br /> at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:154)<br /> at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:317)<br /> at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java:60)<br /> at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))<br /> at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))<br /> at com.ibm.ws.util.CachedThread.run(ThreadPool.java:144)<br /> please increase heap size of JVM with the command-line parameter -Xmx512m<br /> java.lang.OutOfMemoryError<br /> bash-2.05b$

    Does anyone know how to fix the above… or tell me where to look next?
    where does getServletContextName() come from?????

    am i addressing the images correctly?

    hope someone can help.

    Thankyou in advance,
    Wayne

    #27546

    [SOLVED]

    the host – “TestServer” above was a virtual host on another machine (eg HostA)
    (HostA and TestServer share the same IP address).

    HostA didnt have DNS enabled, so HostA could not ping TestServer.
    However my desktop PC itself could ping both HostA and TestServer.

    solution: (either enable DNS resolution – not allowed in my environment, or, add TestServer to the hosts file…)

    Grrrrr
    Now onto the rest of the prototype….

    here is a copy of the file that is WORKING. (it renders the two pictures)

    <pd4ml:transform<br /> screenWidth="800"<br /> pageFormat="A4"<br /> pageOrientation="portrait"<br /> pageInsets="10,10,10,10,points"<br /> enableImageSplit="false"<br /> encoding="default"<br /> fileName="myoutput.pdf"<br /> inline="true"<br /> debug="true"<br /> ><br /> <br /> <br /> <br /> <br /> <br /> <%<br /> String url = request.getScheme() + "://" +<br /> request.getServerName() + ":" +<br /> request.getServerPort() +<br /> request.getContextPath() + "/";<br /> %><br /> <BASE id="theBase" href=""><br /> <br /> <br /> <br /> <br /> Server Base Path = <br /> <BR><BR><br /> <br /> <br /> TEST 1<br /> Works Fine. This doesnt use the base tag resolution - it is already fully qualified.<br /> <IMG src="http://testServer/wayne/wayne/my_logo.jpg" width="200" height="200"><br /> <br /> TEST 2<br /> WORKS, this uses the base tag to determine the apps context etc... so its a way for me to use relative paths<br /> that resolve to fully qualified urls when you look at the log.<br /> <IMG src="wayne/my_logo.jpg"><br /> <br /> <BR><BR><br /> Hello, World A4!<br /> <br /> <br /> <br /> Hello, Page2!<br /> <br /> <br /> <br /> <br />

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.