以下是错误日志信息: 严重: The web application [/news] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 2014-12-19 0:27:
平常开发中,都知道要在finlly里关闭流,但是有时finlly里代码不当,会引起另外的异常. 以下是看struts2源代码看到的,随手记录下. 有两点注意: (1)判断流是否为空. (2)filly里要捕获异常 InputStream in = null; try { in = settingsUrl.openStream(); settings.load(in); } catch (IOException e) { throw new StrutsException("Could not l
在过去,每次编写C/C++程序的时候,VLD差点儿是我的标配.有了它,就能够放心地敲代码,随时发现内存溢出. VLD最高可支持到Visual Studio 2012.不知道以后会不会支持Visual Studio 2013,但反正眼下是不支持的. 相关的讨论见:https://vld.codeplex.com/discussions/471214 那么在Visual Studio 2013下还是老老实有用MFC的内存溢出检測工具,或者用WinDBG吧. 推荐一篇文章:<Memory Leak D
转换时可以指定编码格式:GBK.UTF-8 public class Demo { public static void main(String[] args) { File f = new File("word.txt"); FileOutputStream out = null;//字节流 OutputStreamWriter osw = null;//字节流转字符流 BufferedWriter bw = null;//缓冲字符流 try { out = new FileOutp