aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Call external app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Call external app" Watch "Call external app" New topic
Author

Call external app

Robin Rodgers
Greenhorn

Joined: Aug 04, 2005
Posts: 3
Hi. I have a J2EE app where I am keeping versions of a text field in a database, and I need to be able to view the differences between the versions and merge them where necessary. I thought about using WinMerge (free) and writing temp files for the text fields, but I don't know how to open WinMerge from within my app. Would this work from within a J2EE app? How would I start it from my program? (I am using Spring throughout and JSPs on the front end.) Thanks!
Marco Barenkamp
Ranch Hand

Joined: Aug 27, 2001
Posts: 94
Hi, you may use ProcessBuilder (Java5) or java.lang.Runtime (Java1.4)
to invoke the program. But beware: You are not allowed to inkoke
that program from within your J2EE App (acc. to the spec.), but you
may implement a JCA connector or a MBean (hope, you have an MBean server in your apserver) that provides the invocation.
(or use JNI if you are able to implement C code and you have a static library or dll, you can adopt)


Marco Barenkamp<br />_ _ _ _ _ ________________________ _ _ _ _ _ <br />L M I N T E R N E T S E R V I C E S AG<br /> <br />Head of Software Development<br /> <br /> <br />BEA Certified Enterprise Developer<br />Sun Certified Programmer for the Java2 Platform<br />Sun Certified Web Component Developer for the Java2 Platform<br />Sun Certified Developer for the Java 2 Platform <br />Sun Certified Business Component Developer for the Java 2 Platform <br />Sun Certified Enterprise Architect for the Java 2 Platform Enterprise Edition<br /> <br />LMIS AG
Robin Rodgers
Greenhorn

Joined: Aug 04, 2005
Posts: 3
Thanks for the quick response. I have a couple more questions (all this is new to me.) If I use, say, an MBean, would it invoke WinMerge on the server or on the user's machine? If on the server, would the user see it? What benefits would using an MBean have, e.g., knowing when WinMerge closes maybe? Are there any other diff tools for use in internet apps? Thanks!
Marco Barenkamp
Ranch Hand

Joined: Aug 27, 2001
Posts: 94
The process would run in the server, because the MBean lives inside the
AppServer. Due to the fact, that the MBean owns the process of the
win32 application, you are able to get to know whether the process is still
alive or not.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Call external app