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 Problems converting to JDK 1.5

bird

Location : St. George, UT USA
Member since : Jul 29, 2004
Messages : 2
 Nov 24, 2004 at 6:53 PM
We were running PJA tool kit fine under JDK 1.4. Now we need to upgrade to JDK 1.5 for a few different reasons. After the upgrade I am getting this problem:


ava.lang.AbstractMethodError: sun.java2d.SunGraphicsEnvironment.createFontConfiguration()Lsun/awt/FontConfiguration;
at sun.java2d.SunGraphicsEnvironment$1.run(SunGraphicsEnvironment.java:186)
at java.security.AccessController.doPrivileged(Native Method)
at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:94)
at com.eteks.java2d.PJAGraphicsEnvironment.<init>(PJAGraphicsEnvironment.java:66)
at sun.reflect.GeneratedConstructorAccessor4.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at java.awt.Window.init(Window.java:263)
at java.awt.Window.<init>(Window.java:311)
at java.awt.Frame.<init>(Frame.java:419)
at java.awt.Frame.<init>(Frame.java:384)
at PiechartServlet.doGet(PiechartServlet.java:248)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:113)
at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:211)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:177)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:221)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:323)
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:430)
at com.caucho.util.ThreadPool.run(ThreadPool.java:377)
at java.lang.Thread.run(Thread.java:595)

Has anyone had a similar problem and can provide some insight?

Thanks.
---
.Jesse

lovfree

Location : Beijing, china
Member since : Dec 23, 2004
Messages : 1
 Dec 23, 2004 at 9:23 AM
hi, I got the same problem, have u find any approach to solve it?

aljubarrota

Member since : Jan 14, 2005
Messages : 2
 Jan 14, 2005 at 2:43 PM
JDK 1.5 now has a concept of "font configuration" (as opposed to just "font properties" in JDK 1.4.x). In java.awt.SunGraphicsEnvironment, they've added two new overrides of abstract methods:

protected abstract FontConfiguration createFontConfiguration();
public abstract FontConfiguration createFontConfiguration(boolean, boolean);

and dropped:

protected sun.awt.FontProperties createFontProperties();

The last drop of the PJA implements the latter method in PJAGraphicsEnvironment.

The JDK 1.5 now has FontProperties as being an inner class of PropertiesHandler which is itself a static inner class of the new FontConfiguration class.

To sum up, looks like PJAGraphicsEnvironment will need the implementations of the new methods (createFontConfiguration). There might be a lot more of this kind of problem (I only researched this specific issue since I've been seeing this problem as well).

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Sep 14, 2005 at 8:12 PM
I also noticed that Sun added a createFontConfiguration() method in sun.java2d.SunGraphicsEnvironment class. Before making any change to PJA Toolkit classes, I discovered that JDK 1.5 finally works correctly on headless systems installed with or without X11 libs.
Thus, I don't think I'll modify PJA Toolkit because I don't see why people should need it with JDK 1.5.
The only remaining case would be for backward compatibility of programs that use only PJA classes for graphics, but these kind of programs don't require GraphicsEnvironment and still work.
Please read http://www.eteks.com/pja/en/forum/viewSubject.jsp?subjectId=481#612 for more information.
---
Manu (moderator/modérateur)

marilou

Member since : Apr 17, 2006
Messages : 1
 Apr 17, 2006 at 7:50 PM
I tried most of the options suggested in this forum to resolve issues concerning JDK 1.5 upgrade. Unfortunately, nothing to fixes the issue.
We are using pja 2.5.

The jvm options look like this:

-Dsun.io.unicode.encoding=UTF-8
-Dfile.encoding=UTF-8
-Xbootclasspath/a:pja.jar
-Dawt.toolkit=com.eteks.awt.PJAToolkit
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment
-Djava2d.font.usePlatformFont=false
-Djava.awt.fonts="C:/Program Files/Java/jre1.5.0_06/lib/fonts"

If I run using these options I got the following error:

java.lang.AbstractMethodError: sun.java2d.SunGraphicsEnvironment.createFontConfiguration()Lsun/awt/FontConfiguration;
at sun.java2d.SunGraphicsEnvironment$1.run(SunGraphicsEnvironment.java:186)
at java.security.AccessController.doPrivileged(Native Method)
at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:94)
at com.eteks.java2d.PJAGraphicsEnvironment.<init>(PJAGraphicsEnvironment.java:66)
at sun.reflect.GeneratedConstructorAccessor4.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
at java.awt.Window.init(Window.java:263)
at java.awt.Window.<init>(Window.java:311)
at java.awt.Frame.<init>(Frame.java:419)
at java.awt.Frame.<init>(Frame.java:384)


If I remove all pja related options and add set java.awt.headless=true, then I get Headless Exception.

Has anyone successfully use headless mode in JDK 1.5?


tnl63

Member since : Jan 9, 2007
Messages : 3
 Jan 11, 2007 at 4:56 PM
> I tried most of the options suggested in this forum to resolve issues concerning JDK 1.5 upgrade. Unfortunately, nothing to fixes the issue.
> We are using pja 2.5.
>
> The jvm options look like this:
>
> -Dsun.io.unicode.encoding=UTF-8
> -Dfile.encoding=UTF-8
> -Xbootclasspath/a:pja.jar
> -Dawt.toolkit=com.eteks.awt.PJAToolkit
> -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment
> -Djava2d.font.usePlatformFont=false
> -Djava.awt.fonts="C:/Program Files/Java/jre1.5.0_06/lib/fonts"
>
> If I run using these options I got the following error:
>
> java.lang.AbstractMethodError: sun.java2d.SunGraphicsEnvironment.createFontConfiguration()Lsun/awt/FontConfiguration;
> at sun.java2d.SunGraphicsEnvironment$1.run(SunGraphicsEnvironment.java:186)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:94)
> at com.eteks.java2d.PJAGraphicsEnvironment.<init>(PJAGraphicsEnvironment.java:66)
> at sun.reflect.GeneratedConstructorAccessor4.newInstance(Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at java.lang.Class.newInstance0(Class.java:350)
> at java.lang.Class.newInstance(Class.java:303)
> at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
> at java.awt.Window.init(Window.java:263)
> at java.awt.Window.<init>(Window.java:311)
> at java.awt.Frame.<init>(Frame.java:419)
> at java.awt.Frame.<init>(Frame.java:384)
>
>
> If I remove all pja related options and add set java.awt.headless=true, then I get Headless Exception.
>
> Has anyone successfully use headless mode in JDK 1.5?
>
>
>
---
Thanh Le

tnl63

Member since : Jan 9, 2007
Messages : 3
 Jan 11, 2007 at 4:58 PM
Did anyone get pja 2.5 to work under JDK 1.5???
> > I tried most of the options suggested in this forum to resolve issues concerning JDK 1.5 upgrade. Unfortunately, nothing to fixes the issue.
> > We are using pja 2.5.
> >
> > The jvm options look like this:
> >
> > -Dsun.io.unicode.encoding=UTF-8
> > -Dfile.encoding=UTF-8
> > -Xbootclasspath/a:pja.jar
> > -Dawt.toolkit=com.eteks.awt.PJAToolkit
> > -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment
> > -Djava2d.font.usePlatformFont=false
> > -Djava.awt.fonts="C:/Program Files/Java/jre1.5.0_06/lib/fonts"
> >
> > If I run using these options I got the following error:
> >
> > java.lang.AbstractMethodError: sun.java2d.SunGraphicsEnvironment.createFontConfiguration()Lsun/awt/FontConfiguration;
> > at sun.java2d.SunGraphicsEnvironment$1.run(SunGraphicsEnvironment.java:186)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at sun.java2d.SunGraphicsEnvironment.<init>(SunGraphicsEnvironment.java:94)
> > at com.eteks.java2d.PJAGraphicsEnvironment.<init>(PJAGraphicsEnvironment.java:66)
> > at sun.reflect.GeneratedConstructorAccessor4.newInstance(Unknown Source)
> > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> > at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> > at java.lang.Class.newInstance0(Class.java:350)
> > at java.lang.Class.newInstance(Class.java:303)
> > at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
> > at java.awt.Window.init(Window.java:263)
> > at java.awt.Window.<init>(Window.java:311)
> > at java.awt.Frame.<init>(Frame.java:419)
> > at java.awt.Frame.<init>(Frame.java:384)
> >
> >
> > If I remove all pja related options and add set java.awt.headless=true, then I get Headless Exception.
> >
> > Has anyone successfully use headless mode in JDK 1.5?
> >
> >
> >
---
Thanh Le


Home pageFind It!ContactTop

© Copyrights 1997-2014 eTeks - All rights reserved

PJAPJA documentation