Search in sources :

Example 51 with SystemException

use of org.mifos.framework.exceptions.SystemException in project head by mifos.

the class ReportsPersistence method createReportParams.

public void createReportParams(ReportsParamsValue reportsParams) throws ApplicationException, SystemException {
    Session session = null;
    Transaction trxn = null;
    try {
        session = StaticHibernateUtil.getSessionTL();
        StaticHibernateUtil.startTransaction();
        session.save(reportsParams);
        session.flush();
        StaticHibernateUtil.commitTransaction();
    } catch (HibernateProcessException hpe) {
        StaticHibernateUtil.rollbackTransaction();
        throw new ApplicationException(hpe);
    } catch (HibernateException hpe) {
        trxn.rollback();
        throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION);
    } catch (Exception e) {
        trxn.rollback();
        throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
    } finally {
        StaticHibernateUtil.closeSession();
    }
}
Also used : HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) Transaction(org.hibernate.Transaction) HibernateException(org.hibernate.HibernateException) ReportException(org.mifos.reports.exceptions.ReportException) SystemException(org.mifos.framework.exceptions.SystemException) ReportException(org.mifos.reports.exceptions.ReportException) HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) HibernateException(org.hibernate.HibernateException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) Session(org.hibernate.Session)

Example 52 with SystemException

use of org.mifos.framework.exceptions.SystemException in project head by mifos.

the class MenuTag method doStartTag.

/**
     * Method to find left menu respective to given topMenuTab
     *
     * @return integer to indicate what to do next after executing the do
     *         function.
     */
@Override
public int doStartTag() throws JspException {
    StringBuilder output = new StringBuilder();
    // Locale locale =
    // TagUtils.getInstance().getUserLocale(pageContext,getLocale());
    Locale locale = LabelTagUtils.getInstance().getUserPreferredLocale();
    MenuRepository menuRepository = MenuRepository.getInstance();
    leftMenu = menuRepository.getMenuForTabAndLocale(topMenuTab, locale);
    try {
        if (leftMenu == null) {
            MenuBuilder.buildMenuForLocale(pageContext);
            leftMenu = menuRepository.getMenuForTabAndLocale(topMenuTab, locale);
            if (leftMenu == null) {
                // System.out.println("error: menu could not built for locale");
                ;
            }
        }
    } catch (SystemException mpe) {
        throw new JspException(mpe);
    }
    output.append("<td class=\"leftpanelinks\" colspan=\"2\">");
    MenuGroup[] menuGroups = leftMenu.getMenuGroups();
    for (MenuGroup menuGroup : menuGroups) {
        prepareMenu(output, menuGroup);
    }
    output.append("</td>");
    TagUtils.getInstance().write(pageContext, output.toString());
    return SKIP_BODY;
}
Also used : Locale(java.util.Locale) JspException(javax.servlet.jsp.JspException) SystemException(org.mifos.framework.exceptions.SystemException)

Example 53 with SystemException

use of org.mifos.framework.exceptions.SystemException in project head by mifos.

the class ApplicationInitializer method initializeSecurity.

/**
     * This function initialize and bring up the authorization and authentication services
     *
     * @throws AppNotConfiguredException
     *             - IF there is any failures during init
     */
private void initializeSecurity() throws AppNotConfiguredException {
    try {
        ActivityMapper.getInstance().init();
        HierarchyManager.getInstance().init();
    } catch (XMLReaderException e) {
        throw new AppNotConfiguredException(e);
    } catch (ApplicationException ae) {
        throw new AppNotConfiguredException(ae);
    } catch (SystemException se) {
        throw new AppNotConfiguredException(se);
    }
}
Also used : ApplicationException(org.mifos.framework.exceptions.ApplicationException) SystemException(org.mifos.framework.exceptions.SystemException) TaskSystemException(org.mifos.framework.components.batchjobs.exceptions.TaskSystemException) XMLReaderException(org.mifos.framework.exceptions.XMLReaderException) AppNotConfiguredException(org.mifos.framework.exceptions.AppNotConfiguredException)

Aggregations

SystemException (org.mifos.framework.exceptions.SystemException)53 Test (org.junit.Test)21 ApplicationException (org.mifos.framework.exceptions.ApplicationException)13 QuestionDetail (org.mifos.platform.questionnaire.service.QuestionDetail)11 PersistenceException (org.mifos.framework.exceptions.PersistenceException)10 SectionQuestionDetail (org.mifos.platform.questionnaire.service.SectionQuestionDetail)10 HibernateException (org.hibernate.HibernateException)7 Session (org.hibernate.Session)7 MifosRuntimeException (org.mifos.core.MifosRuntimeException)7 HibernateProcessException (org.mifos.framework.exceptions.HibernateProcessException)7 ReportException (org.mifos.reports.exceptions.ReportException)7 QuestionGroupDetail (org.mifos.platform.questionnaire.service.QuestionGroupDetail)4 BusinessRuleException (org.mifos.service.BusinessRuleException)4 IOException (java.io.IOException)3 ResultSet (java.sql.ResultSet)3 Statement (java.sql.Statement)3 ArrayList (java.util.ArrayList)3 MessageMatcher (org.mifos.platform.matchers.MessageMatcher)3 EventSourceDto (org.mifos.platform.questionnaire.service.dtos.EventSourceDto)3 PreparedStatement (java.sql.PreparedStatement)2