Rrugemalira
asked on
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
I'm using NetBeans 5.5.1 IDE with Visual Web Pack. My OS is Linux Fedora Core 6 and the server is Sun Java System Application Server.
I'm developing an application which includes a JSP to display a bar-chart graph using CeWolf.
I get the following two severe errors on running the JSP:
1. Message ID: StandardWrapperValve[Cewol fServlet]
Servlet.service() for servlet CewolfServlet threw exception
java.lang.NoClassDefFoundE rror: Could not initialize class sun.awt.X11GraphicsEnviron ment
at java.lang.Class.forName0(N ative Method)
2.Message ID: CewolfServlet
Could not initialize class sun.awt.X11GraphicsEnviron ment
java.lang.NoClassDefFoundE rror: Could not initialize class sun.awt.X11GraphicsEnviron ment
at java.lang.Class.forName0(N ative Method)
at java.lang.Class.forName(Cl ass.java:1 69)
at java.awt.GraphicsEnvironme nt.getLoca lGraphicsE nvironment (GraphicsE nvironment .java:68)
at sun.awt.X11.XToolkit.<clin it>(XToolk it.java:89 )
I'd appreciate your kind guidance in solving this problem
I'm developing an application which includes a JSP to display a bar-chart graph using CeWolf.
I get the following two severe errors on running the JSP:
1. Message ID: StandardWrapperValve[Cewol
Servlet.service() for servlet CewolfServlet threw exception
java.lang.NoClassDefFoundE
at java.lang.Class.forName0(N
2.Message ID: CewolfServlet
Could not initialize class sun.awt.X11GraphicsEnviron
java.lang.NoClassDefFoundE
at java.lang.Class.forName0(N
at java.lang.Class.forName(Cl
at java.awt.GraphicsEnvironme
at sun.awt.X11.XToolkit.<clin
I'd appreciate your kind guidance in solving this problem
ASKER
I'm using jdk1.6.0_02
The system monitor shows I have Xorg sleeping but consuming CPU. Moreover, I'm working in graphics mode with the netbeans IDE and I can see some graphics on the JSP pages when my application is running (except for the chart component)
You will forgive my ignorance, but I do now know where to setProperty("java.awt.head less", true)
In which code do I set it? In the jsp that renders the chart? In the bean that implements the dataset producer?
The system monitor shows I have Xorg sleeping but consuming CPU. Moreover, I'm working in graphics mode with the netbeans IDE and I can see some graphics on the JSP pages when my application is running (except for the chart component)
You will forgive my ignorance, but I do now know where to setProperty("java.awt.head
In which code do I set it? In the jsp that renders the chart? In the bean that implements the dataset producer?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I entered into Sun Java System Application Server Administration Console
Clicked on:
Application Server --> JVM Settings --> JVM Options
and added the JVM option: -Djava.awt.headless=true
Stopped the server and re-started it.
I'm now able to display the bar-chart graphics. Praise be to God!
I thank all of you for your kind help.
Clicked on:
Application Server --> JVM Settings --> JVM Options
and added the JVM option: -Djava.awt.headless=true
Stopped the server and re-started it.
I'm now able to display the bar-chart graphics. Praise be to God!
I thank all of you for your kind help.
The other option would be to use PJA Toolkit (http://www.eteks.com/pja/en/) instead of the standard AWT
Although... which JDK you use? For 1.4.2+, it may be enough to use java.awt.headless=true
setProperty( "java.awt.headless", true ); in the code or as a start parameter.