• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB and Runtime.getRuntime.exec()?  RSS feed

 
Paulo Aquino
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys i have a problem here..i hope you can help me, im still quite new in EJB technology anyway, here it goes....I use Weblogic as my EJBContainer, i need to used the command Runtime.getRuntime().exec("dir"), after that i need to capture the result of this command....do you think its possible for me to do that using the set up i mention above? I already used the command Runtime.getRuntime().exec in normal java programming but im still clueless whether i can use this in EJB and weblogic....
[ October 21, 2002: Message edited by: Paulo Aquino ]
 
Eduard Manas
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paulo,
I don't know what the EJB spec says about that, but the fact is that I have seen code using Runtime.exec(cmd) in Weblogic and it works perfectly fine. I don't know if it is fully J2EE compliant though...
However, you need to be careful, as the command you pass is operating system dependent, so you may end up running into trouble if you want to port to other platforms in the future.

Eduard
 
HanMing Low
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If I'm not wrong, you can do this.
But it is not recommended in the specification.
AppServer like Weblogic, Borland Enterprise Server can, but RI disallow it.
The reason is also for the transaction context this spawn off process it belong.
Somebody make a very good explain on this sometime back.
So, you may wants to do a search into the archive.
Hope this helps.

Han Ming
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!