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 PJA at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)

philfr89

Member since : Feb 27, 2004
Messages : 6
 Feb 27, 2004 at 2:00 PM
Hi,

I want use PJA 2.4 on AIX 4.3.3.11 with IBM JDK 1.3.1

My launch command is
/usr/java131/bin/java -Xbootclasspath/a:./rdfax11/pja.jar \
-Dawt.toolkit=com.eteks.awt.PJAToolkit \
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment \
-Djava2d.font.usePlatformFont=false \
-Djava.awt.fonts=/usr/java131/jre/lib/fonts \
-Duser.home=. \
-classpath ./rdfax11/pjatools.jar:./rdfax11/rfax.jar:. \
rdfax11.FaxTest3


Could you explain me this error message
I think this is problem with DISPLAY because there is no X server on my AIX.
It seems me PJA don't need X server ???

Other informations
* I haven't added any new Font on my server.
* My AIX server has some X11 library like X11.base.lib, X11.base.rte, X11.motif.lib, X11.motif.mwm .
* I have also /usr/java131/jre/bin/libawt.a and /usr/java131/jre/bin/libawt_g.a .
* echo $LD_LIBRARY_PATH is empty
* Java instruction line is Font textFont=new Font("Serif",Font.PLAIN,12);


Error message
Exception in thread "main" java.lang.InternalError: .
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:77)
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:142)
at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:126)
at com.eteks.java2d.PJAGraphicsEnvironment.<init>(PJAGraphicsEnvironment.java:66)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:262)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:72)
at java.awt.Font.initializeFont(Font.java:285)
at java.awt.Font.<init>(Font.java:319)
at com.java4less.rfax.TextFaxProducer.<init>(TextFaxProducer.java:29)
at rdfax11.FaxTest3.main(FaxTest3.java:43)

Where is my mistake ??
Best regards

Philippe
---
Philippe

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Mar 11, 2004 at 7:30 AM
Please, note that it looks like font support doesn't work correctly in PJA Toolkit on AIX from the many messages about this subject on this forum.
Just one thing : do you have any True type fonts files in /usr/java131/jre/lib/fonts directory ?
---
Manu (moderator/modérateur)

blav

Member since : Mar 12, 2004
Messages : 3
 Mar 12, 2004 at 6:31 PM
Hi,

I think that philfr89's config is good. I think it's a problem with ibm's jvms. I can mak pja work under linux with sun's jvm, but I can't make the ibm jvm 1.3.x work with pja:
sun.awt.X11GraphicsEnvironment.initDisplay

Have you heard about ibm / pja problems ?

blav

Member since : Mar 12, 2004
Messages : 3
 Mar 12, 2004 at 6:32 PM
I phil, have you solved your pb ? I have the same pb under linux with *IBM* jvms. Let me know if you find a solution.

blav

Member since : Mar 12, 2004
Messages : 3
 Mar 12, 2004 at 6:49 PM
I finally found the solution :
1. copy the arial.ttf font from windows to your $FONTDIR dir
2. if you're using the 1.3.1 ibm jvm, add the -Dos.name=fake to your java cmdline. you don't need this with a 1.3.0 ib jvm

atool

Location : USA
Member since : Feb 26, 2004
Messages : 2
 Mar 16, 2004 at 9:30 PM
I tried similar approached with 1.3.1 IBM JVM on AIX 5.1 but it didn't work.
Can you highlight little bit that Why do we need -Dos.name=fake ?
and How come copying arial.ttf solved your problem.
Are you using just arial font?
Did you try to copy any other fonts ?
I am using "Times roman" and bunch of other fonts.
Any advice ?

philfr89

Member since : Feb 27, 2004
Messages : 6
 Mar 29, 2004 at 8:52 PM
Hi,

I just come from Holiday, i have only realise one test with theses parameters
/usr/java131/bin/java -Xbootclasspath/a:./rdfax11/pja.jar \
-Dawt.toolkit=com.eteks.awt.PJAToolkit \
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment \
-Djava2d.font.usePlatformFont=true \
-Djava.awt.fonts=/u/phi/myclasses/rdfax11/fonts \
-Duser.home=. \
-Dos.name=fake \
-classpath ./rdfax11/pjatools.jar:./rdfax11/rfax.jar:. \
rdfax11.FaxTest3


All my PC Font has been copy to server by FTP .
(http://java.quest.com/support/search/JclServerChart/fq/jcl_serverchart_fq_13.html )


Arial TTF file are :
<e30>phi$ ls A*
AdobeFnt.lst AMAZR___.TTF ANTQUAI.TTF ARIALNB.TTF
AMAZB___.TTF ANTQUABI.TTF ARBLI___.TTF ARIALNI.TTF
AMAZI___.TTF ANTQUAB.TTF ARIALNBI.TTF ARIALN.TTF

<e30>phi$ ls a*
app775.fon app852.fon app857.fon arialbd.ttf ariali.ttf ariblk.ttf
app850.fon app855.fon app866.fon arialbi.ttf arial.ttf



I haven't modify copy or change file font.properties .


I haven't previous error message, but i have null error message on.
follwing instruction

public Font textFont=new Font("Serif",Font.PLAIN,12);
java.awt.Image pageImage=new BufferedImage(800,550,BufferedImage.TYPE_INT_RGB);
Graphics g=pageImage.getGraphics();
g.setFont(this.textFont);
int lineH=g.getFontMetrics().getHeight(); // Null error Message Here



So i think my Font is not find or use in fact. I need perhaps another configuration file for using fonts ???

Could you confirm me that usePlatformFont and awt.fonts parameters are good ?

What is "fake" for os.name parameter ?, i don't find it in documentation ?

Thanks very much.

Philippe
---
Philippe

philfr89

Member since : Feb 27, 2004
Messages : 6
 Apr 8, 2004 at 10:58 AM
Yahoo,

I am stupid and keep in my source code
//System.setProperty ("java2d.font.usePlatformFont","false"); //ne pas utiliser les fontes systeme
Now i have remove it.
Blav change, seems Good,
i have another problem but this is not an PJA problem

Best regards
Philippe

---
Philippe

fmeschbe

Location : Basel, Switzerland
Member since : Jul 7, 2004
Messages : 1
 Jul 7, 2004 at 2:54 PM
Unfortunately - at least with the build we have in house, which is "J2RE 1.3.1 IBM AIX build ca131-20031105", and running on AIX 4.3 - the SunGraphicsEnvironment class tries to load the sun.awt.X11GraphicsEnvironment class if the "os.name" system property is "Linux", "AIX", "z/OS", or "OS/390". The code catches ClassNotException and NoClassDefError but not InternalError, which is thrown by the X11GraphicsEnvironment class, when a display is not available to connect to.

This is the reason, why the os.name fix works. Copying the font file is - in my opinion - not really needed.

I'm not sure, whether just setting the os.name property to an other value is a stable solution as the application may make use of it ....

testdrive

Location : Atanta, USA
Member since : Jun 23, 2005
Messages : 3
 Jun 23, 2005 at 9:51 PM
> I finally found the solution :
> 1. copy the arial.ttf font from windows to your $FONTDIR dir
> 2. if you're using the 1.3.1 ibm jvm, add the -Dos.name=fake to your java cmdline. you don't need this with a 1.3.0 ib jvm

I copied all arial fonts from windows to java/jre/fonts directory in linux and added the argument -Dos.name=false but still I can not see the text fonts on graphics. The bar chart graphic shows but it has no label. There were no erro messages either. Any idea? I have ibm jvm 1.3.1 on limux system. The application is a browser app that get the graphics data using cewolf from linux server and displaying the graph on local system browser - IE and Firefox. PJA is 2.5.
---
Kal

testdrive

Location : Atanta, USA
Member since : Jun 23, 2005
Messages : 3
 Jun 27, 2005 at 10:53 PM
As soon as I change the 2d font value from false to true it started working
(-Djava2d.font.usePlatformFont=true ). I did not even add line -Dos.name=fake.

Thanks for all the forum help.
--Kal
---
Kal


Home pageFind It!ContactTop

© Copyrights 1997-2023 eTeks - All rights reserved

PJAPJA documentation