what is the best way to run external binary or Unix-script from EJB? is there are any special requirements? notes? important moments?
I would be thankful if you'll be able to share some knowledge on this topic.
<a href="http://www.BossTalks.com" target="_blank" rel="nofollow">http://www.BossTalks.com</a><br />Free advices and help for entrepreneurs: from Idea to IPO<br />Software and IT Project Management forum
First of all, you might consider that your bean could be enlisted within a transaction. It would make me feel quite uncomfortable to know that the result of the transaction depends upon the result of an external process. If your process updates a file but the transaction rolls back, will the file be in a consistent state? Isn�t too much of a thought to have global (distributed) 2PC transactions depending upon an external, uncontrolled process? Second of all it might raise security issue. You have to grant to the container the permission to run that process. This means that all deployed applications can run the same process. Finally you might find this article pretty interesting: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html Regards.
I think, therefore I exist -- Rene Descartes
Joined: Jul 11, 2004
I understand all possible transactions problems. Unfortunatelly, there is a legacy part of our existing system, which we can't re-write using J2EE power at the moment. I will have to use it AS IS.
That's why I just have to call external binaries and scripts.
Thank you for your link. Will try to dig deeper into this.
By the way, one of requirements will be generating PDF from existing URL. Can anybody suggest some open-source J2EE library for this purpose?
For Generation of PDF files we have created a web service which accepts the data in XML file and the formatting info as XSLT file. This is flexible in the sense, other applications also call the same webservice to have the PDF generation power. We used Apache Axis and XML/XSL FO for the PDF conversation.