From the documentation you linked
The first phase (§15.12.2.2) performs overload resolution without
permitting boxing or unboxing conversion, or the use of variable arity
method invocation. If no applicable method is found during this phase
then processing continues to the second phase.
Nothing happens here because none of the methods match (byte, int) without boxing one of the arguments.
The second phase (§15.12.2.3) performs overload resolution while
allowing boxing and unboxing, but still precludes the use of variable
arity method invocation. If no applicable method is found during this
phase then processing continues to the third phase.
In this step, both methods match if you do some boxing on the arguments. If you box byte, the arguments match
void m(Number n, int i) {
if you box the byte and the int, the argument match
void m(Byte b, Integer i) {
So several methods are applicable.
If several applicable methods have been identified during one of the
three phases of applicability testing, then the most specific one is
chosen, as specified in section §15.12.2.5.
If you go through all those rules, you'll find there is no more specific method, so the call is ambiguous.