repro steps:
On the test server, go to Suarez Group.
Click on Edit Centre Membership, and search for a different center - like Barangay 05.
Click on it to switch the center.
Click Submit.
Expected:
Red error message at the top indicating you cannot change a center with active accounts.
Actual:
Following http error
javax.servlet.ServletException: org.mifos.core.MifosRuntimeException: org.mifos.customers.exceptions.CustomerException: errors.Customer.hasActiveAccount
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:523)
org.mifos.framework.struts.action.MifosRequestProcessor.processActionPerform(MifosRequestProcessor.java:233)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.mifos.security.util.LoginFilter.doFilter(LoginFilter.java:85)
org.mifos.framework.persistence.DatabaseInitFilter.doFilter(DatabaseInitFilter.java:51)
root cause
org.mifos.core.MifosRuntimeException: org.mifos.customers.exceptions.CustomerException: errors.Customer.hasActiveAccount
org.mifos.application.servicefacade.CustomerServiceFacadeWebTier.transferGroupToCenter(CustomerServiceFacadeWebTier.java:544)
org.mifos.customers.group.struts.action.GroupTransferAction.transferToCenter(GroupTransferAction.java:180)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
org.mifos.framework.struts.action.BaseAction.execute(BaseAction.java:105)
org.mifos.framework.struts.action.MifosRequestProcessor.processActionPerform(MifosRequestProcessor.java:204)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.mifos.security.util.LoginFilter.doFilter(LoginFilter.java:85)
org.mifos.framework.persistence.DatabaseInitFilter.doFilter(DatabaseInitFilter.java:51)
root cause
org.mifos.customers.exceptions.CustomerException: errors.Customer.hasActiveAccount
org.mifos.customers.group.business.GroupBO.validateForActiveAccounts(GroupBO.java:383)
org.mifos.customers.business.service.CustomerServiceImpl.transferGroupTo(CustomerServiceImpl.java:310)
org.mifos.application.servicefacade.CustomerServiceFacadeWebTier.transferGroupToCenter(CustomerServiceFacadeWebTier.java:540)
org.mifos.customers.group.struts.action.GroupTransferAction.transferToCenter(GroupTransferAction.java:180)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
org.mifos.framework.struts.action.BaseAction.execute(BaseAction.java:105)
org.mifos.framework.struts.action.MifosRequestProcessor.processActionPerform(MifosRequestProcessor.java:204)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.mifos.security.util.LoginFilter.doFilter(LoginFilter.java:85)
org.mifos.framework.persistence.DatabaseInitFilter.doFilter(DatabaseInitFilter.java:51)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.
Apache Tomcat/6.0.18
I cannot reproduce this exception in Gazelle C. However, I can do that using trunk.
Please check, if the Gazelle C is affected by this issue. If not, I will fix it only in the trunk.
Good catch, yes this is only in Shamim D.
I'm reassigning to Keith W since he is looking @ this code already
Resolved in trunk - https://ci.mifos.org:8843/hudson/job/trunk/1009/
Mifos has custom exeption handling for exceptions of type ApplicationException and this is used for display error messages to the user. This was broken after the refactoring an exception other than ApplicationException (or CustomerException) was returned.
verified now see (in red):
The membership cannot be changed since there are Active accounts present.