• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Problems with Deployment Descriptor

Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the Wrox SCWCD book. In the 6th chapter the authors have given an example to demonstrate Secure Servlets. According to the book the below mentioned code should be inserted in the deployment descriptor (web.xml).



<realm-name>Secure Realm</realm-name>

I have inserted the code in install_dir/webapps/ROOT/WEB-INF/web.xml file .
If I am not wrong this is what is called the deployment descriptor. But now when I start the server, it throws an exception and the screen is cluttered with a large stack trace. But when I comment the above made changes it works fine. What could be the problem? How do I write Secure Servlets by making use of the Deployment Descriptor. I will be obliged if anybody can help me.
Kunal Jaggi
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Based on your description of the symptoms, my first suggestion would be to ensure that the order of elements in the deployment descriptor is correct. The container is sensitive to the order of elements in the deployment descriptor. My experience has been that if any element is out of place, the container throws an exception, which is the symptom you describe. As soon as you remove the elements, the deployment descriptor is again in the correct order, so then it works.
The order of elements you show in your message is correct, however, they must also be correct in relation to the other elements in the deployment descriptor. Check here to see the order of elements shown in tree form.
Another technique to narrow down the problem is to add each element one by one, restarting each time, until you find the specific element that is causing the problem. Then you need to check that element carefully for the correct syntax, required subelements, etc.
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic