webtier@glassfish.java.net

Re: [webtier] JSF2 - Failed to parse packaged META-INF/faces-config.xml

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Thu, 06 Aug 2009 13:03:32 -0700

In the facesconfig xsd, name's defined as javaee:java-identifierType

And in the java ee xsd, that's defined as

<xsd:pattern value="($|_|\p{L})(\p{L}|\p{Nd}|_|$)*"/>


So, if I'm reading that right (and I'm not sure that I am - I don't want
to spend 10 minutes figuring out that regex) - that it doesn't work now
is actually the correct behavior. In order to maintain compatibility
with the specs, we probably need to leave it as it is.

Is this a serious issue? It's a matter of changing a few characters, as
you note. Am I missing something (other than, this is annoying, which I
readily admit it is)?

Jim

On 8/6/09 11:27 AM, Lincoln Baxter, III wrote:
> Hi Webtier Gurus,
>
> Any idea why the below issue would be occurring? If anyone could
> suggest a few first steps, I'd be grateful, thanks.
> Is the '-' character not valid in this particular element? It seems an
> odd restriction if not.
>
> Thanks,
> Lincoln
>
> On Thu, Aug 6, 2009 at 1:25 PM, Dominik Dorn<dominik.dorn_at_gmail.com> wrote:
>
>
> Hi,
>
> I've just migrated a webapp from mine from jsf 1.2 to jsf 2.0 beta2.
> Everything works, except prettyfaces 2.0.1_GA prepends the app from loading.
>
> Thats in my catalina.out:
>
>
> Aug 6, 2009 7:08:41 PM com.sun.faces.config.ConfigManager initialize
> INFO: Unsanitized stacktrace from failed start...
> com.sun.faces.config.ConfigurationException:
> java.util.concurrent.ExecutionException:
> com.sun.faces.config.ConfigurationException: Unable to parse document
> 'jar:file:/var/lib/tomcat-6/webapps/dc-webapp/WEB-INF/lib/ocpsoft-pretty-faces-2.0.1_GA.jar!/META-INF/faces-config.xml':
> cvc-pattern-valid: Value 'ocpsoft-pretty-faces' is not facet-valid
> with respect to pattern '($|_|\p{L})(\p{L}|\p{Nd}|_|$)*' for type
> 'null'.
> at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:634)
> at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:295)
> at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:210)
> at org.apache.catalina.core.StandardContext.listenerStart(Unknown
> Source)
> at org.apache.catalina.core.StandardContext.start(Unknown Source)
> at org.apache.catalina.core.ContainerBase.addChildInternal(Unknown
> Source)
> at org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
> at org.apache.catalina.core.StandardHost.addChild(Unknown Source)
> at org.apache.catalina.startup.HostConfig.deployWAR(Unknown Source)
> at org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
> at org.apache.catalina.startup.HostConfig.check(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(Unknown
> Source)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
> at org.apache.catalina.manager.ManagerServlet.check(Unknown Source)
> at org.apache.catalina.manager.ManagerServlet.deploy(Unknown Source)
> at org.apache.catalina.manager.ManagerServlet.doPut(Unknown Source)
> at javax.servlet.http.HttpServlet.service(Unknown Source)
> at javax.servlet.http.HttpServlet.service(Unknown Source)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
> Source)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown
> Source)
> at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown
> Source)
> at org.apache.catalina.core.StandardContextValve.invoke(Unknown
> Source)
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Unknown
> Source)
> at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
> at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
> at org.apache.catalina.core.StandardEngineValve.invoke(Unknown
> Source)
> at org.apache.catalina.connector.CoyoteAdapter.service(Unknown
> Source)
> at org.apache.coyote.http11.Http11AprProcessor.process(Unknown
> Source)
> at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Unknown
> Source)
> at org.apache.tomcat.util.net.AprEndpoint$Worker.run(Unknown Source)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.util.concurrent.ExecutionException:
> com.sun.faces.config.ConfigurationException: Unable to parse document
> 'jar:file:/var/lib/tomcat-6/webapps/dc-webapp/WEB-INF/lib/ocpsoft-pretty-faces-2.0.1_GA.jar!/META-INF/faces-config.xml':
> cvc-pattern-valid: Value 'ocpsoft-pretty-faces' is not facet-valid
> with respect to pattern '($|_|\p{L})(\p{L}|\p{Nd}|_|$)*' for type
> 'null'.
> at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
> at java.util.concurrent.FutureTask.get(FutureTask.java:83)
> at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:632)
> ... 35 more
> Caused by: com.sun.faces.config.ConfigurationException: Unable to
> parse document
> 'jar:file:/var/lib/tomcat-6/webapps/dc-webapp/WEB-INF/lib/ocpsoft-pretty-faces-2.0.1_GA.jar!/META-INF/faces-config.xml':
> cvc-pattern-valid: Value 'ocpsoft-pretty-faces' is not facet-valid
> with respect to pattern '($|_|\p{L})(\p{L}|\p{Nd}|_|$)*' for type
> 'null'.
> at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:802)
> at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:749)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> ... 1 more
> Caused by: org.xml.sax.SAXParseException: cvc-pattern-valid: Value
> 'ocpsoft-pretty-faces' is not facet-valid with respect to pattern
> '($|_|\p{L})(\p{L}|\p{Nd}|_|$)*' for type 'null'.
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
> at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
> at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:410)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3165)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(XMLSchemaValidator.java:3107)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(XMLSchemaValidator.java:3076)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(XMLSchemaValidator.java:2978)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(XMLSchemaValidator.java:2121)
> at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:791)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.finishNode(DOMValidatorHelper.java:338)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:243)
> at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:186)
> at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:100)
> at javax.xml.validation.Validator.validate(Validator.java:127)
> at com.sun.faces.config.ConfigManager$ParseTask.getDocument(ConfigManager.java:855)
> at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:793)
> ... 6 more
> Aug 6, 2009 7:08:41 PM org.apache.catalina.core.StandardContext start
> SEVERE: Error listenerStart
> Aug 6, 2009 7:08:41 PM org.apache.catalina.core.StandardContext start
> SEVERE: Context [/dc-webapp] startup failed due to previous errors
>
>
>
> simply replacing the "-" with "_" in /META-INF/faces-config.xml did
> the trick for me... it looks now like this:
>
> <faces-config
> xmlns="http://java.sun.com/xml/ns/javaee"
> 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"
> version="2.0">
>
> <name>ocpsoft_pretty_faces</name>
>
> <application>
>
> <view-handler>com.ocpsoft.pretty.application.PrettyViewHandler</view-handler>
>
> <navigation-handler>com.ocpsoft.pretty.application.PrettyNavigationHandler</navigation-handler>
> </application>
> <lifecycle>
> ....
>
>
>
> Please fix this simple error and provide a new version for inclusion
> with maven2 :)
>
> Thanks a lot.
>
> Dominik
>
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "prettyfaces-users" group.
> To post to this group, send email to prettyfaces-users_at_googlegroups.com
> To unsubscribe from this group, send email to
> prettyfaces-users+unsubscribe_at_googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/prettyfaces-users?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>