Java Program destroys Linux Server Display or Server logs out Automatically
hi,
i am facing problem when my servlet program is running.
my servlet starts a process at server which is a simple java program which publishes PDF,
XML, RTF files and lates long to run for about 45 minutes.
i give a call to a shell file on the server (Red Hat Linux 9.0) which in turns calls a java
program that runs on gnome-terminal.
i have started Tomcat from SSh for that i have exported DISPLAY (Environment variable) from
.bash_profile. i need to do this because i need graphics environment (X11 Windows) for jfor
which is used print jpeg images in PDF and RTF reports.
PROBLEM
Some time my server display gets destroyed or the server gets Logout automatically, when my
process is running.
following is sode to start a gnome-terminal
strCommand="gnome-terminal -x /root/PWAppSh/StartPartialRunOff.sh PartialRunOffApp "+
strpubType + " " + strGroupNumber +" "+ id + " " + Cur_Time+" "+ strPubDate +" "+
strFromDate +" "+ strToDate ;
p = rt.getRuntime().exec(strCommand);
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(strRootPath
+ "/pw/WEB-INF/classes/pid.txt")));
pid= "";
while((pid = br.readLine()) != null)
getPid=pid;
ses.setAttribute("process",getPid);
ses.setAttribute("RunType",strrunType);
System.out.println("#Get Process ID:"+getPid);
FileOutputStream fos = new
FileOutputStream(strRootPath+"/pw/System/Mgmt/Sessions/RunoffOutput.txt");
Stdout_Stderr errorGobbler = new
Stdout_Stderr(p.getErrorStream(), "ERROR");
// any output?
Stdout_Stderr outputGobbler = new
Stdout_Stderr(p.getInputStream(), "OUTPUT",
fos);
// kick them off
errorGobbler.start();
outputGobbler.start();
// any error???
int exitVal = p.waitFor();
System.out.println("StartRunoff ExitValue: " +
exitVal);shell script that get executed from servlet is as followes
cd /
cd /share/Tomcat-4/jakarta-tomcat-4.1.31/webapps/pw/WEB-INF/classes
echo $$ > pid.txt
echo "Path: `pwd`"
echo "Process ID:" $$
chmod 777 pid.txt
echo Redirecting ProcessID
echo "Current shell : " $SHELL
export
PATH=$PATH:$HOME/bin:/usr/java/j2sdk1.4.2_08/bin:/usr/java/j2sdk1.4.2_08/lib:.:/share/amol/l
ib/.:
export
CLASSPATH=.:/share/amol/lib/activation-1.0.1.jar:/share/amol/lib/ant.jar:/share/amol/lib/ava
lon-framework-cvs-20020806.jar:/share/amol/lib/batik.jar:/share/amol/lib/fop.jar:/share/amol
/lib/jfor-0.7.2rc1.jar:/share/amol/lib/xalan-2.4.1.jar:/share/amol/lib/mail-1.2.jar:/share/a
mol/lib/xerces-1.2.3.jar:/share/amol/lib/jimi-1.0.jar:/share/amol/lib/logkit-1.0.1.jar:/shar
e/amol/lib/firebirdsql-full.jar:/share/amol/lib/xercesImpl-2.2.1.jar
exec java -server -Xmx256m -Xoss200M PW/Runoff/$1 $2 $3 $4 $5 $6 $7setting that i have done in .bash_profile file
DISPLAY=$HOST:0
export DISPLAY HOSTcan any one suggest or any solution to problem why my linux server Logsout ar display gets
destroyed when my Program is runnig on Gnome terminal.
kindly help me,
Thanks in advance for ur most important suggestion or solution.
Sounds a lot like a bug in some of the native libraries you use (or even in AWT). Try looking into your log files (especially for X and for your tomcat) to find out if any error messages are printed.
Additionally there are X servers out there that don't need any concrete display hardware to run (Xvfb comes to my mind, but IIRC there are more modern alternatives available). Usign that might or might not solve your problem, but would be a good idea either way.
Similar Messages
-
How to run Java program as Daemon Server in linux
How to run Java program as Daemon Server in linux
i would like to run the java program on system start up in a redhat linux system
can any one provide rc.status filehttp://wrapper.tanukisoftware.org/
-
How to run a standalone java program with JRC to display/run a report
Hi All,
I am new to this forum.
I am trying to run a java program developed using JRC to run a report created using Crystal Report XI. I stucked because not knowing how to run that java program.
Can anyone help me? or
can give a simple java code to do the same.
Thanks in advance.
Saravanakumar.Hi Saravana
For the steps to run a standalone application java program with JRC to display/run a report ,please refer the following link.
http://support.businessobjects.com/communityCS/TechnicalPapers/cr_xi_r2_jrc_deployment.pdf.asp
You can get the sample code for standalone/desktop applications from the following link.
http://support.businessobjects.com/communityCS/FilesAndUpdates/crxi_r2_jrc_desktop_samples.zip.asp
Please do revert in case of any queries.
Thanks
Soni -
Running java program as a server
Please advise of what's difference in running java program with -server option and just runing it like java program1?
Thx-server option uses the server VM for the program and if you use -client it will be run using client VM. Default is client.
The main difference is the optimations. When you are running with -client option the program is optimized to startup faster and to give better response times.
-server option optimizes for better resourse management which is important than start up time in server systems -
Putting java programs to the server
Is there any fast way/tutorial to put a java application to the server for multi users?
Can it be done easily by using Eclipse?
Can any one help me please?
Thank you.It's silly to say that I'm very new to Java and Eclipse.
Actually, I've done a project to update data for a company, and I need to find a way to put it into the company server. This program using Swing to show a GUI and allow one user update data at a time. Then data will be saved to file(configuration file), therefore, only one user can do it at a time.
Please help me for any quick tutorial or sample codes which are similar to my job.
Thank you. -
Java.lang.ClassCastException in server log
Hi,
We are seeing following error repeatedly in Weblogic server log, have any one seen this kind of error?
<ExecuteRequest failed
java.lang.ClassCastException: weblogic.servlet.internal.session.MemorySessionData.
java.lang.ClassCastException: weblogic.servlet.internal.session.MemorySessionData
at weblogic.servlet.internal.session.ReplicatedSessionContext.sync(ReplicatedSessionContext.java:175)
at weblogic.servlet.internal.ServletRequestImpl.syncSession(ServletRequestImpl.java:2564)
at weblogic.servlet.internal.ServletRequestImpl.syncSession(ServletRequestImpl.java:2549)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3920)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2756)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
>
Environment:
RedHat Linux 4
Weblogic 8.1 SP6
Thanks,
Uday Bhasker J.java.lang.ClassCastException - It is trying to convert a class from one type to another.
Please concentrate on Session Replication and try to find out the particular application is causing the issue. -
Need help with running a Java program on Linux
I am trying to get a Java program to run on a Linux machine. The program is actually meant for a Mac computer. I want to see if someone with Java experience can help me determine what is causing the program to stall. I was successful in getting it installed on my Linux machine and to partially run.
The program is an interface to a database. I get the login screen to appear, but then once I enter my information and hit enter the rest of the program never shows, however, it does appear to connect in the background.
Here is the error when I launch the .jar file from the command screen:
Exception in thread "main" java.lang.IllegalArgumentException: illegal component position
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
I am not a programmer and I am hoping this will make some sense to someone. Any help in resolving this is greatly appreciated!Well, without knowing a little bit about programming, and how to run your debugger, I don't think you're going to fix it. The IllegalArgumentException is saying that some call does not like what it's getting. So you'll have to go in an refactor at least that part of the code.
-
Running a perl shell command through a java program on linux platform
i'm trying to execute the following command in a java program "perl xxx.pl" using the runtime.getruntime method
here is the piece of code
String[] cmd={"perl","-c","AraMorph.pl",""};
Process p = Runtime.getRuntime().exec(cmd,null,new File("/home/ahmed/buckwalter_morphan_1/data"));
p.waitFor();
BufferedReader in=new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line=in.readLine())!=null)
System.out.println(line);
but it doesn't output anything even if i tried to print the output to a file
i'm trying to execute this program on linux platform but its working properly on a windows platform
thx
raarString[] cmd={"perl","AraMorph.pl"," </home/ahmed/in.txt"," >/home/ahmed/ast.txt"};
Process p = Runtime.getRuntime().exec(cmd,null,new File("/home/ahmed/buckwalter_morphan_1/data"));
BufferedReader in=new BufferedReader(new InputStreamReader(p.getErrorStream()));
String line;
while ((line=in.readLine())!=null)
System.out.println(line);
p.waitFor();
String str2=p.getInputStream().toString();
System.out.println("==================================="+str2);
and it still outputs nothing but goes in something like infinite loop or as assumed in the article u suggested a deadlock but even all solutions to all pitfalls didn't succeed -
How to execute a java program in linux ternimal shell??
currently i have write a simple culculation program, i want to know how do i can execute it in LINUX ternimal shell??? rigth now i only can execute it in JAVA program...
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/unix.html
-
Calling C++ method from Java program on Linux
I'm trying to get set up to call a C++ method from a Java app on a SUSE Linux box. I follow the steps of the "Hello World" baby example in Beth Stearns's tutorial, "Integrating Native Code and Java Programs", but I get the following error message:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /users/dmizell/testIF/libhello.so: /users/dmizell/testIF/libhello.so: invalid ELF header (Possible cause: endianness mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1778)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1703)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at HelloWorld.<clinit>(HW.java:7)
at Main.main(Main.java:5)
Any idea what I might be doing wrong?
thanks
DavidYour library is compiled in a way which is incompatible with the VM you are using.
Note that there is a JNI forum. -
Hi All
I'm beginner with linux
I have java program and I can run it in windows7 with bat file
jre1.6.0_04\bin\java -classpath "..\classes" database_com.Main_Class 7778
pauseI want to run this program in linux but I can't
I try run this program with bat file :
/java-1.5.0-gcj-4.3-1.5.0.0/bin/java -classpath "../classes" database_com.Main_Class 7778
pauseplease help meOra-dbaabode wrote:
I want to run this program in linux but I can'tImagine you have a splitting headache and decide to go to the doctor. You come into his (or her) office and say, Doc, I'm not feeling to well. The doctor replies and asks, well, what seems to be the problem? You reply: "well, I just don't feel too good". See where I'm getting at (hint: missing details!).
As for your JDK, I highly, no, I very highly recommend you get rid of GCJ and install Sun's JDK. This may very well be the source of your problems. GCJ is a pain in the @ss! -
I wrote quite nice (I think so) program in java and I'd like to write bash script to run this java program, so I wrote:
#!/bin/bash
java lecznica
lecznica it's the main class of my program.
When I running this script from shell, everything is OK, but, when I've made desktop shortcut to this script -it doesn't work. Why? Tell me another thing how to add information about additional packages with java libraries. The -classpath option doesn't work.Maybe your question was misunderstood:
the classpath option only tells your interpreter where to find the libraries in your filesystem.
You still need to inform the compiler which packages you are using in your class using the import directive.
For example;
import com.lion.DrawRect; // tells the compiler that we will be using DrawRect from package com.lion
...and
java -classpath \opt\include\java\libs\RectLib.jar footells the compiler to run the class foo, and to look in \opt\include\java\libs\RectLib.jar to search for classes. -
How to send mail through java program in solaris server
hi
i am writing java code to send the mail using my company SMTP
,the program is working fine when i run and deploy in windows environment
but at the same time when i deploy the war to sun solaris server ,it is not working
and throwing the Error saying
java.lang.Exception: Invalid Addresses; nested exception is: javax.mail.SendFailedException: 553 sorry, that domain isn't allowed to be relayed thru this MTA without authentication #5.7.1 at jsp.SendMail._jspService(_SendMail.java:137)
i am using the Authentication also using user id and password of same domain and it is able to authenticate
in windows but not in Solaris
where i am making mistake plz
guide.
Saurabhthanks Alan
but i think there is some other problem because same code is
working when i am using in windows as well as i am using authentication method
also but it is not working when running in Solaris Environment
here is the code i am using to send the mail
props.setProperty("mail.transport.protocol", "smtp");
props.setProperty("mail.host", "smtp.mycompany.com");//smtp protocol for IIBF
props.put("mail.smtp.starttls.enable","true");//setting start TLS to be true
props.put("mail.smtp.auth", "true");// authentication is false
props.put("mail.smtp.port", port);//setting the port number it can be either 25 or 587
props.put("mail.smtp.username", "noreply");
props.put("mail.smtp.password","noreply");
props.put("mail.debug", "true");
Authenticator auth = new SMTPAuthenticator();
Session session1 = Session.getDefaultInstance(props);
java.util.Properties sessionProperties = new java.util.Properties();
sessionProperties.put("mail.smtp.auth", "true");
message.setFrom(new javax.mail.internet.InternetAddress(From ,"name"));
message.addRecipient(javax.mail.Message.RecipientType.TO, new javax.mail.internet.InternetAddress(To));
message.setText(TextCo);
message.setSubject(subject);
message.setContent(boyd, "text/plain");
message.reply(true);
Transport trans = session1.getTransport("smtp");
trans.connect(SMTP_HOST_NAME, SMTP_AUTH_USER, SMTP_AUTH_PWD);
boolean ddd = trans.isConnected();
message.saveChanges();
trans.sendMessage(message, message.getAllRecipients());
above code is working properly in windows but not in Solaris
plz guide what next to do
thankx in advance
saurabh -
How can I run a java program on Linux?
I have JBuilder's IDE installed on my Linux partition and it works. However I don't know how to compile and test a program without it. Also I tried to install Limewire on Linux and although I've installed the Java SDK on the system. Once before I installed JBuilder and then JBuilder (I guess) installed it again. However it told me it couldn't find the Java Virtual Machine. Isn't this installed with the JDK? I am able to run programs through JBuilder so I can't see why I'd have a problem. Any answers to the above issues would be greatly appreciated.
Go here and work out how to make a simple app to compile and run on the command line: http://java.sun.com/docs/books/tutorial/getStarted/cupojava/unix.html#2b
(You should find the JDK from a directory under the jbuilder directory so use that and not the /usr/local/jdk1.4 in the example.)
Then find the classes or source code of your project and do the same thing to it. -
Linux server logs Cluster Ready Services completed waiting on dependencies
hi all
we run oracle 10g RAC on two nodes of SLES 10 SP2 Itanium.
on node 1 of the db node I see this message.
Mar 13 15:35:03 odbs1 logger: Cluster Ready Services completed waiting on dependencies.
This message has appeared for the second time in 3 days. the server is behaving normally. Could someone please let me know what exactly is the cause.
i tried to google a bit but i am not an expert in RAC
Could someone please let me know if this is a major issue or is it a generic message for somethingHi,
It means that the CRS not came up on startup and you put it online manualy.
Check your ocssd.log for messages like it
[ CSSD]2007-09-13 15:43:00.038 [1147169120] >TRACE: clsc_send_msg: (0x7271b0) NS err(12571, 12560), transport (530, 113, 0)
If they exists, the explanation is: The network on OS startup is slower than CRS and the CRS cannot communicate with others nodes with interconnect. To avoid split brain problem, it kills himself causing automatic start of CRS fails.
This problem could be solved add a sleep on /etc/rc.d/rc3.d/SXXXinit.crs before line $ID/init.cssd autostart. Try sleep 15, sleep 20 and test restart of node.
You can see it on My Oracle Suporte note ID 459169.1
I hope it helps!!
Best Regards,
Rodrigo Mufalani
www.mufalani.com
Maybe you are looking for
-
Hi I can't see call+SMS block feature after amber update .i checked in settings and extras+info it's not there pls help with this. I have Lumia 520
-
Purchased a blue-ray writer to back up pictures with. It came with a usb 2.0 cable and a sata cable. Is there a way to use the sata cable with my macbook pro?
-
Production order Relase status Batch is picked in Delivery
Hi friends, Presently in system, Production order Relase status Batch is allocated in Delivery due to Availability checking group & rule.Now as per requirement only Confirmed Production order Batch should allocat in delivery,then what setting shoul
-
Oracle Portal - charts language problem
I'm using Polish Oracle Portal 3.0 with database 8.1.7. OS is w2k Professional (Polish version). I can't force it to display Polish letters in charts (as subscribes), but !! anywhere else I can write anything I want using Polish language and its O.K.
-
Dear I made a presentation in flash where I use some flv movie exported from aftereffect. so when I finally export a movie in swf from flash. I running perfectally on my PC coz I have adobe media player but If I send to client is not running on his P