You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Lucas Miguez <lu...@gmail.com> on 2010/11/16 14:22:27 UTC

Using FOP with PHP, Java Problem?

Hi,

I put the binary distribution in one folder of my server. If I execute
the following command outside the fop folder:

sh ./fop-1.0/fop -xsl xslfile.xsl -xml xmlfile.xml -pdf pdffile.pdf
>stdout.log 2>sterr.log


and the pdf file is generated. But the following lines appears in the
sterr.log file :

/etc/java/java.conf: line 5: Priority:: command not found
/etc/java/java.conf: line 6: Vendor:: command not found
/etc/java/java.conf: line 7: Version:: command not found
/etc/java/java.conf: line 8: Devel:: command not found


if I tried to execute the command from PHP using exec function but
there is no PDF file and there is no errors in sterr.log...

I have the java version 1.5.0_11 and the JAVA_HOME is /usr/java/jre1.5.0_11

javac command doesn't work but I have the j2skd1.4.2_19 in the folder /usr/java

I put the permissions (777) in the folder where I created the PDF
file...but it doesn't work...

How to solve the problem in java.conf file?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Using FOP with PHP, Java Problem?

Posted by mehdi houshmand <me...@gmail.com>.
Hi Lucas,

If you check the mailing list archive, this is an issue that has been
raised previously. You need to run AWT in headless mode, if the
mailing archive doesn't help, google provides plenty of solutions.
Just to get you started check this comment by Asitha Weerasinghe in
the archives:

http://www.mail-archive.com/fop-users%40xmlgraphics.apache.org/msg16014.html

Hope that helps

Mehdi

On 17 November 2010 09:58, Lucas Miguez <lu...@gmail.com> wrote:
> Know I think there is a permissions problem, because if I run the
> command in the server, it works, but from the php script, it crashes
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Using FOP with PHP, Java Problem?

Posted by Lucas Miguez <lu...@gmail.com>.
Know I think there is a permissions problem, because if I run the
command in the server, it works, but from the php script, it crashes

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Using FOP with PHP, Java Problem?

Posted by Lucas Miguez <lu...@gmail.com>.
Hi,

I change to wwwrun user, I execute the command and I get the following
lines in stderr.log file :

what does it mean? Thanks

/etc/java/java.conf: line 5: Priority:: command not found
/etc/java/java.conf: line 6: Vendor:: command not found
/etc/java/java.conf: line 7: Version:: command not found
/etc/java/java.conf: line 8: Devel:: command not found
Exception in thread "main" java.lang.InternalError: Can't connect to
X11 window server using ':0.0' as the value of the DISPLAY variable.
	at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:134)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:141)
	at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62)
	at java.awt.Font.initializeFont(Font.java:308)
	at java.awt.Font.<init>(Font.java:344)
	at org.apache.xmlgraphics.java2d.GraphicContext.<init>(GraphicContext.java:113)
	at org.apache.fop.render.intermediate.IFGraphicContext.<init>(IFGraphicContext.java:42)
	at org.apache.fop.render.intermediate.IFRenderer.<init>(IFRenderer.java:128)
	at org.apache.fop.render.RendererFactory.createRendererForDocumentHandler(RendererFactory.java:313)
	at org.apache.fop.render.RendererFactory.tryIFDocumentHandlerMaker(RendererFactory.java:290)
	at org.apache.fop.render.RendererFactory.createRenderer(RendererFactory.java:270)
	at org.apache.fop.area.RenderPagesModel.<init>(RenderPagesModel.java:69)
	at org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:130)
	at org.apache.fop.area.AreaTreeHandler.<init>(AreaTreeHandler.java:102)
	at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:359)
	at org.apache.fop.fo.FOTreeBuilder.<init>(FOTreeBuilder.java:105)
	at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:101)
	at org.apache.fop.apps.Fop.<init>(Fop.java:79)
	at org.apache.fop.apps.FopFactory.newFop(FopFactory.java:271)
	at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:109)
	at org.apache.fop.cli.Main.startFOP(Main.java:174)
	at org.apache.fop.cli.Main.main(Main.java:205)

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org