2013-05-15 43 views
0

我試圖構建自定義網址爲prettyfaces告訴它做什麼,但安裝後,它給了我這個錯誤:靚麗,它沒有被解決?

Referenced file contains errors (http://ocpsoft.org/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.3.xsd). For more information, right click on the message in the Problems View and select "Show Details..." 

這是怎麼我的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_3_0.xsd" id="WebApp_ID" version="3.0"> 
    <display-name>BRAINSET</display-name> 
    <context-param> 
    <param-name>javax.faces.PROJECT_STAGE</param-name> 
    <param-value>Development</param-value> 
    </context-param> 
    <context-param> 
    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name> 
    <param-value>true</param-value> 
    </context-param> 
    <welcome-file-list> 
    <welcome-file>index.xhtml</welcome-file> 
    </welcome-file-list> 
    <servlet> 
    <servlet-name>Faces Servlet</servlet-name> 
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> 
    <load-on-startup>1</load-on-startup> 
    </servlet> 
    <servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.xhtml</url-pattern> 
    </servlet-mapping> 
    <filter> 
     <filter-name>Pretty Filter</filter-name> 
     <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class> 
     <async-supported>true</async-supported> 
    </filter> 

    <filter-mapping> 
     <filter-name>Pretty Filter</filter-name> 
     <url-pattern>/*</url-pattern> 
     <dispatcher>FORWARD</dispatcher> 
     <dispatcher>REQUEST</dispatcher> 
     <dispatcher>ERROR</dispatcher> 
     <dispatcher>ASYNC</dispatcher> 
    </filter-mapping> 
</web-app> 

而且我pretty-config.xml

<pretty-config xmlns="http://ocpsoft.org/prettyfaces/3.3.3" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xsi:schemaLocation="http://ocpsoft.org/prettyfaces/3.3.3 
       http://ocpsoft.org/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.3.xsd"> 

    <url-mapping id="home"> 
     <pattern value="/home" /> 
     <view-id value="/index.xhtml" /> 
    </url-mapping> 

有了這個錯誤,我不能甚至在Glassfish部署我的應用程序:

Could not publish to the server. 
java.lang.NullPointerException 

任何想法如何解決這個問題?或者我應該尋找另一種類似於prettyfaces的工具?

更新

enter image description here

回答

2

我不認爲這個錯誤是由PrettyFaces造成的。 XML模式在我的Eclipse設置中工作正常,我沒有得到任何這些錯誤。我很確定XSD文件是有效的。

如果有任何異常拋出,您應該查看Eclipse日誌文件(WORKSPACE/.metadata/.log)來查看。

順便說一句:你也可以嘗試從你的pretty-config.xml中刪除schemaLocation元素,並檢查這是否有幫助。解析文件時,PrettyFaces不使用XSD模式。類似這樣的:

<pretty-config xmlns="http://ocpsoft.org/prettyfaces/3.3.3"> 
    ... 
</pretty-config> 
+0

非常感謝!你是對的! 一個奇怪的事情,在與XSD一起使用的prettyfaces [1]網站上,這就是我使用它的原因。那麼它似乎並沒有結束。再次感謝你的朋友。 [1] http://ocpsoft.org/prettyfaces/ –

+1

架構的使用只是爲了在IDE中編輯XML時自動完成。據我所知,它是有效的,但這聽起來像是一個Glassfish錯誤。 – Lincoln

+0

@Lincoln,明白了,謝謝你的信息夥計。 –