I am working in Java and using tomcat server on Linux machine.
I between of my request/response process my server gets crashing all the time. This is highest severity issue.
Please help me in resolving this issue…as it is breaking all the functionalities and user can’t perform any operation.
Case 1 - If I start my server through telnet from windows XP machine everything is working fine and tomcat server runs and I can perform n number of operations.
Case 2 - If I start server from Linux machine then tomcat gets crashed.
Also, if I set display variable export “DISPLAY=MyMachineWindowsIPAddress:0.0” in windows machine and starts tomcat server then also servers gets crashed.
Java version – 1.6.0_10/1.6.0_11
Tomcat version – apache-tomcat - 6.0.14
Linux - Red Hat Enterprise Linux 5.2
Note - java1.6.0_10 is installed on linux while the code jar which is compiled and copied to webapps folder is compiled at java 1.6.0_11. hope this doesn't make any difference but just for an information i am adding this.
Message I got on tomcat crash-
An un expected error has been detected by JRE.
JAVA VM – java hotspot server VM <11.0-b15 mixed mode linux-86>
Instead of DISPLAY= (something) you should use -Djava.headless=true in Java 5+
We had an issue that caused JVM crashes in Redhat machines and Tomcat 6 with Java 6, but it was supposed to be fixed in Java6u10. At least it was for us, so your problem may be different.
Thanks for your suggestion, but my exact requirement is not to run tomcat server of Linux machine From Windows through telnet.
I mentioned the display thing because that is the setting with which can be reproducible at telnet..
But ideally Admin person will start tomcat from Linux machine only. & there still the problem is as it is...
I am very new to Linux so it would be helpful if you please explain what exactly " -Djava.headless=true" is and also the exect command to use this setting.
I can start server from both the ways...Requirement is to start server from linux machine only not from telnet.
Since linux machine is in the server room..all the time i didn't want to go there to start it again... i am starting through telnet.
and setting DISPLAY property to get the UI of linux on windows.
As of now..we forgot about DISPLAY from telnet... lets assume i am starting server from physical linux machine only.
Then also the server crash problem is still there.
can you drop the display setting and the and add -Djava.headless=true to the tomcat startup?
the simple way is to open catalina.sh and add this line near the top:
When Java does 'graphics stuff', it typically delegates to the graphical routines from the operating system.
If the operating system doesn't have any 'graphics stuff' installed (called a headless server) then you need to find a way to make the 'graphics stuff' work for Java.
In previous versions of Java we had to do some strange things to get code working on headless servers, but now Java can manage it for us, as long as we use the java.headless environment variable to tell Java to have a go.
Does that help?
It does look like your problem is related to the X11 code from the stack trace.
Thanks a lot for all your suggestions.
I implemented this and its working absolutely perfect.
Instead of "-Djava.headless=true" it is "-Djava.awt.headless=true".
But its really wonder for me that in the earlier days of my development things are working fine on LINUX but how all of sudden this gets changed?
Also, I found the exact line of code where server is crashing
In case of windows output on console is = toolkit=sun.awt.windows.WToolkit@b2197b
But in case of Linux executing at 1st line of code itself server crashes
And after adding the entry in catalina.sh file output is --- In linux toolkit=sun.awt.HeadlessToolkit@190efc
Can you please elaborate what is the difference between “sun.awt.windows.WToolkit” & “sun.awt.HeadlessToolkit” classes.