-
1. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
mareshkau Dec 16, 2010 9:55 AM (in response to mikael.brodd)Hi,
#1 add this manually :-)
#2 is this content of your web.xml? if so where is root element?
-
2. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
mikael.brodd Dec 16, 2010 11:10 AM (in response to mareshkau)Hi,
what I meant was that the error message from the wizard points out the filter-mapping tag as the erroneous one. In the filter-mapping block, the JBoss tools wizard wants me to declare the dispatcher. So no, this is not the whole web.xml, only the affected part.
So the error message
Web descriptor file is corrupted : Element type "dispatcher" must be declared
points out the block
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>and wants to have <dispatcher> declared in some way. How do I do that?
N.B This is only an error from JBoss tools when I try to add JSF capabilities. The web.xml works fine in the web application.
-
3. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
akazakov Dec 16, 2010 11:14 AM (in response to mikael.brodd)Looks like a bug. Could you create an issue in https://issues.jboss.org/browse/JBIDE ? Thanks.
-
4. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
scabanovich Dec 16, 2010 11:26 AM (in response to mikael.brodd)I have only managed to get this error message with web.xml of version 2.3 (http://java.sun.com/dtd/web-app_2_3.dtd). That version does not declare element 'dispatcher'. Will you please copy here the entire content of your web.xml; and also let us know the version of JBoss Tools you use.
-
5. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
mikael.brodd Dec 17, 2010 3:25 AM (in response to scabanovich)Seems like you have a point here! My web.xml starts with
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
'http://java.sun.com/dtd/web-app_2_3.dtd'><web-app>
So I use version 2.3 as well. I have attached the web.xml to this message. Should I upgrade to a newer version of the DTD? If so, what else do I have to upgrade to make it work?
I use JBoss 4.2.2 GA and Seam 2.2.0, and JBoss tools 3.2.0 beta 1, I think. Looking in Eclipse installed software doesn't really give you one answer, but the JBoss Tools RichFaces indicates 3.2.0 beta 1.
Should I still post this as a bug?
-
web.xml 7.5 KB
-
-
6. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
scabanovich Dec 17, 2010 4:23 AM (in response to mikael.brodd)1 of 1 people found this helpfulPlease try and upgrade your web.xml to version 2.4 by replacing its header with
<?xml version="1.0" encoding="UTF-8"?>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"><?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
If server supports element <dispatcher> then it should support web descriptor of version 2.4.
If you are not sure you wish to change your working project only for the sake of adding JBoss Tools JSF capabilities, you may roll back this change after the capabilities are added, though it is better to have a shcema/dtd declaration that covers all features mentioned in the content.
It seems we have always considered the behavior of our Add JSF capabilities wizard as natural in that it prevents finishing when web descriptor is missing or 'corrupt'; but now that you have attracted our attention to the problem, it looks like rather a bug than a feature. Compare with 'Convert to Faceted Form' action that allows to add JSF facet when web descriptor is not well formed.
By the way, if you run 'Convert to Faceted Form' action and add JSF facet, then JBoss Tools JSF capabilities will be added automatically to your project. There is just one but serious restriction. Adding JSF facet to an existing project does not allow user to select web content folder, it is supposed to be 'WebContent'; if it has another name, new folder 'WebContent' and new web.xml will be created. That is when our Add JSF capabilities wizard is indispensable.
So yes, I will create a new issue and link it to this discussion.
-
7. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
mikael.brodd Dec 17, 2010 5:01 AM (in response to scabanovich)Ok, I changed that, but now I got a new error message (from adding JSF capabilities):
Web descriptor file is corrupted : Document root element "web-app", must match DOCTYPE root "null".:2:219.
The web.xml looks like this now (just the beginning):
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<!-- <!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
'http://java.sun.com/dtd/web-app_2_3.dtd'><web-app>
--><!-- Facelets needs this -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>Changing the header did not affect our application, it still works.
I cannot use your other suggestion as my webcontent is located elswhere and I am not keen on changing project/build structure
-
8. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
scabanovich Dec 17, 2010 5:54 AM (in response to mikael.brodd)Well, this is a bug, for a way around, please insert an additional space inside <!DOCTYPE to make it <! DOCTYPE.
We have a file content recognizer that tries to estimate content type without parsing xml, and in this case it does not take into account that doctype declaration is commented out.
-
9. Re: Add JSF Capabilities in Eclipse says web.xml is malformed
mikael.brodd Dec 17, 2010 8:29 AM (in response to scabanovich)Ok, I removed the comments all together, and fixed some more changes going from 2.3 -> 2.4. Now it works fine and I could add the JSF capabilities. Thanks for your help!