Results 1 to 4 of 4
- 09-11-2012, 07:57 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 2
- Rep Power
- 0
ProcessBuilder collapsing Glassfish 2.1.1
Hi, all.
I'm new in this forum and I have this situation:
- A button inside a JSP from a WAR app deployed on Glassfish 2.1.1 excecutes a shell script makeAdb.sh
- I use ProcessBuilder to set the parameters for the script
- I start the process builder and extract the info of the running process from a Process object returned by ProcessBuilder.start()
- Everything works just fine
- Nevertheless, if other users use the button while another process is running, glassfish stops working
- The server has to be restarted in order to put it back online
How could I tell the process to initiate another only if there are no other processeses running? Hopefully without using booleans.
Thank you!
- 09-12-2012, 04:08 AM #2
Member
- Join Date
- Jul 2012
- Location
- Earth
- Posts
- 75
- Rep Power
- 0
Re: ProcessBuilder collapsing Glassfish 2.1.1
- 09-12-2012, 07:30 AM #3
Member
- Join Date
- Sep 2012
- Posts
- 2
- Rep Power
- 0
Re: ProcessBuilder collapsing Glassfish 2.1.1
Thank you, sabre150.
Maybe I'm confused, but making code thread safe also applies when the code inside JSP from various .war files is executed?
I don't know exactly the mechanism behind glassfish and its deployed web apps, but it looks to me as is the code is executed independently, never converging on some code object, only the same server; I don't know if they share JVMs or somethg.
I just go:
Every war file has a jsp with this code. Is having various browsers accessing the same web app that executes code on the same server like having various browsers accessing different web apps that execute the same code on the same server?Java Code:ProcessBuilder pb = new ProcessBuilder("/bin/sh", "makeAdb.sh"); Process p = pb.start();
I think that although the code referes to this process p, they come from different web apps, so that's bad thread-safe-wise.
Thank you!
- 09-12-2012, 11:19 AM #4
Member
- Join Date
- Jul 2012
- Location
- Earth
- Posts
- 75
- Rep Power
- 0
Re: ProcessBuilder collapsing Glassfish 2.1.1
As shown that Java code is thread safe and though it seems to have all the classic flaws outlined in When Runtime.exec() won't - JavaWorld it should not in itself cause Glassfish to collapse. So is the shell program "makeAdb.sh" thread safe? I can envisage a situation where trying to run two or more "makeAdb.sh" scripts at the same time causes one of them to produce lots and lots of output on stdout or stderr which could possibily cause a deadlock when one of the buffers fills so the process is unable to continue running.
Last edited by sabre150; 09-12-2012 at 12:05 PM.
Similar Threads
-
Keep a JTree from collapsing
By PrinceSendai in forum AWT / SwingReplies: 1Last Post: 11-01-2011, 08:12 AM -
processBuilder
By Lund01 in forum New To JavaReplies: 3Last Post: 10-11-2011, 01:07 PM -
Using ProcessBuilder
By efebatistaarda in forum Advanced JavaReplies: 4Last Post: 02-11-2011, 08:40 PM -
Collapsing Box Problems
By AsylumDreams in forum Advanced JavaReplies: 2Last Post: 01-14-2010, 04:04 AM -
nested collapsing list
By roohja in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 01-05-2009, 07:15 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks