Problems using Jfreechart: Unable to display the chart on client machine and Tomcat crash

Hello,
I am running JDK1.4 on solaris with Tomcat. Implemented Jfreecharts from http://www.jfree.org/jfreechart/
I have 2 issues:

1. I am unable to display the chart on the browser unless I do the following 2 things:
a. set display to my pc
b. Start xwindows on pc.
This both will be impossible to do when I want to implement my code to production for public. How can I work around this issue. Please send sample config file code if I can work around with webserver settings.

2. My tomcat seems to crash regulrly when I do as above and access the chart url. I tried it on different servers(different tomcat) and same issue. Not sure if the peoblem is related to the display problem above.

Thank you.
makam_75Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ramazanyichCommented:
to avoid problems with graphics without Xserver you can start Tomcat with folowing JVM property:
-Djava.awt.headless=true
0
makam_75Author Commented:
I read this but not understanding where to add this in the tomcat config file. can u post a sample. thanks.
0
makam_75Author Commented:
Also, I will be moving to Sunone webserver soon. Is there a similar config for Sunone?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

ramazanyichCommented:
It is a parameter for JVM. So if your webserver will use java then it is the same. NOTE: that parameter works only beginning with JDK 1.4, for JDK1.3 it doesn't work.
0
objectsCommented:
> where to add this in the tomcat config file.

Add it to the environment variable JAVA_OPTS, something like the following (depending on your shell):

setenv JAVA_OPTS -Djava.awt.headless=true

Include that in the startup script for the user that tomcat is run as
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ramazanyichCommented:
for tomcat set in your startup.sh:
setenv JAVA_OPTS -Djava.awt.headless=true
0
objectsCommented:
Don't set it in startup.sh, set it in the users startup script as I suggested above.
0
makam_75Author Commented:
What is the disadvantge in setting this in tomcat start up script?
Where is the users start up script?

I read on the web to do
 setenv CATALINA_OPTS -Djava.awt.headless=true

Is CATALINA_OPTS same as JAVA_OPTS ?

0
objectsCommented:
> What is the disadvantge in setting this in tomcat start up script?

You don't want to be changing the startup script.
If you install a new version you will have to redo the change.
Also you may want to run tomcat with different setting depending on who's running it.

Thats why they allow you to specify options via environment variables.

> Is CATALINA_OPTS same as JAVA_OPTS ?

Basically yes, JAVA_OPTs are passed before CATALINA_OPTS in the command line.
0
makam_75Author Commented:
Thanks, And where is the users start up script?
Is there a script or did you mean I should type it in the command line each time i start tomcat?
0
objectsCommented:
In there home directory, name depends on the shell you are running
0
objectsCommented:
Perhaps just set it on the command line first to test it works.
0
makam_75Author Commented:
Will do, Thanks!
0
makam_75Author Commented:
Sorry I meant to choose objects answer as "Accepted Ans" since he gave me the complete syntax.
0
objectsCommented:
thats ok :)
0
makam_75Author Commented:
I have posted a community support qn. hopefully it gets responded.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.