axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Alonso <kalo...@vicomtech.org>
Subject Re: How to run .exe file located inside .aar
Date Thu, 03 Dec 2009 11:34:59 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="Calibri">Thank you for your help.<br>
<br>
Finally I solved the problem extracting exe from .aar to a temporal
file. and then executing it.<br>
<br>
Regards,<br>
<br>
Kevin.<br>
</font><br>
Philippe A. escribi&oacute;:
<blockquote
 cite="mid:a7f866480911300719t2d97df7ekf04e31e54ac752bb@mail.gmail.com"
 type="cite">That doesn't address directly your problem, but I strongly
recommend you have a look at Jakarta Commons Exec. It will save you
lots of trouble.<br>
  <br>
  <a moz-do-not-send="true" href="http://commons.apache.org/">http://commons.apache.org/</a><br>
  <br>
  <br>
  <div class="gmail_quote">2009/11/27 Kevin Alonso <span dir="ltr">&lt;<a
 moz-do-not-send="true" href="mailto:kalonso@vicomtech.org">kalonso@vicomtech.org</a>&gt;</span><br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">I
get the path of the file:<br>
    <br>
URL url =
getClass().getClassLoader().getResource("ColorClusteringFroga.exe");<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
String path = url.getPath();<br>
    <br>
(Path: C:/Program Files/Apache Software Foundation/Tomcat
6.0/temp/axis2-tmp-5629<br>
138317308731761.tmp/axis2593833549232759380WebService.aar!/execution.ex<br>
e)<br>
    <br>
But when I put it to execute:<br>
    <br>
Process p = Runtime.getRuntime().exec(path);<br>
    <br>
    <br>
&nbsp;I receive the following error:<br>
    <br>
java.io.IOException: Cannot run program "C:/Program": CreateProcess
error=2, The<br>
&nbsp;system cannot find the file specified<br>
    <br>
I think that it is becouse of !/<br>
    <br>
Any idea to solve this?<br>
    <br>
Thank you in advance.<br>
    <br>
Kevin.<br>
    <br>
    <br>
Deepal jayasinghe escribi&oacute;:<br>
    <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">
One way to do this is you can put the exe file somewhere else and you<br>
can define the location from a parameter (in services.xml) and then use<br>
the value of the parameter to load the exe file. One other way is you<br>
can get the URI of the exe file from axisservice, and you may try to<br>
execute it from that<br>
      <br>
classloader.getResource("execution.exe")<br>
      <br>
Thanks,<br>
Deepal<br>
      <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
1ex;">
Hello,<br>
        <br>
I have a web service that needs to call an .exe file and it is into<br>
the .aar file.<br>
        <br>
How can I do this? Which is the path I have to use in the instruction...<br>
        <br>
Process p = Runtime.getRuntime().exec("execution.exe");<br>
        <br>
Is there another way to do this?<br>
        <br>
Thank you in advance.<br>
        <br>
Kevin.<br>
        <br>
      </blockquote>
      <br>
      <br>
    </blockquote>
  </blockquote>
  </div>
  <br>
</blockquote>
</body>
</html>

Mime
View raw message