Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Local DTD for web.xml
Local DTD for web.xml [message #71445] Thu, 03 February 2005 20:30 Go to next message
Eclipse UserFriend
Originally posted by: jrduncans.stephenduncanjr.com

To support disconnected development, for my project I've made a dtd
folder inside of my web-inf directory and placed the web-app_2_3.dtd
file inside this folder. Then I change the uri for the dtd on the
web.xml file from http://java.sun.com/dtd/web-app_2_3.dtd to
dtd/web-app_2_3.dtd. The web.xml file doesn't show any validation
errors when I validate it, but the project will show as an error, and
the "Deployment Descriptor" piece of the J2EE project view goes away
when using the local dtd. Any ideas?

Here's the error messages that seem to go along with saving the change
to using the local dtd:

!ENTRY org.eclipse.wst.validation 4 0 2005-02-03 15:28:30.105
!MESSAGE
*** ERROR ***: Thu Feb 03 15:28:30 EST 2005
org.eclipse.wst.validation.core.ValidationException: CHKJ3000E: WAR
Validation Failed:
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.De ploymentDescriptorLoadException:
WEB-INF/web.xml

!ENTRY org.eclipse.wst.validation 4 0 2005-02-03 15:28:30.155
!MESSAGE
*** ERROR ***: Thu Feb 03 15:28:30 EST 2005
org.eclipse.jst.j2ee.commonarchivecore.internal.exception.De ploymentDescriptorLoadException:
WEB-INF/web.xml
Re: Local DTD for web.xml [message #71465 is a reply to message #71445] Thu, 03 February 2005 21:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jmordax.terra.es

Try using the XML Catalog.
There is some discussion in this same forum in a thread titled: "Code
Assist with deployment descriptors".

Regards,

Chemi.

Stephen Duncan Jr wrote:

> To support disconnected development, for my project I've made a dtd
> folder inside of my web-inf directory and placed the web-app_2_3.dtd
> file inside this folder. Then I change the uri for the dtd on the
> web.xml file from http://java.sun.com/dtd/web-app_2_3.dtd to
> dtd/web-app_2_3.dtd. The web.xml file doesn't show any validation
> errors when I validate it, but the project will show as an error, and
> the "Deployment Descriptor" piece of the J2EE project view goes away
> when using the local dtd. Any ideas?
>
> Here's the error messages that seem to go along with saving the change
> to using the local dtd:
>
> !ENTRY org.eclipse.wst.validation 4 0 2005-02-03 15:28:30.105
> !MESSAGE
> *** ERROR ***: Thu Feb 03 15:28:30 EST 2005
> org.eclipse.wst.validation.core.ValidationException: CHKJ3000E: WAR
> Validation Failed:
> org.eclipse.jst.j2ee.commonarchivecore.internal.exception.De ploymentDescriptorLoadException:
> WEB-INF/web.xml
>
> !ENTRY org.eclipse.wst.validation 4 0 2005-02-03 15:28:30.155
> !MESSAGE
> *** ERROR ***: Thu Feb 03 15:28:30 EST 2005
> org.eclipse.jst.j2ee.commonarchivecore.internal.exception.De ploymentDescriptorLoadException:
> WEB-INF/web.xml
Re: Local DTD for web.xml [message #71862 is a reply to message #71465] Sat, 05 February 2005 14:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jrduncans.stephenduncanjr.com

I tried that. It did not help. Note: the file validated fine already,
even before using the XML Catalog. It seems to be a seperate matter of
how the WebProject interprets validating the web.xml file. However, the
option to validate that manually works as well, it seems (it goes
through the steps like "validating war" and says it's successful). So
I'm still stumped...

-Stephen

Chemi wrote:
> Try using the XML Catalog.
> There is some discussion in this same forum in a thread titled: "Code
> Assist with deployment descriptors".
>
> Regards,
>
> Chemi.
>
> Stephen Duncan Jr wrote:
>
>> To support disconnected development, for my project I've made a dtd
>> folder inside of my web-inf directory and placed the web-app_2_3.dtd
>> file inside this folder. Then I change the uri for the dtd on the
>> web.xml file from http://java.sun.com/dtd/web-app_2_3.dtd to
>> dtd/web-app_2_3.dtd. The web.xml file doesn't show any validation
>> errors when I validate it, but the project will show as an error, and
>> the "Deployment Descriptor" piece of the J2EE project view goes away
>> when using the local dtd. Any ideas?
>>
>> Here's the error messages that seem to go along with saving the change
>> to using the local dtd:
>>
>> !ENTRY org.eclipse.wst.validation 4 0 2005-02-03 15:28:30.105
>> !MESSAGE
>> *** ERROR ***: Thu Feb 03 15:28:30 EST 2005
>> org.eclipse.wst.validation.core.ValidationException: CHKJ3000E: WAR
>> Validation Failed:
>> org.eclipse.jst.j2ee.commonarchivecore.internal.exception.De ploymentDescriptorLoadException:
>> WEB-INF/web.xml
>>
>> !ENTRY org.eclipse.wst.validation 4 0 2005-02-03 15:28:30.155
>> !MESSAGE
>> *** ERROR ***: Thu Feb 03 15:28:30 EST 2005
>> org.eclipse.jst.j2ee.commonarchivecore.internal.exception.De ploymentDescriptorLoadException:
>> WEB-INF/web.xml
>
>
Re: Local DTD for web.xml [message #71917 is a reply to message #71862] Sat, 05 February 2005 23:19 Go to previous messageGo to next message
Lawrence Mandel is currently offline Lawrence MandelFriend
Messages: 486
Registered: July 2009
Senior Member
Hi Stephen,

BEA has some documentation on this that states,

"...you must still include this <!DOCTYPE...> element in your web.xml
file, and have it reference the external URL because the version of the
DTD contained in this element is used to identify the version of this
deployment descriptor."

(See
http://e-docs.bea.com/wls/docs61/webapp/webappdeployment.htm l#1006167.)

This means that to do local disconnected (no net access) development, your
deployment descriptor must still contatin a doctype declaration that
references the DTD at sun.com. You can then add the DTD to the XML catalog
to prevent Eclipse from going to sun.com to retrieve the DTD. Your doctype
declaration should look like

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.// DTD WebApplication
2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">

In regards to validation, the web.xml file will validate correctly
(according to the XML validator) as it is still a valid XML document. The
problem is it is not recognized as the deployment descriptor for your
project.


Lawrence
Re: Local DTD for web.xml [message #72013 is a reply to message #71917] Sun, 06 February 2005 21:25 Go to previous message
Eclipse UserFriend
Originally posted by: jrduncans.stephenduncanjr.com

Lawrence Mandel wrote:
> Hi Stephen,
>
> BEA has some documentation on this that states,
>
> "...you must still include this <!DOCTYPE...> element in your web.xml
> file, and have it reference the external URL because the version of the
> DTD contained in this element is used to identify the version of this
> deployment descriptor."
>
> (See
> http://e-docs.bea.com/wls/docs61/webapp/webappdeployment.htm l#1006167.)
>
> This means that to do local disconnected (no net access) development, your
> deployment descriptor must still contatin a doctype declaration that
> references the DTD at sun.com. You can then add the DTD to the XML catalog
> to prevent Eclipse from going to sun.com to retrieve the DTD. Your doctype
> declaration should look like
>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.// DTD WebApplication
> 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
>
> In regards to validation, the web.xml file will validate correctly
> (according to the XML validator) as it is still a valid XML document. The
> problem is it is not recognized as the deployment descriptor for your
> project.
>
>
> Lawrence


Thanks. That clears it up.

-Stephen
Previous Topic:Tomcat: Adding elements to generated <Context> when "Run On Server"
Next Topic:Checking out WTP from CVS
Goto Forum:
  


Current Time: Wed Jul 17 20:45:14 GMT 2024

Powered by FUDForum. Page generated in 0.03680 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top