"Catching exception is not allowed" Checkstyle Report

Viewed 8581

I am generating a Checkstyle report embedded in maven site and for one of the issues it is pointing out that Catching exception is not allowed. How can I fix this issue? I just don't simply want to remove the code and if I don't what other alternatives are there to fix this issue.

public void contextInitialized(ServletContextEvent event) {
    super.contextInitialized(event);

    ServletContext context = event.getServletContext();
    setupContext(context);
    LoggingHandler logging = (LoggingHandler) AppContext.getBean( "loggingHandler" );

    try {
        loadClientUserData( context, logging );
        loadMBeans( context, logging );

    } catch (Exception e) {
        throw new RuntimeException( "Error during startup of service !!!" );
    }
}

I am still learning Java, so any sort of guidance would be appreciated.

Thanks

3 Answers
Related