简体   繁体   中英

getHardwareAddress not working on IBMi (iSeries) reqd for OrientDB

I am actually trying to run OrientDB on IBMi (iSeries, AS/400, V540, JDK6-32-bit last CUM PTFs applied). One of the things that OrientDB does early on (so to speak) is try to find at least one mac address (not entirely sure why as I am using it purely in local embedded mode for now). I have made my own test method which has the same results:

LogIt.log(Level.INFO,"About to list mac addresses.");
final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
while (networkInterfaces.hasMoreElements()) {
    NetworkInterface networkInterface = networkInterfaces.nextElement();
    final byte[] mac = networkInterface.getHardwareAddress();
    if (mac == null) {
        LogIt.log(Level.INFO,"Mac address is null.");
        continue;
    }  // if
    String hex = Utils.convertBytesToHexString(mac);
    LogIt.log(Level.INFO,"Mac address found {0}.",hex);
}  // while

The system output shows a message:

getkerninfo 1: A system call received a parameter that is not valid.

and it fails to retrieve any mac addresses using the call getHardwareAddress() (actually it returns null 3 times). I have run it as a 'programmer' type user and as a security officer (like 'root'), with the same results. It works fine on my Ubuntu 12.04 PC and laptop.

I would like to know if anyone else has come across this problem and found a solution.

Since getkerninfo() is a generally undocumented C system call on Unix/Linux, are you running this in PASE on your iSeries? I would first suspect that that's the only likely environment that might give success. Otherwise, a Linux partition seems called for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM