QM before Xmas: canonical quantisation

Taking the trace of the canoncial commutation relation \(\left[x,p\right]=\mathrm{i}\hbar\) gives the result \(0=\mathrm{i}\hbar\) because the trace \(\mathrm{tr}(xp-px) = \mathrm{tr}(xp)-\mathrm{tr}(px) = 0\). Can you resolve this?