java - Tomcat can't find JSF API in a JSF webapp built by Maven with javaee-api dependency -


i have searched many similar posts, cannot find definitive answer on correct way build , deploy jsf applications, therefore i'm hoping can help...

currently using eclipse maven build simple jsf application , deploy onto tomcat 7, 1 dependency in pom.xml of:

<dependency>     <groupid>javax</groupid>     <artifactid>javaee-api</artifactid>     <version>6.0</version> </dependency> 

when deploy onto server get:

java.lang.classnotfoundexception: com.sun.faces.config.configurelistener 

i cant figure out coming from? have no listeners defined in web.xml.

if change dependency to:

<dependency>     <groupid>javax</groupid>     <artifactid>javaee-api</artifactid>     <version>6.0</version>     <scope>provided</provided> </dependency> 

and attempt run application on server get:

java.lang.classnotfoundexception: javax.faces.webapp.facesservlet 

which can understand because using scope provided , expects tomcat have implementation , cannot find it.

finally if drop javax.faces.2.1.13.jar tomcat install dir/lib folder works fine.

the javaee-api-6.0.jar imported using maven dependencies seems contain same javax.faces.* classes javax.faces.2.1.13.jar, therefore can tell me why doesn't work when try , run application on server without scope provided?

although works when having javax.faces.2.1.13.jar in tomcat install dir/lib folder, correct way deploy faces application?


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -