异常堆栈跟踪并没有提供太多信息,只是
javax.naming.OperationNoSupportedException
public static Connection getConnection(Context ctx, String factoryName) throws JMSException, NamingException {
Object objfac = null;
try {
objfac = ctx.lookup(factoryName);
} catch (NoClassDefFoundError e) {
throw new NamingException("Lookup failed: "+e.toString());
}
if (objfac instanceof javax.jms.ConnectionFactory) {
@SuppressWarnings("unchecked") // The environment is supposed to use String keys only
Map<String, Object> env = (Map<String, Object>)ctx.getEnvironment();
if(env.containsKey(Context.SECURITY_PRINCIPAL)) {
String username = (String)env.get(Context.SECURITY_PRINCIPAL);
String password = (String)env.get(Context.SECURITY_CREDENTIALS);
return ((javax.jms.ConnectionFactory) objfac).createConnection(username, password);
}
else {
return ((javax.jms.ConnectionFactory) objfac).createConnection();
}
}
throw new NamingException("Expected javax.jms.ConnectionFactory, found "+(objfac != null ? objfac.getClass().getName(): "null"));
}
堆栈跟踪是:
在 javax.naming.InitialContext.getEnvironment(InitialContext.java:544) 在 javax.naming.InitialContext.getEnvironment(InitialContext. java:544) 在 org.apache.jmeter.protocol.jms.Utils.getConnection(Utils.java:155) 在 org.apache.jmeter.protocol.jms.client.Publisher.(Publisher.java:130) 在 org. org.apache.jmeter.protocol.jms.sampler.PublisherSampler.sample(PublisherSampler.java:154) 在 org.apache.jmeter 的 apache.jmeter.protocol.jms.sampler.PublisherSampler.initClient(PublisherSampler.java:135)。 org.apache.jmeter.threads.JMeterThread 上的协议.jms.sampler.BaseJMSSampler.sample(BaseJMSSampler.java:80)。process_sampler(JMeterThread.java:429) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) at java.lang.Thread.run(Thread.java:722)