2012-03-04 3 views
2

私は単純なJSFプロジェクトw/eclipse & mavenを設定しようとしています。 私は私のものを実行しようとするたびに、私はこのエラーを取得する:しかし、私は立ち往生D午前eclipse、maven&glassfishを使用したJSF - エラー:com.sun.faces.context.FacesFileNotFoundException

com.sun.faces.context.FacesFileNotFoundException 
at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:232) 
at com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:273) 
at com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:209) 
at com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114) 
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:230) 
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) 
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:113) 
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) 
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409) 
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534) 
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281) 
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) 
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) 
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) 
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98) 
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91) 
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) 
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326) 
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227) 
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170) 
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822) 
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719) 
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013) 
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) 
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) 
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) 
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) 
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) 
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) 
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) 
at com.sun.grizzly.ContextTask.run(ContextTask.java:71) 
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) 
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) 
at java.lang.Thread.run(Thread.java:722) 

私はそれを見つけることができませんで...それは私のせいです理解しています。 私は表示したいweb.xml(空の)faces-config.xmlとhello.xhtmlを持っています。すべてのファイルはsrc/main/webapp/WEB-INFです。 ここ:)

を助けてくださいファイルは次のとおりです。

のweb.xml:

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
id="WebApp_ID" version="2.5"> 
<display-name>Hello</display-name> 
<!-- Change to "Production" when you are ready to deploy --> 
<context-param> 
    <param-name>javax.faces.PROJECT_STAGE</param-name> 
    <param-value>Development</param-value> 
</context-param> 
<context-param> 
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name> 
    <param-value>.xhtml</param-value> 
</context-param> 
<context-param> 
    <param-name>primefaces.THEME</param-name> 
    <param-value>cupertino</param-value> 
</context-param> 
<!-- Welcome page --> 
<welcome-file-list> 
    <welcome-file>hello.xhtml</welcome-file> 
</welcome-file-list> 
<!-- JSF mapping --> 
<servlet> 
    <servlet-name>Faces Servlet</servlet-name> 
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
</servlet> 
<!-- Map these files with JSF --> 
<servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.xhtml</url-pattern> 
</servlet-mapping> 

私の顔-config.xmlに:

<?xml version="1.0"?> 
<faces-config version="2.0" 
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xi="http://www.w3.org/2001/XInclude" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"> 
</faces-config> 

こんにちは。 xhtml:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html"> 
<h:head> 
    <title>JSF 2.0 Hello World</title> 
</h:head> 
<h:body> 
    <h3>JSF 2.0 Hello World Example - hello.xhtml</h3> 
    <h:form> 
     <h:inputText value="#{helloBean.name}"></h:inputText> 
     <h:commandButton value="Welcome Me" action="welcome"></h:commandButton> 
    </h:form> 
</h:body> 
</html> 

ASD

答えて

3

WEB-INFにhello.xhtmlを入れないでください。設定ファイルだけがそこに行かなければなりません。 hello.xhtmlをWEB-INFがあるディレクトリに置きます。

+0

愚かな私!私はこれを試みたと思ったが、明らかに私はしなかった。完全にトリックをやりました - ありがとう! – sne11ius

+0

...と公開する必要のないテンプレートファイル。関連:http://stackoverflow.com/questions/9031811/which-xhtml-files-do-i-need-to-put-in-web-inf-and-which-not – BalusC

関連する問題