I found logs about this error , here is a line from this logs : 

 http-8080-1/ExternalGraphic: Error while creating area : Error with image
URL:
context:/project/src/documentation/content/xdocs/specificProject/conception/specificModule/fonctionnal/resource/anImage.jpg
(No such file or directory) and no base URL is specified

Google told me that context:// is a cocoon protocol (get a resource using
the servlet context)

So in my opinion error could be the fact that we try to reach
context:/project/.../anImage.jpg instead of
context:///project/../anImage.jpg

Or that
/project/src/documentation/content/xdocs/specificProject/conception/specificModule/fonctionnal/resource/anImage.jpg
is not in the "servlet context"..


What's more I tried all of this with the forrest sample and with jre 1.6 
with apache-tomcat-0.6.18 on Windows (this time) and i have exactly the same
issue...

So you should be able to reproduce this issue easly at your home with
Windows/Unix , tomcat 6.0.18, java 1.6 and a war version (from forrest war).

PS: I tried with jimi-1.0.jar , and I have exactly the same issue
PS2: I tried with GIF, PNG and JPG image , and I have exactly the same Issue


ARobert wrote:
> 
> Hi all,
> 
> I have exacty the same issue ... 
> 
> I'm using forrest 0.8.
> My site is in a webapp runing on Tomcat 6.0.18 with Java 1.6
> 
> I tried with PNG --> My images aren't displayed on PDF
> I tried with JPG --> My images aren't displayed on PDF
> 
> My links to images are relatives (e.g: src="../resources/anImage.jpg") 
> 
> And when i look in my .fo i have : 
> fo:external-graphic
> src="context:///project/src/documentation/content/xdocs/mySpecificProject/conception/specificModule/fonctionnal/../resource/anImage.jpg"
> 
> This external-graphic FO link doesn't seem correct.
> 
> 
> And when I take a look to the "document-to-fo.xsl" which is in my specific
> skin folder i see that : 
> 
> <xsl:variable name="imgpath">
>         <xsl:choose>
> <!-- resources image dir -->
>           <xsl:when test="starts-with(string(@src),'images/')">
>             <xsl:value-of
> select="concat($imagesdir,substring-after(@src,'images'))"/>
>           </xsl:when>
>           <xsl:when test="contains(string(@src),'/images/')">
>             <xsl:value-of
> select="concat($imagesdir,substring-after(@src,'/images'))"/>
>           </xsl:when>
> <!-- already absolute -->
>           <xsl:when test="contains(string(@src),':') or
> starts-with(string(@src),'/')">
>             <xsl:value-of select="@src"/>
>           </xsl:when>
> <!-- relative to document -->
>           <xsl:otherwise>
>             <xsl:value-of select="concat($xmlbasedir,@src)"/>
>           </xsl:otherwise>
>         </xsl:choose>
>       </xsl:variable>
>       <fo:external-graphic src="{$imgpath}">
> 
> And I can't figure where xmlbasedir is set ?! 
> 
> So I guess xmlbasedir is wrong when runing in webapp mode ?!
> 
> 
> 
> 
> 
> Thorsten Scherler-3 wrote:
>> 
>> On Thu, 2008-02-28 at 02:35 -0800, SteveOdlind wrote:
>>> Hi all,
>>> 
>>> If there is no quick fix to get images in PDFs displayed in deployed WAR
>>> files, is there a way of getting PDFs to be displayed at all when the
>>> webapp
>>> directory is deployed on Tomcat?
>> 
>> Hmm, my problem with this issue is that I cannot test it (in linux it
>> works fine). In any way the images in pdf are quite hacky and lately
>> they have been done some work on the pdf plugin to overcome this
>> problem.
>> 
>>> 
>>> I have deployed the webapp directory on Tomcat, and the HTML is
>>> displayed
>>> fine. However, clicking on the PDF icon gives the error message
>>> "Resource
>>> Not Found".
>>> 
>>> There are no error messages when I run the command "forrest run-webapp".
>>> Everything seems to be built correctly.
>>> 
>>> If I manually copy the PDFs to the
>>> "build\webapp\project\src\documentation\content\xdocs\" folder then the
>>> PDFs
>>> are displayed. But surely this can't be the correct way?
>>> 
>>> Any ideas?
>> 
>> I expect that the solution is updating the pdf plugin to 0.3 of trunk
>> but since https://issues.apache.org/jira/browse/FOR-1074 I cannot ask
>> you test but you may watch this issue and try as soon we fixed it.
>> 
>> salu2
>> 
>> 
>>> 
>>> -Steve
>> -- 
>> Thorsten Scherler                                 thorsten.at.apache.org
>> Open Source Java                      consulting, training and solutions
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/PDF-not-working-correctly-in-deployed-WAR-file-on-Tomcat-tp15295911p20722286.html
Sent from the Apache Forrest - Users mailing list archive at Nabble.com.