title: Getting errors when using p:selectOneMenu
body: <p>I am currently trying to make a stylish dropdown item with the help of p:selectOneMenu.
  I am working on it because I am trying to migrate a project to Primefaces 10. The project was implemented more than 10 years ago. For this reason there is no CDI. The server used is an IBM WebSphere Liberty v21 (feature jsf-2.3 was deployed).</p>
  <p>The xhtml part look like this:</p>
  <pre><code>&lt;p:selectOneMenu id=&quot;techSpecsOneMenuId&quot;
              value=&quot;#{techSpecsTreeMBean.selectedCatalogNodeWrapper}&quot;
              var=&quot;catalogNodeWrapper&quot; styleClass=&quot;techSpecsOneMenuClass&quot;
              converter=&quot;catalogNodeWrapperConverter&quot;&gt;
              &lt;f:selectItems value=&quot;#{techSpecsTreeMBean.catalogNodes}&quot;
                  var=&quot;catNode&quot;
                  itemLabel=&quot;#{catNode.positionName}&quot; itemValue=&quot;#{catNode}&quot; /&gt;
              &lt;p:column&gt;
                  &lt;h:panelGroup layout=&quot;block&quot; styleClass=&quot;fieldLabelSmall&quot;&gt;
                      &lt;ui:repeat value=&quot;#{catalogNodeWrapper.levelList}&quot; var=&quot;level&quot;&gt;
                          &lt;h:graphicImage
                              value=&quot;resources/images/treetable/tree_line_blank.gif&quot;
                              alt=&quot;treeLineBlank&quot; style=&quot;vertical-align: middle;&quot; /&gt;
                      &lt;/ui:repeat&gt;
                      &lt;h:graphicImage value=&quot;#{catalogNodeWrapper.positionIcon}&quot;
                          style=&quot;vertical-align: top;&quot; alt=&quot;posIcon&quot;
                          rendered=&quot;#{catalogNodeWrapper.specificationNode.nodeType != 'OVERVIEW'}&quot; /&gt;
                      &lt;h:commandLink
                          action=&quot;#{catalogNodeWrapper.techNodeDropDownSelectedAction}&quot;
                          value=&quot;#{catalogNodeWrapper.positionName}&quot;
                          title=&quot;#{catalogNodeWrapper.positionTitle}&quot;
                          style=&quot;vertical-align: middle;&quot;
                          rendered=&quot;#{catalogNodeWrapper.specificationNode.nodeType != 'OVERVIEW'}&quot; /&gt;
                      &lt;h:outputText value=&quot;#{catalogNodeWrapper.positionName}&quot;
                          rendered=&quot;#{catalogNodeWrapper.specificationNode.nodeType == 'OVERVIEW'}&quot;
                          style=&quot;vertical-align: middle;&quot; /&gt;
                  &lt;/h:panelGroup&gt;
              &lt;/p:column&gt;
          &lt;/p:selectOneMenu&gt;
  </code></pre>
  <p>TechSpecsTreeMBean is a managed bean:</p>
  <pre><code>&lt;managed-bean&gt;
      &lt;managed-bean-name&gt;techSpecsTreeMBean&lt;/managed-bean-name&gt;
      &lt;managed-bean-class&gt;....TechSpecsTreeMBean&lt;/managed-bean-class&gt;
      &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;
  &lt;/managed-bean&gt;
  </code></pre>
  <p>CatalogNodeWrapper is just a Java-Bean:</p>
  <pre><code>public class CatalogNodeWrapper implements Serializable, Comparable&lt;CatalogNodeWrapper&gt;
  </code></pre>
  <p>And finally the CatalogNodeWrapperConverter is a &quot;normal&quot; JSF-Converter:</p>
  <pre><code>@FacesConverter(value = &quot;catalogNodeWrapperConverter&quot;)
  public class CatalogNodeWrapperConverter implements Converter&lt;CatalogNodeWrapper&gt; {
      private static final Logger LOGGER = Logger.getLogger(CatalogNodeWrapperConverter.class.getName());
      
      @Override
      public CatalogNodeWrapper getAsObject(FacesContext arg0, UIComponent arg1, String arg2) throws ConverterException {
          LOGGER.log(LapLevel.INFO, &quot;CatalogNodeWrapperConverter.getAsObject&quot;);
          TechSpecsTreeMBean tempTechSpecsTreeMBean =
                (TechSpecsTreeMBean) MBeanUtil.getManagedBeanByElResolver(MBeanControllerInit.TECHSPECSTREE_CONTROLLER);
          if (arg2 != null &amp;&amp; arg2.trim().length() &gt; 0) {
              try {
                  return tempTechSpecsTreeMBean.getCatalogNodesMap().get(Integer.parseInt(arg2));
              }
              catch (NumberFormatException e) {
                  throw new ConverterException(new FacesMessage(FacesMessage.SEVERITY_ERROR, &quot;Conversion Error&quot;, &quot;Not a valid catalogNode.&quot;));
              }
          } else {
              return null;
          }
      }
  
      @Override
      public String getAsString(FacesContext arg0, UIComponent arg1, CatalogNodeWrapper arg2) throws ConverterException {
          LOGGER.log(LapLevel.INFO, &quot;CatalogNodeWrapperConverter.getAsString&quot;);
          if (arg2 != null) {
              return String.valueOf(arg2.getId());
          } else {
              return &quot;&quot;;
          }
      }
  }
  </code></pre>
  <p>For me everything looks fine, but I am getting the following error:</p>
  <pre><code>Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'catalogNodeWrapper' resolved to null
  at org.apache.el.parser.AstValue.getTarget(AstValue.java:72)
  at org.apache.el.parser.AstValue.invoke(AstValue.java:226)
  at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
  at org.apache.myfaces.view.facelets.el.ContextAwareTagMethodExpression.invoke(ContextAwareTagMethodExpression.java:96)
  ... 79 more
  </code></pre>
  <p>Same error is thrown if I register the converter in the faces-config.xml</p>
  <pre><code>&lt;converter&gt;
      &lt;converter-id&gt;catalogNodeWrapperConverter&lt;/converter-id&gt;
      &lt;converter-class&gt;....CatalogNodeWrapperConverter&lt;/converter-class&gt;
  &lt;/converter&gt;
  </code></pre>
  <p>If I am using the CDI Feature I have to change the annotation of the converter to:</p>
  <pre><code>@Named
  @FacesConverter(value = &quot;countryConverter&quot;, managed = true)
  </code></pre>
  <p>and the usage of the converter to:</p>
  <pre><code>converter=&quot;#{catalogNodeWrapperConverter}&quot;
  </code></pre>
  <p>the following error is thrown:</p>
  <pre><code>javax.el.ELException: Cannot convert 24 of type class java.lang.String to class ....CatalogNodeWrapper
  at org.apache.el.lang.ELSupport.coerceToType(ELSupport.java:658)
  at org.apache.el.parser.AstValue.setValue(AstValue.java:201)
  at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:257)
  at org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.setValue(ContextAwareTagValueExpression.java:146)
  at javax.faces.component.UIInput.updateModel(UIInput.java:429)
  at javax.faces.component.UIInput.processUpdates(UIInput.java:347)
  </code></pre>
  <p>It seems that the converter is not used.</p>
  <p>Any idea or solution will be highly appreciated.</p>
  <p>And I have already checked tis guide - <a href="https://stackoverflow.com/questions/30128395/identifying-and-solving-javax-el-propertynotfoundexception-target-unreachable">Identifying and solving javax.el.PropertyNotFoundException: Target Unreachable</a></p>