Question

I'm trying to build custom URL as prettyfaces tells that it do, but after setup it, it gives me this error:

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..."

This is how my web.xml setup:

<?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>

And my 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>

With this error I can't even deploy my app in Glassfish:

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

Any idea how to fix this ? Or should I look for another tool similar to prettyfaces ?

update

enter image description here

Was it helpful?

Solution

I don't think that this error is caused by PrettyFaces. The XML schema works fine in my Eclipse setup and I don't get any of these errors. And I'm pretty sure that the XSD file is valid.

You should have a look at the Eclipse log file (WORKSPACE/.metadata/.log) to have a look if there is any exception thrown.

BTW: You could also try to remove the schemaLocation element from your pretty-config.xml and check if this helps. PrettyFaces doesn't use the XSD schema when parsing the file. Something like this:

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

OTHER TIPS

Finally figured this out.... so the reason this XSD isn't valid is because the document has this:

<?xml version="1.0" encoding="UTF-8" ?>

instead of:

<?xml version="1.0" encoding="UTF-8"?>

If anyone knows how to get ahold of Lincoln to fix this, that'd be great!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top