At least four people were injured after several shots were fired near a courthouse in Germany where a high-profile murder trial is taking place, police said.