jsf - Changing faces-config.xml from 2.2 to 2.3 causes javax.el.PropertyNotFoundException: Target Unreachable, identifier 'bean' resolved to null -


have following code snippets:

bean:

import javax.faces.view.viewscoped; import javax.inject.named;  @named(value = "directorybean") @viewscoped public class directorybean implements serializable {  private static final long serialversionuid = 1l;     .... } 

faces-config.xml

<?xml version="1.0" encoding="utf-8"?> <faces-config     xmlns="http://xmlns.jcp.org/xml/ns/javaee"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"     xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"     version="2.3">      .... </faces-config> 

group.xhtml

<ui:composition ...>      <f:metadata>         <f:viewparam name="id" value="#{directorybean.id}" />     </f:metadata>  </ui:composition> 

in result getting exception:

javax.el.propertynotfoundexception: /group.xhtml @6,64 value="#{directorybean.id}": target unreachable, identifier 'directorybean' resolved null 

got after changing faces-config.xml ver 2.2 ver 2.3 syntax.

meaning, faces-config.xml following content works fine:

<faces-config version="2.2" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"           xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"> .... </faces-config> 

jsf 2.3.2 deployed on payara 4.1.2.172 (full) server, , added pom.xml "provided" scope.

.... <dependencies>     ...     <dependency>         <groupid>org.glassfish</groupid>         <artifactid>javax.faces</artifactid>         <version>2.3.2</version>         <scope>provided</scope>     </dependency>     <dependency>         <groupid>javax.faces</groupid>         <artifactid>javax.faces-api</artifactid>         <version>2.3</version>         <scope>provided</scope>                 </dependency>     <dependency>         <groupid>javax</groupid>         <artifactid>javaee-api</artifactid>         <version>7.0</version>         <scope>provided</scope>     </dependency>     ... </dependencies> .... 

i have checked solutions able find during several hours, including different version of beans.xml:

  1. initially beans.xml not present in project - issue persist;
  2. added empty beans.xml - issue persist;
  3. added beans.xml 2 different options of bean-discovery-mode - "all" , "annotated" - issue persist;

content of \web-inf\beans.xml:

<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"        xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"        xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"        bean-discovery-mode="all"> </beans> 

tested on local instances of payara 4.1.2.172, glassfish 5 (java ver 1.8.0_144), , remote instance of payara 4.1.2.172 (java ver 1.8.0_131).

thanks!

note: example projects 1 https://github.com/anghelleonard/jsf-2.3/tree/master/jsf23injectinconvertervalidator give same error.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -