MyFaces Extensions Validator
  1. MyFaces Extensions Validator
  2. EXTVAL-109

Extval Custom Java ExtValModuleConfig and OpenWebBeans -> NPE during startup WebContainer

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Invalid
    • Affects Version/s: 1.2.4, 2.0.4, 1.1.4
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      OpenWebBeans initializes all classes in the archives (jars or classes directory) that have a beans.xml file.

      But since the ExtValModuleConfig classes have all the following line
      private static ExtValContext extValContext = ExtValContext.getContext();

      The ExtvalContext is initialized during startup of the WebContainer when the project extends this class (cutoms Java ExtValModuleConfig ). In the constructor of the ExtValContext class, we try to access the web.xml initialization parameter through facesContext, which is not yet available.

      solution:
      Leave the static variable empty and use a method that initializes the variable when first requested. (used by the get() and use() methods)

        Issue Links

          Activity

          Hide
          Mark Struberg added a comment -

          or use a @PostConstruct or @Inject method

          Show
          Mark Struberg added a comment - or use a @PostConstruct or @Inject method
          Hide
          Gerhard Petracek added a comment -

          @mark:
          extval isn't based on cdi -> that won't work.

          @rudy:
          it isn't really a bug. we just have to check all base implementations for issues in combination with cdi.
          currently we just don't support customized extval artifacts placed in a (cdi) bean-archive.
          -> i would file a task or improvement for it and close this one (i think we will find multiple similar base implementations).

          the workaround for now is to create an own module in your app which hosts all custom extval artifacts (and provide it as jar file). so you don't have a beans.xml file in the module.

          Show
          Gerhard Petracek added a comment - @mark: extval isn't based on cdi -> that won't work. @rudy: it isn't really a bug. we just have to check all base implementations for issues in combination with cdi. currently we just don't support customized extval artifacts placed in a (cdi) bean-archive. -> i would file a task or improvement for it and close this one (i think we will find multiple similar base implementations). the workaround for now is to create an own module in your app which hosts all custom extval artifacts (and provide it as jar file). so you don't have a beans.xml file in the module.
          Hide
          Rudy De Busscher added a comment -

          Is an Improvement (see Gerhard's comment) and handled by EXTVAL-110.

          Show
          Rudy De Busscher added a comment - Is an Improvement (see Gerhard's comment) and handled by EXTVAL-110 .

            People

            • Assignee:
              Unassigned
              Reporter:
              Rudy De Busscher
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development