Re: Second Java process starts up for certain operations, but not with Java Bridge?
Re: Second Java process starts up for certain operations, but not with Java Bridge?
- Subject: Re: Second Java process starts up for certain operations, but not with Java Bridge?
- From: Marc Liyanage <email@hidden>
- Date: Fri, 5 Sep 2003 20:37:29 +0200
OK, sorry for following up to my own post... But I found the solution
just after posting the question :-)
The solution was to force "headless" AWT mode with
System.setProperty("java.awt.headless", "true");
Seems this is a new option for Java 1.4, more Info at
http://java.sun.com/j2se/1.4.1/docs/guide/awt/AWTChanges.html#headless
Maybe it helps somebody else... I can now enjoy my PDFs with enclosed
images im my NSImageView :-)
On 05.09.2003, at 20:11, Marc Liyanage wrote:
I am using a Java library (Apache FOP) in my Obj-C app, via the Java
bridge.
This library creates PDF documents for me, it takes XML data (XSL-FO)
and creates the finished pages as a PDF byte stream. I am taking this
stream back via the Java bridge and then I create a PDF NSImage
instance which I can display. Works beautifully.
*But*, for some input documents it hangs in the Java code and blocks
my app. It is triggered when images are used in the document.
I compared it with a regular FOP run on the command line for the exact
same input code, i.e. not from within my Cocoa app. There I can see
that during processing, for a very brief time like 1-2 seconds, a
second Java process is launched, and this one even appears in the Dock
quickly and then disappears again.
I know that this is usually the case when some Java GUI classes are
loaded, because these seem to require a connection with the window
server. I had the same issue with Tomcat when loading JPEG coder
classes earlier on Mac OS X and also on Linux, where a running X11
server was required, even for non-GUI apps because of this issue.
Now, my problem is that this second process does *not* seem to get
launched when the FOP library is used from within my app via the
bridge.
Does anyone here know just what I would need to do in order to get
this to happen? I wouldn't mind the process popping up quickly, I just
want to get the identical behavior as on the command line. What is
different in the Java process when launched from within a Cocoa app?
Thanks...
-Marc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_________________________________________________________________
Marc Liyanage email@hidden
http://www.entropy.ch
ICQ 5077985
Yoda I am. Grammar I can't.
_________________________________________________________________
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.