I'm on Mac OSX 10.6, I'm trying to generate a PDF from my Joomla PHP site, using exec to call fop via:
exec("fop -fo /temp/sample.fo -pdf /temp/doc".$now.".pdf > /temp/stdout.log 2> /temp/stderr.log");
but in the error logs I see:
Sat Jan 7 10:36:43 Georges-Mac.local java[8642] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
Exception in thread "main" java.lang.InternalError: Can't connect to window server - not enough permissions.
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1045)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1605)
at java.awt.Toolkit.<clinit>(Toolkit.java:1627)
at java.awt.Color.<clinit>(Color.java:263)
at org.apache.xmlgraphics.java2d.GraphicContext.<init>(GraphicContext.java:88)
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)
Any hints how to grant access to the 'window server'? Or a workaround?
On the command line, pass the following argument to Java:
You may need to modify your command to start java directly instead of using the startup script in order to be able to do this.