mattjlewis / diozero

Java Device I/O library that is portable across Single Board Computers and microcontrollers. Tested with Raspberry Pi, Odroid C2, BeagleBone Black, Next Thing CHIP, Asus Tinker Board and Arduinos / Pico. Supports GPIO, I2C, SPI as well as Serial communication. Also known to work with Udoo Quad.
https://www.diozero.com
MIT License
261 stars 59 forks source link

MockFactory throws warning exceptions when run on non-supported systems (non-critical) #185

Closed EAGrahamJr closed 7 months ago

EAGrahamJr commented 10 months ago

Note this is just a warning, but it does arise persistently when using the MockDeviceFactory.

09:32:37.649 [pool-1-thread-1] WARN com.diozero.sbc.LocalSystemInfo.populateFromDeviceTreeModel - Unable to process file '/proc/device-tree/model': java.nio.file.NoSuchFileException: /proc/device-tree/model
09:32:37.651 [pool-1-thread-1] WARN com.diozero.sbc.LocalSystemInfo.populateFromDeviceTreeCompatible - Unable to process file '/proc/device-tree/compatible': /proc/device-tree/compatible: java.nio.file.NoSuchFileException: /proc/device-tree/compatible
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:181)
    at java.base/java.nio.channels.FileChannel.open(FileChannel.java:298)
    at java.base/java.nio.channels.FileChannel.open(FileChannel.java:357)
    at java.base/java.nio.file.Files.lines(Files.java:4132)
    at java.base/java.nio.file.Files.lines(Files.java:4227)
    at com.diozero.sbc.LocalSystemInfo.populateFromDeviceTreeCompatible(LocalSystemInfo.java:206)
    at com.diozero.sbc.LocalSystemInfo.<init>(LocalSystemInfo.java:129)
    at com.diozero.sbc.LocalSystemInfo.getInstance(LocalSystemInfo.java:101)
    at com.diozero.internal.board.GenericLinuxArmBoardInfo.<init>(GenericLinuxArmBoardInfo.java:75)
    at com.diozero.internal.provider.mock.MockDeviceFactory$MockBoardInfo.<init>(MockDeviceFactory.java:348)
    at com.diozero.internal.provider.mock.MockDeviceFactory.<init>(MockDeviceFactory.java:108)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
    at com.diozero.sbc.DeviceFactoryHelper.initialise(DeviceFactoryHelper.java:69)
    at com.diozero.sbc.DeviceFactoryHelper.getNativeDeviceFactory(DeviceFactoryHelper.java:108)
    at com.diozero.internal.spi.AbstractDeviceFactory.<init>(AbstractDeviceFactory.java:57)