java.lang.Exception: ConnectionPool configuration file 'conf\ConnectionPool.cfg'not found 这个异常是自己抛出的private boolean loadConfig(String name) throws Exception { boolean rc = false; // Get our class loader ClassLoader cl = getClass().getClassLoader(); // Attempt to open an input stream to the configuration file. // The configuration file is considered to be a system // resource. java.io.InputStream in; if (cl != null) { in = cl.getResourceAsStream(name); } else { in = ClassLoader.getSystemResourceAsStream(name); } // If the input stream is null, then the configuration file // was not found if (in == null) { throw new Exception("ConnectionPool configuration file '" +name + "' not found");
然后调用
java.io.InputStream is = <TestClass>.class.getResourceAsStream("ConnectionPool.cfg")
或者URL url=com.todaynic.jft.Arrstatic.class.getResource("ConnectionPool.cfg");
File big=new File(url.getPath());
来调用
这个方法我试过了也出现了同样的错误!!!
谢谢
我有在主目录main中也有调用一个dgvip.xml的文件却可以的!!!
这个异常是自己抛出的private boolean loadConfig(String name) throws Exception
{
boolean rc = false;
// Get our class loader
ClassLoader cl = getClass().getClassLoader();
// Attempt to open an input stream to the configuration file.
// The configuration file is considered to be a system
// resource.
java.io.InputStream in;
if (cl != null) {
in = cl.getResourceAsStream(name);
}
else {
in = ClassLoader.getSystemResourceAsStream(name);
}
// If the input stream is null, then the configuration file
// was not found
if (in == null) {
throw new Exception("ConnectionPool configuration file '" +name + "' not found");
或与.jar文件同一目录。视你内部的读取语句具体是什么。如果你懒得去查找具体语句,就按上面的办法各备份一份。
请问怎样把javaw这个给释放掉谢谢各位!!
who can help me!!!