1832682 Members
2707 Online
110043 Solutions
New Discussion

Java error

 
zhitao guo
Occasional Contributor

Java error

 
guo zhitao
2 REPLIES 2
Tom Jackson
Valued Contributor

Re: Java error

Hi:

If I understand you, you are trying to generate a report using a servlet, and instead of displaying your report, you get the error trace. Looks like you have a servlet throwing an exception. Does the servlet produce any other output to the screen, log or error files? I use application specific log files to trace activity in my servlets. Using log files, I can write labels or variable values to the file to verify and trace. Some integrated development environments (IDEs) have debugging tools that allow you to step through servlet code and inspect variables. However, the server where the debugger runs needs to have the same servlet engine and configuration as your web server.

I can't tell where your servlet might be failing. You need to do some digging to see how far the servlet runs and determine where it fails.

Do any servlets run on your web server? You may want to start with hello world.

Tom
Mike Stroyan
Honored Contributor

Re: Java error

It looks like you are one step short of reaching this problem-
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x466ec1c4ceddd61190050090279cd0f9,00.html

You need to have an X server to render a chart. You can set the DISPLAY to an xvfb X server as described in that thread.

The exception thrown in your servlet seems like it might be a problem with finding the sun.awt.X11GraphicsEnvironment class-

java.lang.NoClassDefFoundError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:58)

I don't know what would cause that. The class should right there in /opt/java1.3/jre/lib/librt.jar.