private static Object newInstance(String clsnm, Class klass) throws ServletException {
		final Object o;
		try {
			o = Classes.newInstanceByThread(clsnm);
		} catch (Throwable t) {
			throw new ServletException("Unable to instantiate "+clsnm, t);
		}
		if (!klass.isInstance(o))
			throw new ServletException(o+" not an instance of "+klass);
		return o;
	}