ReadSerialTest throws a null pointer because TestSerialPortWrapper returns nulls for its input and output streams. That looks like a bug in the test, and shouldn't affect the larger issue you seem to be asking about, so,
I believe you're writing code to use Modbus4J? We offer limited free support for this.
You are providing the SerialPortWrapper to the Modbus master you're creating an instance of, correct? If so you should set a breakpoint in your serial port wrapper and see what happens in the serial library you're wrapping for the 232 setup you're testing when it tries to get the input or output stream from your wrapper.
It does. I'm surprised you ask about Read Holding Registers, this is certainly a critical function of the datasource! It can be issued by the tool on the data source page using the read registers tool, or in the operation of the data source if it has holding register points. In Mango to force the use of writing multiple coils and others, check the box for "Use multiple write commands only" and save the data source.
Illegal Function generally means you are trying to read a slave device with a function code that is not supported by the device or in the modbus spec. You might try reversing your RS-485 wires or checking your code because I'd be surprised if 7F was a valid function code. The more common function codes are 03 and 04.
My mistake, I didn't see this was in the Modbus4J section, I gave the normal Mango answer.
When you placed common-logging.properties somewhere, that file was unique and on the classpath, correct?
I have not attempted what you are describing so I am guessing here... Looking at how Mango initializes its logging, it seems to me if you've got the commons-logging jar, the log jar and the log4j jar on the classpath, you should be able to configure it with a log4j.xml file being on the classpath too. There is probably a better way to init the LoggingFactory if you're only use of it is in the Modbus4J classes. Perhaps someone else could be more useful.