In electrostatics Maxwell's equations for the magnetic field are
$\nabla \cdot B = 0$ and $\nabla \times B = \mu_0 J$
Now, take $B = xi-yj$, where $i$ and $j$ are the usual unit vectors, then one can show that
$\nabla \times B = 0$
which consequently means that $J=0$.
But in Maxwell's equations, isn't that $J$ supposed to be the source of the magnetic field B?
Then how come $J$, the source of the magnetic field, is zero yet $B$ is not zero? What am I missing?