Jar或Jboss里无法读取配置文件
以前是通过这种方式加载配置文件:
private static void init() {props = new Properties();load();}private static void load() {try {props.load(PropertyUtil.class.getClassLoader().getResourceAsStream("ApplicationResources.properties"));} catch (IOException e) {throw new RuntimeException(e);}}
就没有问题了,在此记录一下。