This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EJB invoking command line utility Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB invoking command line utility" Watch "EJB invoking command line utility" New topic
Author

EJB invoking command line utility

sanker san
Ranch Hand

Joined: Dec 17, 2004
Posts: 56
We need to invoke a command line utility and read the output/error from a stateless session bean. Will there be any problems if we use Runtime.getRuntime().exec(command) to invoke the command line utility. Please advise.
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
other than it being relatively slow,
i don't think doing it in EJB would be any different than doing it in plain java


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Mike Keith
author
Ranch Hand

Joined: Jul 14, 2005
Posts: 304
Originally posted by Bill Shirley:
other than it being relatively slow,
i don't think doing it in EJB would be any different than doing it in plain java


...except that EJB containers are not supposed to permit spawning of threads or processes. Most will disallow it, although a few do allow it. It will depend upon the container you are running in and the security tolerance it has. The fact that a thread is being spawned from an EJB will not affect performance, though.


-Mike
Pro JPA 2: Mastering the Java Persistence API
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: EJB invoking command line utility
 
Similar Threads
java code to export mssql data into csv file
How to create solaris package using Maven
linux cron task to invoke java class
Creating spanned ZIP with Java?
ldap, more than 1000 returns