[jboss-user] [JBoss Tools (users)] - Ambiguous error with web.xml adding JSF

GeoffHart do-not-reply at jboss.com
Mon Oct 8 18:29:15 EDT 2007


I'm wondering if there is some reason the error below is reported like this; or if I should file a feature request to get something more specific reported instead?

--

Wizard for adding JSF capabilities to a project can report a misleading error message for web.xml files that makes it hard for users to correct the issue. The error could be made much clearer (example follows). You get here by right-clicking on a project and selecting Red Hat Developer Studio -> Add JSF Capabilities....; it is the first window that appears.


Consider a project with an existing (and working) web-xml file which is considered INVALID by the JSF wizard:

<?xml version="1.0" encoding="UTF-8"?>
  | 
  | <!DOCTYPE web-app
  |     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  |     "http://java.sun.com/dtd/web-app_2_2.dtd">
  | <web-app>
  | 	<servlet>
  | 		<servlet-name>DummyServlet</servlet-name>
  | 		<servlet-class>dummy.class</servlet-class>
  | 	</servlet>
  | 	<servlet-mapping>
  | 		<servlet-name>DummyServlet</servlet-name>
  | 		<url-pattern>myWebPage</url-pattern>
  | 	</servlet-mapping>
  | </web-app>

1.0.0 Beta2 reports the following error:
"Web descriptor file is corrupted : Element type "web-app" must be declared.:6:10."

The problem appears to be related to the doc-type/DTD field, and if I change the version to 2.3, it accepts the web.xml file:

<!DOCTYPE web-app
  |     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
  |     "http://java.sun.com/dtd/web-app_2_3.dtd">

If the error said the DOCTYPE was invalid (and why) rather than web-app was missing, it would be a lot more helpful to track down errors. 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092780#4092780

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092780



More information about the jboss-user mailing list