JasperDesign jd = JRXmlLoader.load(getClass().getResource("/reports/teacherPay.jrxml"));
This is not working some time, because getResource() returns URL. If your file path contains " " it returns "%20" Like this
"C:\\Users\\Sandaru Weerathunga\\Desktop\\Dasatha Institute\\src\\reports\\teacherPay.jrxml"
returns
"C:\\Users\\Sandaru%20Weerathunga\\Desktop\\Dasatha%20Institute\\src\\reports\\teacherPay.jrxml"
In that matter you can use getResourceAsStream() method that retuns InputStream. Try this, This works for me.
JasperReport jp = JasperCompileManager.compileReport(getClass().getResourceAsStream("/reports/teacherPay.jrxml"));