• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Deployment Descriptors Referencing External DTDs

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Experts,

We all know that web.xml and application.xml have


code:
--------------------------------------------------------------------------------

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

--------------------------------------------------------------------------------



and

code:
--------------------------------------------------------------------------------

<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">

--------------------------------------------------------------------------------


.. respectively.

They reference the DTDs on java.sun.com. So, my application depends on the DTD's on an external site. How do I maintain fail over as I don't want my applications to fail incase the DTDs are temporarily down at java.sun.com.

I know that I can have the DTDs copied and put as inline DTDs in my deployment descriptors, but I was thinking about hosting these DTDs on my company's servers and making my deployment descriptors point to them. But, my deployment fails for some reason. Is there more configuration to do in this regard?

In my investigation I read about Catalog files etc. Is that the way to go? If yes, how is it done?

Any pointers appreciated!
Thanks in advance,
Kiran
 
Ranch Hand
Posts: 884
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried to change the <DOCTYPE> to something like these:



Of course you must have the two DTDs physically available at that URL. But, keeping them on your own website doesn't means that your server won't have downtime.

Ideally you should put the DTDs to your EAR/WAR, that way, you won't have to worry if someone accidentally removed the files from the server. If you've fail-over, even if 1 server is down, the other will still work, since the DTDs are inside your WAR/EAR.
 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chengwei,

Thanks for the reply!

I guess having DTDs in the war/ear is the way to go. In that case, how does my <!DOCTYPE looks like?

I tried


and putting application_1_3.dtd in my META-INF directory. But it fails.

Thanks,
Kiran
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try putting it in the WEB-INF\lib folder?

 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pratheep,

I am talking about application.xml which is a DD for Enterprise Application and not web application project. I tried putting it in META-INF together with application.xml and used "application_1_3.dtd" as the system identifier. I also tried using "file://application_1_3.dtd" but nothing works.

Thanks,
Kiran
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds like an XML topic to me. Moving it accordingly.
reply
    Bookmark Topic Watch Topic
  • New Topic