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 Trouble with a FAQ description

Mylacc

Member since : Jul 16, 2003
Messages : 6
 Jul 16, 2003 at 11:27 PM
The FAQ: Why the Java Virtual Machine crashes when I use fonts on UNIX platform ?

states that:
This bug doesn't appear with the latest version of the JDK 1.3.

I'm not sure when this was written and when the most recent version of 1.3 was at that time and was just wondering, thanks. I am using 1.3.6 and was just wondering if that version was effected or not.

Mylacc

Member since : Jul 16, 2003
Messages : 6
 Jul 17, 2003 at 12:07 AM
I was having the trouble of not being able to display a generated image on solaris using the cewolf chart jsp tag library and was getting the first error. After adding the System.setProperty("awt.toolkit", "com.eteks.awt.PJAToolkit") line to my jsp and adding the jar file to my lib directory in WEB-INF, the error turned into the second one. Is the PJA working or do I need to change something else?

First Error:
java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:115)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:53)
at java.awt.Font.initializeFont(Font.java:259)
at java.awt.Font.<init>(Font.java:293)
at org.jfree.chart.axis.AxisConstants.<clinit>(Unknown Source)
at org.jfree.chart.axis.Axis.<init>(Unknown Source)
at org.jfree.chart.axis.CategoryAxis.<init>(Unknown Source)
at org.jfree.chart.axis.HorizontalCategoryAxis.<init>(Unknown Source)
at org.jfree.chart.ChartFactory.createLineChart(Unknown Source)
at de.laures.cewolf.taglib.CewolfChartFactory.getChartInstance(CewolfChartFactory.java:101)
at de.laures.cewolf.taglib.SimpleChartDefinition.produceChart(SimpleChartDefinition.java:30)
at de.laures.cewolf.taglib.AbstractChartDefinition.getChart(AbstractChartDefinition.java:90)
at de.laures.cewolf.taglib.ChartImageDefinition.getChart(ChartImageDefinition.java:95)
at de.laures.cewolf.util.Renderer.renderChart(Renderer.java:96)
at de.laures.cewolf.util.Renderer.render(Renderer.java:77)
at de.laures.cewolf.taglib.ChartImageDefinition.ensureRendered(ChartImageDefinition.java:134)
at de.laures.cewolf.taglib.ChartImageDefinition.getRenderingInfo(ChartImageDefinition.java:123)
at de.laures.cewolf.taglib.tags.ChartMapTag.doStartTag(ChartMapTag.java:87)
at jsp_servlet._jsp._AppointmentStatus.__AppointmentStatus._jspService(__AppointmentStatus.java:763)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

Second error:
####<Jul 15, 2003 6:11:34 PM EDT> <Error> <HTTP> <cltsunq43> <proctor> <ExecuteThread: '11' for queue: 'default'> <kernel identity> <> <101017> <[ServletContext(id=4175190,name=reports,context-path=/reports)] Root cause of ServletException>
java.lang.NoClassDefFoundError
at org.jfree.chart.axis.Axis.<init>(Unknown Source)
at org.jfree.chart.axis.CategoryAxis.<init>(Unknown Source)
at org.jfree.chart.axis.HorizontalCategoryAxis.<init>(Unknown Source)
at org.jfree.chart.ChartFactory.createLineChart(Unknown Source)
at de.laures.cewolf.taglib.CewolfChartFactory.getChartInstance(CewolfChartFactory.java:101)
at de.laures.cewolf.taglib.SimpleChartDefinition.produceChart(SimpleChartDefinition.java:30)
at de.laures.cewolf.taglib.AbstractChartDefinition.getChart(AbstractChartDefinition.java:90)
at de.laures.cewolf.taglib.ChartImageDefinition.getChart(ChartImageDefinition.java:95)
at de.laures.cewolf.util.Renderer.renderChart(Renderer.java:96)
at de.laures.cewolf.util.Renderer.render(Renderer.java:77)
at de.laures.cewolf.taglib.ChartImageDefinition.ensureRendered(ChartImageDefinition.java:134)
at de.laures.cewolf.taglib.ChartImageDefinition.getRenderingInfo(ChartImageDefinition.java:123)
at de.laures.cewolf.taglib.tags.ChartMapTag.doStartTag(ChartMapTag.java:87)
at jsp_servlet._jsp._AppointmentStatus.__AppointmentStatus._jspService(__AppointmentStatus.java:763)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1058)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:401)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Jul 20, 2003 at 9:40 PM
> The FAQ: Why the Java Virtual Machine crashes when I use fonts on UNIX platform ?
> states that:
> This bug doesn't appear with the latest version of the JDK 1.3.
>
> I'm not sure when this was written and when the most recent version of 1.3 was at that time and was just wondering, thanks.
> I am using 1.3.6 and was just wondering if that version was effected or not.

The JDK 1.3.6 doesn't exist. If you mean 1.3.1_06, I think you shouldn't have problem...

Changing only awt.toolkit property isn't enough with JDK 1.3, please read the FAQ "What options do I have to add to java command line to use PJA with my servlet server on UNIX platform ?" to see what other properties or options must be set to run your servlet.
---
Manu (moderator/modérateur)

lcq210

Member since : May 23, 2003
Messages : 9
 Jul 22, 2003 at 9:04 AM
I got the same problem with mylacc.Every time I wrote 'new Font ("", Font.PLAIN, 10);' in my java servlet ,I get an Exception like this:
java.lang.Error: Could not find class: com.eteks.java2d.PJAGraphicsEnvironment
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:61)
at java.awt.Font.initializeFont(Font.java:264)
at java.awt.Font.<init>(Font.java:298)
at DefaultToolkitTest.test(DefaultToolkitTest.java:67)
at DefaultToolkitTest.doGet(DefaultToolkitTest.java:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:271)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:311)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
at org.apache.jserv.JServConnection.run(JServConnection.java:188)
at java.lang.Thread.run(Thread.java:484)
Every thing works fine with graphic.I can set color,draw rectangle,polygon in my java servlet.But once it runs into font or text,It doesn't work.When I use method getFontName(),I got an exception :
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 gene
rate at least one .pjaf font file.
Thanks.

Mylacc

Member since : Jul 16, 2003
Messages : 6
 Jul 25, 2003 at 7:43 PM
Yes, I did mean 1.3.1_06. But I am still getting errors even after setting everything up, here's what it is, same as lcq210:

java.lang.Error: Could not find class: com.eteks.java2d.PJAGraphicsEnvironment
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvi
ronment.java:56)
at java.awt.Font.initializeFont(Font.java:259)
at java.awt.Font.<init>(Font.java:293)
at org.jfree.chart.axis.AxisConstants.<clinit>(Unknown Source)
at org.jfree.chart.axis.Axis.<init>(Unknown Source)
at org.jfree.chart.axis.CategoryAxis.<init>(Unknown Source)
at org.jfree.chart.axis.HorizontalCategoryAxis.<init>(Unknown Source)
at org.jfree.chart.ChartFactory.createLineChart(Unknown Source)
at de.laures.cewolf.taglib.CewolfChartFactory.getChartInstance(CewolfCha
rtFactory.java:101)

But I dont' understand what he meant by "In case of an error related to font, you should run first PJAFontCapture to gene rate at least one .pjaf font file." Because the FAQ states that ".pjaf files are useless with JDK >= 1.2"
Has anyone else gotten PJA to work on UNIX or Solaris using JDK < 1.4 with CeWolf?

Mylacc

Member since : Jul 16, 2003
Messages : 6
 Jul 29, 2003 at 10:46 PM
Here is the start up line which begins my WebLogic 7.0 server:

$JAVA_HOME/bin/java $VM_MODE $JAVA_OPTIONS -Xbootclasspath/p:pja.jar:rtgraphics.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Djava2d.font.usePlatformFont=false -Djava.awt.fonts=../../jdk131_06/jre/lib/fonts -Duser.home=applications/reports/WEB-INF $JAVA_PROPERTIES $SERVER_CLASS

And pja.jar, pjatools.jar, and rtgraphics.jar are in my Web Applications WEB-INF/lib directory. And I am still getting the exact same error. I am using CeWolf from cewolf.sourceforge.net which uses JFreeChart such as a previous user in this forum who was having trouble under the title "Are X11 library files required to run PJA?" Please tell me if I am doing somehting wrong or if there's anything you can do, thank you!!!

Mylacc

Member since : Jul 16, 2003
Messages : 6
 Jul 30, 2003 at 3:39 PM
Answer was alot easier then you would think. It was not -Xbootclasspath/a:pja.jar but actually -Xbootclasspath/a:applications/reports/WEB-INF/lib/pja.jar because I had the pja.jar in my Web Apps directory. Seems pretty simple but when you are just trying to follow directions and not think why they are there and just copy paste, things can always go wrong, lol. If I had looked at PJAToolkitDemo1.2.sh closer I could have figured this out, oh well.


Home pageFind It!ContactTop

© Copyrights 1997-2023 eTeks - All rights reserved

PJAPJA documentation