Boundary condition on $\mathbf{B}$ to describe resonant cavities from waveguides In Jackson- Classical Electrodynamics when resonant cavities are discussed (8.6, page 252)  (but also at page 7 here or at page 19 here) the explanation is made by saying that the solution is the same of a rectangular waveguide, which we can suppose that is for $E$
$$\mathbf{E}(x,y,z,t)=\mathbf{E_0}(x,y) e^{i(\alpha z-\omega t )}$$
$$\mathbf{B}(x,y,z,t)=\mathbf{B_0}(x,y) e^{i(\alpha z-\omega t )}$$
but instead of $e^{i(\alpha z )}$ there is a factor $H \cos(wz)+J \sin(wz)$, so
$$\mathbf{E}(x,y,z,t)=\mathbf{E_0}(x,y) [H \cos(wz)+J \sin(wz)]e^{-i \omega t }$$
$$\mathbf{B}(x,y,z,t)=\mathbf{B_0}(x,y)  [H' \cos(wz)+J' \sin(wz)]e^{-i \omega t }$$
And the boundary conditions imposed are teh following (supposing the lenght of cavity to be $d$ in $z$ direction)
$$B_z(z=0)=B(z=d)=0 \,\,\,\,\,\,\,\,\,\,\, \forall x,y  \tag{1}$$
$$E_x(z=0)=E_x(z=d)=E_y(z=0)=E_y(z=d)=0 \,\,\,\,\,\,\,\,\,\,\, \forall x,y \tag{2}$$
While $(2)$ is clear because it simply requires the electric field to be normal to the surface (which is the necessary condition to avoid dissipation), I do not see why $(1)$ is required.
It would be explained by the fact that $E$ is perpendicular to $B$ but that's a conclusion that one should get from the solution, not an assumption to  impose the boundary conditions. Unfortunately I did not find an explanation for $(1)$ neither on Jackson neither on the references so why is $(1)$ a necessary boundary conditions to impose?
 A: Your equation (1) comes from the fact that the normal component of the magnetic field should always be continuous at the boundary. This means that since the magnetic field is zero inside a perfect electric conductor(PEC), the normal component of the magnetic field on the boundary should also be zero because of its continuity.
If you're not sure why the magnetic field is always zero inside a PEC, consider Faraday's law: 
$$\Bbb \nabla \times \mathbf E(\mathbf r,t) = -\frac \partial{\partial t} \mathbf B(\mathbf r,t)$$ 
Inside a PEC, the electric field is always zero, so $\mathbf E=0$ and we get:
$$\frac \partial{\partial t} \mathbf B(\mathbf r,t)=0$$
This means that the magnetic field is constant in time; i.e. it has not, and will not change from the beginning of time to its end (if it has one !). Now since in all practical cases, the magnetic field is zero inside the PEC at some point in time (e.g. before one has turned on the circuit), the magnetic field is always identically zero, because it cannot change. 
Thus we conclude that the magnetic field inside a PEC is always zero.
P.S. The electric field and magnetic field inside a cavity are not perpendicular, a (rectangular) cavity has TE (transverse electric) and TM (transverse magnetic) modes, in which the fields cannot be orthogonal. 
