Im developing a JSP-servlet page for cponsulting the MAC adress of a host. So im doing it simple, I consult the IP of the host and then I search in te ARP table for it.

the SERVLET metod code is:

private String getMAC(String ipLocalHost) throws IOException{
        String cPING = "ping "+ipLocalHost;
        String cARP = "arp -a "+ipLocalHost;
        String hostMAC = new String();
        Runtime.getRuntime().exec(cPING);
        Process p = Runtime.getRuntime().exec(cARP);
        BufferedReader inn = new BufferedReader(new InputStreamReader(p.getInputStream()));        
        while (inn.read()!=-1) {
            String line = inn.readLine();
            String[] cad = line.split(" ");
            if(line.contains(ipLocalHost)){
                hostMAC = cad[3];
            }
        }      
        return hostMAC;
    }
When I publish, the servlet works perfectly almost on all servers. Im developing for a linux-Suse server, on ubuntu works, do not know why. The error i get is:

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Cannot run program "arp": java.io.IOException: error=2, No such file or directory
org.apache.jasper.servlet.JspServletWrapper.handle JspException(JspServletWrapper.java:460)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:361)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:321)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:257)
javax.servlet.http.HttpServlet.service(HttpServlet .java:729)
root cause

java.io.IOException: Cannot run program "arp": java.io.IOException: error=2, No such file or directory
java.lang.ProcessBuilder.start(ProcessBuilder.java :460)
java.lang.Runtime.exec(Runtime.java:593)
java.lang.Runtime.exec(Runtime.java:431)
java.lang.Runtime.exec(Runtime.java:328)
classes.getMachine.getMAC(getMachine.java:58)
classes.getMachine.doGet(getMachine.java:42)
javax.servlet.http.HttpServlet.service(HttpServlet .java:627)
javax.servlet.http.HttpServlet.service(HttpServlet .java:729)
org.apache.jsp.index_jsp._jspService(index_jsp.jav a:47)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet .java:729)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:321)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:257)
javax.servlet.http.HttpServlet.service(HttpServlet .java:729)
root cause

java.io.IOException: java.io.IOException: error=2, No such file or directory
java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
java.lang.ProcessImpl.start(ProcessImpl.java:65)
java.lang.ProcessBuilder.start(ProcessBuilder.java :453)
java.lang.Runtime.exec(Runtime.java:593)
java.lang.Runtime.exec(Runtime.java:431)
java.lang.Runtime.exec(Runtime.java:328)
classes.getMachine.getMAC(getMachine.java:58)
classes.getMachine.doGet(getMachine.java:42)
javax.servlet.http.HttpServlet.service(HttpServlet .java:627)
javax.servlet.http.HttpServlet.service(HttpServlet .java:729)
org.apache.jsp.index_jsp._jspService(index_jsp.jav a:47)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet .java:729)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:321)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:257)
javax.servlet.http.HttpServlet.service(HttpServlet .java:729)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.29 logs.


Can any one help me?