Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 6.0.14 crash on RedHat linux 5.2 with java 1.6

 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.


Scenario –
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>


Thanks
Sharad
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I'm not sure what the latest version of RHEL is, but you should look at Tomcat 6.0.18 and Java 6u12
/Dave
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,
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.

~Sharad
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to confirm, Tomcat is always running on RedHat Linux, the difference is whether you telnet to the Linux machine to start Tomcat, or start Tomcat from the physical RedHat machine?

I'm not sure why you are using the DISPLAY property on the windows machine, I thought it was on the Linux machine.

Question: is there a Windows Manager installed on the Linux box? (X Windows, Gnome, KDE etc)
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

here is the complete log.

 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question: is there a Windows Manager installed on the Linux box? (X Windows, Gnome, KDE etc)


I didnt have exact details of this.

But we are using X-windows X-Manager Utility to control the display of LINUX from windows.
and for this the DISPLAY setting is required.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dave,

Thanks a lot for all your suggestions.
I implemented this and its working absolutely perfect.

"-Djava.headless=true"
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.


~Sharad
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic