I created a Maven web application using JSF 2.2, Primefaces, Tomcat 7 dependencies.
My JSF implementation is Mojarra 2.2.4, I added this dependency to my POM:
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.4</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.4</version>
<scope>compile</scope>
</dependency>
But unfortunately, I have a problem with tomcat7-maven-pluginand its built-in tomcat. If I use the command tomcat7:run, my webapp starts without problems, but when it tries to load a managed bean, I get this error:
Target unavailability, identifier 'testBean' allowed for null
This is a sign that webapp is using JSF 1.xinstead JSF 2.x. The configurator JSF 1.xdoes not recognize annotations @ManagedBean, which will lead to the fact that they will not be loaded / initialized automatically without the need for faces-config.xml.
tomcat embedded 7.0.50, : http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/adjust-embedded-tomcat-version.html
, , @ManagedBean, managedbean faces-config.xml.
JSF 2.x Tomcat Embedded maven7-tomcat-plugin?
PS: tomcat7:run-war , , , , , xhtml (,) .