getHardwareAddress不适用于Orienti的IBMi(iSeries)

时间:2013-02-27 18:01:50

标签: java orientdb ibm-midrange

我实际上是在IBMi上运行OrientDB(应用了iSeries,AS / 400,V540,JDK6-32位最后一个CUM PTF)。 OrientDB早期做的事情之一(可以这么说)是尝试找到至少一个mac地址(不完全确定为什么我现在纯粹在本地嵌入模式下使用它)。我制作了自己的测试方法,结果相同:

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

系统输出显示一条消息:

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

并且无法使用调用getHardwareAddress()检索任何mac地址(实际上它返回null 3次)。我将它作为“程序员”类型用户和安全官(如“root”)运行,具有相同的结果。它在我的Ubuntu 12.04 PC和笔记本电脑上运行良好。

我想知道是否有其他人遇到过这个问题并找到了解决方案。

1 个答案:

答案 0 :(得分:1)

由于getkerninfo()是Unix / Linux上一般未记录的C系统调用,您是否在iSeries上的PASE中运行它?我首先怀疑这是唯一可能成功的环境。否则,似乎需要一个Linux分区。