I am trying to deploy to EAR to Glassfish which uses JSF and WAR file inside the EAR have faces-config.xml
ie under WEB-INF. But when I try to deploy to Glassfish server I am getting below exception:
java.lang.IllegalStateException: ContainerBase.addChild: start
org.apache.catalina.LifecycleException: java.lang.RuntimeException:
com.sun.faces.config.ConfigurationException:
java.util.concurrent.ExecutionException:
com.sun.faces.config.ConfigurationException:
Unable to parse document 'jndi:/server/WEB-INF/faces-config.xml': null
I am not sure what is the problem, Eclipse didn't gave me any error while writing faces-config.xml, but Glassfish is giving above error. And yes, I have faces-config.xml inside WEB-INF folder.
Here is the sample of faces-config.xml
file:
<?xml version='1.0' encoding='UTF-8'?>
<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">
<!-- there are other elements here -->
</faces-config>
I cannot post whole xml file since it is huge and FYI, I am trying to deploy Duke's book store Oracle sample Java EE app, but I am stuck with this error. I tried searching in Google, but didn't get any useful result. Can you kindly help me? If needed I can provide more information.
My faces-config.xml can be found here: http://temp-share.com/show/gFHKBRxsY
There is probably something wrong in your faces-config.xml
.
Maybe you are missing a >
or something similar.
You'll have to post or link to the file to provide more information.
Update:
As you have linked to your actual faces-config.xml I can see that the beginning of the file is not equal with the one you've posted.
In your file you have:
<?xml version='1.0' encoding='UTF-8'?>
<faces-config xmlns="http://xmlns.jcp.org/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">
The error is in the second line...the XML namespace is wrong.
You have to change it to:
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.0"
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">
Actually the same as you've posted in your question :)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.