Smack opens a new file for the trust store every time a connection is created, but it never cleans up after itself once KeyLoad.load has done its job. The fix, of course, is simple and I've attached it.
Here is a simple block of code that will illustrate the problem (i.e., that the file remains open): KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); FileInputStream is = new FileInputStream("/etc/java-6-sun/security/cacerts"); System.out.println(is.getChannel().isOpen()); // expected true trustStore.load(is, "changeit".toCharArray()); System.out.println(is.getChannel().isOpen()); // expected true, desired false
For description and patch see:
http://www.igniterealtime.org/forum/thread.jspa?threadID=24470
Pasted text:
------------------------ Hi guys,
Smack opens a new file for the trust store every time a connection is created, but it never cleans up after itself once KeyLoad.load has done its job. The fix, of course, is simple and I've attached it.
Here is a simple block of code that will illustrate the problem (i.e., that the file remains open):
KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
FileInputStream is = new FileInputStream("/etc/java-6-sun/security/cacerts");
System.out.println(is.getChannel().isOpen()); // expected true
trustStore.load(is, "changeit".toCharArray());
System.out.println(is.getChannel().isOpen()); // expected true, desired false