Note that there are some explanatory texts on larger screens.

plurals
  1. POcould not find Factory: javax.faces.context.FacesContextFactory - using embedded glassfish 3.0
    primarykey
    data
    text
    <p>I'm trying to run a simple jsf-2.0 tutorial using embedded glassfish 3.0 and keep getting this error. Have been searching solutions on this forum and the internet and seems getting no where. Here is the pom: </p> <p><code> </p> <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.googlecode.sandcode&lt;/groupId&gt; &lt;artifactId&gt;helloworld&lt;/artifactId&gt; &lt;packaging&gt;war&lt;/packaging&gt; &lt;name&gt;${project.artifactId}&lt;/name&gt; &lt;version&gt;1.0&lt;/version&gt; &lt;repositories&gt; &lt;repository&gt; &lt;id&gt;java.net.m2&lt;/id&gt; &lt;url&gt;http://download.java.net/maven/2&lt;/url&gt; &lt;/repository&gt; &lt;repository&gt; &lt;id&gt;java.net.glassfish.m2&lt;/id&gt; &lt;url&gt;http://download.java.net/maven/glassfish&lt;/url&gt; &lt;/repository&gt; &lt;/repositories&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;javax.faces&lt;/groupId&gt; &lt;artifactId&gt;jsf-api&lt;/artifactId&gt; &lt;version&gt;2.1&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;pluginRepositories&gt; &lt;pluginRepository&gt; &lt;id&gt;glassfish-repository&lt;/id&gt; &lt;name&gt;Java.net Repository for Glassfish&lt;/name&gt; &lt;url&gt;http://download.java.net/maven/glassfish&lt;/url&gt; &lt;layout&gt;default&lt;/layout&gt; &lt;snapshots&gt; &lt;enabled&gt;true&lt;/enabled&gt; &lt;updatePolicy&gt;never&lt;/updatePolicy&gt; &lt;/snapshots&gt; &lt;/pluginRepository&gt; &lt;/pluginRepositories&gt; &lt;build&gt; &lt;plugins&gt; &lt;!-- embedded glassfishV3 for testing --&gt; &lt;plugin&gt; &lt;groupId&gt;org.glassfish&lt;/groupId&gt; &lt;artifactId&gt;maven-embedded-glassfish-plugin&lt;/artifactId&gt; &lt;version&gt;3.0&lt;/version&gt; &lt;configuration&gt; &lt;goalPrefix&gt;glassfish&lt;/goalPrefix&gt; &lt;app&gt;target/helloworld-1.0.war&lt;/app&gt; &lt;port&gt;8080&lt;/port&gt; &lt;contextRoot&gt;test&lt;/contextRoot&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;package&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;run&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;configuration&gt; &lt;source&gt;1.6&lt;/source&gt; &lt;target&gt;1.6&lt;/target&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; </code></pre> <p></p> <p></code> </p> <p>Web.xml:</p> <p><code></p> <pre><code>&lt;!-- Faces Servlet --&gt; &lt;servlet&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;!-- Faces Servlet Mapping --&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;!-- explicitly setting the EL factory, otherwise is not working correctly under tomcat and jetty --&gt; &lt;context-param&gt; &lt;param-name&gt;com.sun.faces.expressionFactory&lt;/param-name&gt; &lt;param-value&gt;com.sun.el.ExpressionFactoryImpl&lt;/param-value&gt; &lt;/context-param&gt; &lt;!-- welcome file mapping --&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; </code></pre> <p> </code></p> <p>After I run mvn package, the war file is generated and glassfish starts up. But complains the error. In the project folder I can see the jsf Maven dependency: jsf-api-2.1.jar. </p> <p>Thanks, Sarah</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload