From c89f1f53151ebb52bcc1745178d5c9ab724d5dac Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Fri, 3 Jun 2016 16:11:36 +0000 Subject: [PATCH] Merged 5.2.N (5.2.1) to HEAD (5.2) 125772 rmunteanu: Merged 5.1.N (5.1.2) to 5.2.N (5.2.1) 125587 mward: ACE-5052: close spring application context in FTPServerBean git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@127799 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/filesys/FTPServerBean.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/filesys/FTPServerBean.java b/source/java/org/alfresco/filesys/FTPServerBean.java index c20bbe7c1e..cf3d0d2661 100644 --- a/source/java/org/alfresco/filesys/FTPServerBean.java +++ b/source/java/org/alfresco/filesys/FTPServerBean.java @@ -164,11 +164,12 @@ public class FTPServerBean extends AbstractLifecycleBean out.println("FTP Server Test"); out.println("---------------"); + ClassPathXmlApplicationContext ctx = null; try { // Create the configuration service in the same way that Spring creates it - ApplicationContext ctx = new ClassPathXmlApplicationContext("alfresco/application-context.xml"); + ctx = new ClassPathXmlApplicationContext("alfresco/application-context.xml"); // Get the FTP server bean @@ -227,6 +228,13 @@ public class FTPServerBean extends AbstractLifecycleBean { ex.printStackTrace(); } + finally + { + if (ctx != null) + { + ctx.close(); + } + } System.exit(1); }