java.lang.NoSuchMethodError: org.apache.activemq.thread.TaskRunnerFactory.setThreadClassLoader(Ljava/lang/ClassLoader;)V
at org.apache.activemq.broker.BrokerService.
There are different reasons why this error can occur:
If the latter, you can put the following code into your class (before the code you shown in your question) to see where the class is loaded from:
Class clazz = TaskRunnerFactory.class;
String name = clazz.getName().replace('.', '/') + ".class";
String loc = clazz.getClassLoader().getResource(name).toString();
System.out.println(loc);