Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

running application from stateless session bean  RSS feed

 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using windows os and writing a stateless session bean.
My question is can i run an application (exe file) present in the local system from the ejb.
i.e i have written a helper class for achieving the above said objective. Can I call helper class from the bean?
Thanks in advance.
Regards
Arun
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will it work? Probably yes, at least in most containers. Is it a good idea? Probably not...
Kyle
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Thanks for the input.
Infact i tryed using weblogic6.1 application server it worked. Even i feel it is not correct. Then what would be the work around to achive the above said task?
-arun
 
Peter Reinhardt
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is really what your external command really does. Another problem you might want to consider is that your .exe will just run on Windows

Peter
 
Arun Boraiah
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Reinhardt,
Yes the ejb is designed to work in windows env, hences it will not case a problem. the exe file i am refering is an application which triggers some process to start in the system.
Now my question is how to run that exe located in the remote system from an EJB. I mean how to get a runtime of a remote system?
Thanks in advance.
-arun
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. You're going to have to put some kind of agent that can start this program (on whatever system) in response to some sort of signal.
This could be as simple as a little Java program that listens on a socket and then starts off the program in response to a message, or as complex as a system that listens on a JMS queue and then does the same thing.
Kyle
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!