-
1. Re: Killing a process using sytem call from seam
gonorrhea May 5, 2009 8:35 PM (in response to alankrum)That is a WARN level output. It's stating that you have not setup any security for your app (most likely you are using Seam 2.1.x).
as far as killing a process from a Seam component, I've never even thought of or heard of that for a Seam app. That's a strange requirement IMO.
There's a way to terminate the running JVM:
System.exit();
but you're trying to kill a specific process. You may need to use JNI but not sure...
-
2. Re: Killing a process using sytem call from seam
alankrum May 5, 2009 10:51 PM (in response to alankrum)im pretty sure that ¨kill -9 2447¨is triggering the warning
because if i change that line of code to
Process p;
p=Runtime.getRuntime().exec("mkdir new¨);
there is no warning in the log and the folder gets created.
but with:
Process p;
p=Runtime.getRuntime().exec("kill -9 2447¨);
i do get the warning and the process is not killed......
i am using Seam 2.1.1, do you think that by setting up security on my app i can get around this?
if yes, do you have any reference on how to do this?
thanks a lot
alan -
3. Re: Killing a process using sytem call from seam
cash1981 May 7, 2009 11:12 PM (in response to alankrum)I think I had the same problem.
What I did as a workaround is creating a script that did the same thing. Remember to also dobbel check that the jboss or whoever the user is has killing rights. -
4. Re: Killing a process using sytem call from seam
cash1981 May 7, 2009 11:16 PM (in response to alankrum)I have had no problem with this. Nor did I need a Conversation or Transactional.
I blogged a bit about it here: How to create and use webservice with seam
-
5. Re: Killing a process using sytem call from seam
nickarls May 8, 2009 7:44 AM (in response to alankrum)Some conciderations:
- kill only works on unix boxens
- exec likes binaries. mkdir is a binary, kill is a shell builtin. You will probably need to execute a shell and execute the kill as a parameter
-
6. Re: Killing a process using sytem call from seam
alankrum May 8, 2009 8:54 AM (in response to alankrum)i tried with a script already,
it is weird because if i run the script myself, the process gets killed, but if i run the script from my seam project it doesnt. i get the same warn as before.....my user has killing rights, an im the one running jboss. i dont understand this
-
7. Re: Killing a process using sytem call from seam
alankrum May 8, 2009 8:58 AM (in response to alankrum)can u explain me please how to execute a shell with kill as a parameter?
do you mean i should use a shell/bash script???thanks
-
8. Re: Killing a process using sytem call from seam
nickarls May 8, 2009 9:52 AM (in response to alankrum)Depends on the shell, I think -c is common. You could also script it.