We can think of the given current which will be assumed uniform, as arising due to a negative current, flowing in the cavity, superimposed on the true current, everywhere including the cavity. Then, by superposition,
→B=12μ0→j×(A→P−B→P)=12μ0→j×→l
If →l vanishes so that the cavity is concentric with the conductor, there is no magnetic field in the cavity.