난 glassfish 3.0을 사용하여 간단한 jsf-2.0 자습서를 실행하고이 오류가 계속 발생하려고합니다. 이 포럼과 인터넷에서 솔루션을 검색해 왔으며 어디서나 문제가없는 것처럼 보입니다.Factory를 찾을 수 없음 : javax.faces.context.FacesContextFactory - embedded glassfish 사용 3.0
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.sandcode</groupId>
<artifactId>helloworld</artifactId>
<packaging>war</packaging>
<name>${project.artifactId}</name>
<version>1.0</version>
<repositories>
<repository>
<id>java.net.m2</id>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>java.net.glassfish.m2</id>
<url>http://download.java.net/maven/glassfish</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>glassfish-repository</id>
<name>Java.net Repository for Glassfish</name>
<url>http://download.java.net/maven/glassfish</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<!-- embedded glassfishV3 for testing -->
<plugin>
<groupId>org.glassfish</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.0</version>
<configuration>
<goalPrefix>glassfish</goalPrefix>
<app>target/helloworld-1.0.war</app>
<port>8080</port>
<contextRoot>test</contextRoot>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
의 Web.xml : 여기에 치어입니다
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!-- explicitly setting the EL factory, otherwise is not working correctly under tomcat and jetty -->
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>
<!-- welcome file mapping -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
내가 MVN 패키지를 실행 한 후, 전쟁 파일이 생성 및 글래스 피쉬가 시작됩니다. 그러나 그 오류를 불평합니다. 프로젝트 폴더에서 jsf Maven 의존성을 볼 수 있습니다 : jsf-api-2.1.jar.
덕분에, 사라
가능한 중복 [예외 : 찾을 수 없습니다 공장 : javax.faces.context.FacesContextFactory] (http://stackoverflow.com/questions/5259145/exception-could-not-find-factory- –
@ J-16 SDiZ, 예, 여기에 게시 한 후에 나는 답을 제공 한 다른 게시물을 우연히 발견했습니다. :) – sarahTheButterFly