title: Keycloak registration template loading error
body: <p>I'm hitting an error when I attempt to register a new user in keycloak realm. I'm running keycloak in standalone mode on a Mac Yosemite. I'm new to keycloak, but have successfully created a new realm and configured it to work with a html/js example page served by a locally hosted apache web server. All in all pretty impressed; but would just like to figure out what I'm doing wrong with this register.ftl error.</p>
  
  <p>Grateful for any pointers.</p>
  
  <p>Here's the error:</p>
  
  <pre><code>22:25:43,034 ERROR [freemarker.runtime] (default task-115) Error executing FreeMarker template: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
  ==&gt; passwordRequired  [in template "register.ftl" at line 46, column 18]
  
  Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use &lt;#if myOptionalVar??&gt;when-present&lt;#else&gt;when-missing&lt;/#if&gt;. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
  
  FTL stack trace ("~" means nesting-related):
      - Failed at: #if passwordRequired  [in template "register.ftl" at line 46, column 13]
      ~ Reached through: #nested "form"  [in template "template.ftl" in macro "registrationLayout" at line 72, column 29]
      ~ Reached through: @layout.registrationLayout; section  [in template "register.ftl" at line 2, column 1]
  ----
  at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
  at freemarker.core.UnexpectedTypeException.newDesciptionBuilder(UnexpectedTypeException.java:77)
      at freemarker.core.UnexpectedTypeException.&lt;init&gt;(UnexpectedTypeException.java:40)
      at freemarker.core.NonBooleanException.&lt;init&gt;(NonBooleanException.java:44)
      at freemarker.core.Expression.modelToBoolean(Expression.java:142)
      at freemarker.core.Expression.evalToBoolean(Expression.java:125)
      at freemarker.core.Expression.evalToBoolean(Expression.java:110)
      at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:46)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.MixedContent.accept(MixedContent.java:54)
      at freemarker.core.Environment.visitByHiddingParent(Environment.java:345)
      at freemarker.core.IfBlock.accept(IfBlock.java:48)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.Environment.invokeNestedContent(Environment.java:546)
      at freemarker.core.BodyInstruction.accept(BodyInstruction.java:56)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.MixedContent.accept(MixedContent.java:54)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.Macro$Context.runMacro(Macro.java:184)
      at freemarker.core.Environment.invoke(Environment.java:701)
      at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.MixedContent.accept(MixedContent.java:54)
      at freemarker.core.Environment.visit(Environment.java:324)
      at freemarker.core.Environment.process(Environment.java:302)
      at freemarker.template.Template.process(Template.java:325)
      at &lt;you get the idea...&gt;
  </code></pre>