Uploaded image for project: 'Apache Freemarker'
  1. Apache Freemarker
  2. FREEMARKER-113

TemplateExceptionHandler not working with Jetty

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.28
    • None
    • engine
    • None
    • java 8, jetty 9.4, freemarker 2.3.28, spring 5.1.2

    Description

      Setting a custom TemplateExceptionHandler doesn't seem to work when the application is deployed and running on the latest Jetty server.

      When deployed and running on a Tomcat server the TemplateExceptionHandler works as expected.

      To set a TemplateExceptionHandler i extended FreeMarkerConfigurer and override getConfiguration():

      Configuration configuration = super.getConfiguration();
      configuration.setTemplateExceptionHandler(new MyTemplateExceptionHandler());
      return configuration;

      When a template contains an error (${null}) i can see that the getConfiguration() is called (i added a log line).

      With tomcat MyTemplateExceptionHandler gets called next, with jetty this doesn't happen. With jetty a jetty error page appears with the full freemarker exceptions and stacktrace,which starts with:

      HTTP ERROR 500

      Problem accessing /dash/sitesettings/change. Reason:

          Server Error

      ...

      This happens with the latest version of freemarker.

      I hope someone can take a quick peek at what is going on.

      A bit more detail can be found in a comment i added:

      https://issues.apache.org/jira/browse/FREEMARKER-113?focusedCommentId=16731681&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16731681

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            tinustate Tinus Tate
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: