Beehive
  1. Beehive
  2. BEEHIVE-739

A url template ref without a key element causes an NPE in URLTemplatesFactory.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: v1m1
    • Fix Version/s: 1.0
    • Component/s: NetUI
    • Labels:
      None

      Description

      Need to improve the error condition checking and handling in the
      URLTemplatesFactory class.

      If a template ref in the beehive-url-template-config file does not have a
      key element, URLTemplatesFactory.getTemplatesFromConfig() throws an NPE.

      I think this can be done in a post v1.0 patch.

      Here's a stack trace...
      java.lang.NullPointerException
      at
      org.apache.beehive.netui.core.urltemplates.URLTemplatesFactory.getTempla
      tesFromConfig(URLTemplatesFactory.java:213)
      at
      org.apache.beehive.netui.core.urltemplates.URLTemplatesFactory.getTempla
      tes(URLTemplatesFactory.java:139)
      at
      org.apache.beehive.netui.core.urltemplates.URLTemplateDescriptor.load(UR
      LTemplateDescriptor.java:130)
      at
      org.apache.beehive.netui.pageflow.PageFlowContextListener.performInitial
      izations(PageFlowContextListener.java:107)
      at
      org.apache.beehive.netui.pageflow.PageFlowPageFilter.init(PageFlowPageFi
      lter.java:86)

      1. j739patch.txt
        9 kB
        Carlin Rogers

        Activity

        Hide
        Carlin Rogers added a comment -

        Attaching a patch to fix this bug as well as provide additional
        error condition checking and logging.

        Show
        Carlin Rogers added a comment - Attaching a patch to fix this bug as well as provide additional error condition checking and logging.
        Hide
        Carlin Rogers added a comment -

        Assigning to Rich for review. Thanks.

        Show
        Carlin Rogers added a comment - Assigning to Rich for review. Thanks.
        Hide
        Rich Feit added a comment -

        Applied the patch with revision 188831. Thanks Carlin!

        Show
        Rich Feit added a comment - Applied the patch with revision 188831. Thanks Carlin!
        Hide
        Alejandro Ramirez added a comment -

        Please verify in trunk.

        Show
        Alejandro Ramirez added a comment - Please verify in trunk.
        Hide
        Julie Zhuo added a comment -

        Verified at rev227121. It now produces the following error log,

        05 Aug 2005 04:08:26,031 ERROR DefaultURLTemplatesFactory []: Malformed URL template descriptor in /WEB-INF/beehive-url-template-config.xml. The url-template-ref key is missing.
        05 Aug 2005 04:08:26,231 ERROR AutoRegisterActionServlet []: Could not load Struts module configuration for /WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml.
        05 Aug 2005 04:08:39,170 ERROR DefaultURLTemplatesFactory []: Malformed URL template descriptor in /WEB-INF/beehive-url-template-config.xml. The url-template-ref key is missing.
        05 Aug 2005 04:08:40,051 ERROR AutoRegisterActionServlet []: Could not load Struts module configuration for /WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml.

        Show
        Julie Zhuo added a comment - Verified at rev227121. It now produces the following error log, 05 Aug 2005 04:08:26,031 ERROR DefaultURLTemplatesFactory []: Malformed URL template descriptor in /WEB-INF/beehive-url-template-config.xml. The url-template-ref key is missing. 05 Aug 2005 04:08:26,231 ERROR AutoRegisterActionServlet []: Could not load Struts module configuration for /WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml. 05 Aug 2005 04:08:39,170 ERROR DefaultURLTemplatesFactory []: Malformed URL template descriptor in /WEB-INF/beehive-url-template-config.xml. The url-template-ref key is missing. 05 Aug 2005 04:08:40,051 ERROR AutoRegisterActionServlet []: Could not load Struts module configuration for /WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml.

          People

          • Assignee:
            Julie Zhuo
            Reporter:
            Carlin Rogers
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development