1
votes

I am using a Primefaces Premium theme I added the necessary jars to its classpath but encountered an error I could not debug because it seems to be not java related but xml/jsf related

faces-config.xml

Multiple annotations found at this line: - cvc-pattern-valid: Value 'primefaces-sentinel' is not facet-valid with respect to pattern '($|| \p{L})(\p{L}|\p{Nd}||$)*' for type 'null'. - cvc-complex-type.2.2: Element 'name' must have no element [children], and the value must be valid.

primefaces-sentinel.taglib.xml

cvc-complex-type.2.4.a: Invalid content was found starting with element 'description'. One of '{"http:// java.sun.com/xml/ns/javaee":handler-class, "http://java.sun.com/xml/ns/javaee":behavior, "http:// java.sun.com/xml/ns/javaee":component, "http://java.sun.com/xml/ns/javaee":converter, "http:// java.sun.com/xml/ns/javaee":validator, "http://java.sun.com/xml/ns/javaee":source}' is expected.

1

1 Answers

2
votes

It's unfortunate that you didn't show the code causing the problem. So it's guessing based on the error messages.

faces-config.xml

Multiple annotations found at this line: - cvc-pattern-valid: Value 'primefaces-sentinel' is not facet-valid with respect to pattern '($|| \p{L})(\p{L}|\p{Nd}||$)*' for type 'null'. - cvc-complex-type.2.2: Element 'name' must have no element [children], and the value must be valid.

So, you have in faces-config.xml the below element?

<name>primefaces-sentinel</name>

Given the regular expression pattern ($|| \p{L})(\p{L}|\p{Nd}||$)*, the hyphen is indeed invalid in the <name> element.

Remove the hyphen or use a different name matching the given pattern:

<name>sentinel</name>

primefaces-sentinel.taglib.xml

cvc-complex-type.2.4.a: Invalid content was found starting with element 'description'. One of '{"http://java.sun.com/xml/ns/javaee":handler-class, "http://java.sun.com/xml/ns/javaee":behavior, "http://java.sun.com/xml/ns/javaee":component, "http://java.sun.com/xml/ns/javaee":converter, "http://java.sun.com/xml/ns/javaee":validator, "http://java.sun.com/xml/ns/javaee":source}' is expected.

The <tag-name> is missing in list of expected elements, so you have in primefaces-sentinel.taglib.xml the below ordering?

<tag>
    <tag-name>...</tag-name>
    <description>...</description>
    ...
</tag>

Given the expected element ordering as defined in the XSD file, this is indeed invalid.

Swap around them:

<tag>
    <description>...</description>
    <tag-name>...</tag-name>
    ...
</tag>