Home pageFind It!Contact PJAPJA documentation

PJA

 PJA Toolkit forum

This forum is dedicated to PJA Toolkit.
You may read freely the messages it contents. If you want to write a message or answer to a subject, subscribe to it first.

Subjects Recent messages Login Subscribe

Messages of subject PJAToolkitDemo1.2.sh on XServe/1.4.1

chrisg

Location : Charlottesville, VA, USA
Member since : Jul 3, 2003
Messages : 3
 Jul 3, 2003 at 9:10 PM
I am attempting to run PJAToolkitDemo1.2.sh using the pja_2.5 Beta code on an XServe with Java 1.4.1. The script is:

java -Xbootclasspath/p:../lib/pja.jar:../lib/rtgraphics.jar \
-Djava.awt.headless=true \
-Djava.awt.toolkit=com.eteks.awt.PJAToolkit \
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment \
-Djava2d.font.usePlatformFont=false \
-Djava.awt.fonts=/System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/Home/lib/fonts \
-Duser.home=.. \
-classpath ../lib/pjatools.jar \
ToolkitDemo

I have created the rtgraphics.jar as recommended, with the Windows classes (and inner classes).

The stack trace I get when executing the script is:
kCGErrorIllegalArgument : initCGDisplayState: cannot map display interlocks.
kCGErrorIllegalArgument : CGSNewConnection cannot get connection port
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:1473)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1389)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1401)
at java.awt.Toolkit.<clinit>(Toolkit.java:1422)
at ToolkitDemo.main(ToolkitDemo.java:106)

Am I forgetting anything? I've tried various things and am getting the same error every time. Thanks.

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Jul 4, 2003 at 9:09 AM
Did you try the PJAToolkitDemoMacOSX.sh script first ?
Don't use the rtgraphics.jar patch under JDK 1.4 and try it again without the -Djava.awt.headless=true option.
---
Manu (moderator/modérateur)

chrisg

Location : Charlottesville, VA, USA
Member since : Jul 3, 2003
Messages : 3
 Jul 7, 2003 at 3:56 PM
Thanks for the quick feedback. I modified the script to be:

java -Xbootclasspath/a:../lib/pja.jar \
-Djava.awt.toolkit=com.eteks.awt.PJAToolkit \
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment \
-classpath ../lib/pjatools.jar \
ToolkitDemo

I get the following exception:

Toolkit class in use is apple.awt.CToolkit
Exception in thread "main" java.lang.ClassCastException
at apple.awt.CToolkit.getScreenInsets(CToolkit.java:669)
at java.awt.Window.init(Window.java:238)
at java.awt.Window.<init>(Window.java:267)
at java.awt.Frame.<init>(Frame.java:398)
at java.awt.Frame.<init>(Frame.java:363)
at ToolkitDemo$ImageBuilder.createImage(ToolkitDemo.java:190)
at ToolkitDemo.ComputeImageFiles(ToolkitDemo.java:138)
at ToolkitDemo.main(ToolkitDemo.java:120)

Any ideas? Thanks,
Chris

chrisg

Location : Charlottesville, VA, USA
Member since : Jul 3, 2003
Messages : 3
 Jul 7, 2003 at 4:27 PM
I modified the script again -- removed "java" ahead of the "awt" in the 2nd line:

java -Xbootclasspath/a:../lib/pja.jar \
-Dawt.toolkit=com.eteks.awt.PJAToolkit \
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment \
-classpath ../lib/pjatools.jar \
ToolkitDemo


The output is:

Toolkit class in use is com.eteks.awt.PJAToolkit
Computing ArcDrawer image (instance of com.eteks.awt.PJAImage)
Saving image to PJAToolkitArcDrawer.gif
Computing PolygonDrawer image (instance of com.eteks.awt.PJAImage)
Saving image to PJAToolkitPolygonDrawer.gif
Computing TextDrawer image (instance of com.eteks.awt.PJAImage)
java.awt.AWTError: No default font : at least one .pjaf font must be loaded.
In case of an error related to font, you should run first PJAFontCapture to generate at least one .pjaf font file.
Saving image to PJAToolkitTextDrawer.gif
Computing ImageDrawer image (instance of com.eteks.awt.PJAImage)
Exception in thread "main" java.lang.NullPointerException
at com.eteks.awt.PJAGraphics.drawImage(PJAGraphics.java:2261)
at com.eteks.awt.PJAGraphics.drawImage(PJAGraphics.java:2247)
at ToolkitDemo$GraphicsImageDrawer.paint(ToolkitDemo.java:415)
at ToolkitDemo.ComputeImageFiles(ToolkitDemo.java:157)
at ToolkitDemo.main(ToolkitDemo.java:120)


The demo now correctly creates the images PJAToolkitArcDrawer.gif and PJAToolkitPolygonDrawer.gif. A file named PJAToolkitTextDrawer.gif is created but it is empty.

I have tried the script including and not including the parameters:
-Djava2d.font.usePlatformFont=false \
-Djava.awt.fonts=/my/fonts/folder \

but keep getting the same errors. What should I do to get fonts set correctly?

Thanks,
Chris

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Jul 16, 2003 at 11:24 PM
Try to run the following command in pja/bin directory :
java -Xbootclasspath/a:../lib/pja.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Duser.home=.. -classpath ../lib/pjatools.jar ToolkitDemo

It will work but with some exceptions of the type :
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Thread.java:1089)
at sun.awt.font.NativeFontWrapper.registerCompositeFont(NativeFontWrapper.java:80)

If you want to avoid these exceptions you may create a "font.properties.Mac OS X" file in pja/lib directory containing the following text (don't forget the spaces in Mac_OS_X file name) :

# font.properties
alias.timesroman=serif
alias.helvetica=sansserif
alias.courier=monospaced

---
Manu (moderator/modérateur)


Home pageFind It!ContactTop

© Copyrights 1997-2023 eTeks - All rights reserved

PJAPJA documentation