Thursday, January 12, 2012

The content of element type "properties" must match "(comment?,entry*)".

I'm trying to make my Java XML properties file a little more human-readable by breaking the entries into blocks. Evidently my assumptions on how to do this were wrong. Here are the error, cause, and solution:

Error:

java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException: The content of element type "properties" must match "(comment?,entry*)".

Cause:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>

<comment>---SQL settings---</comment>
<entry key="SQLJNDIName">SQLDataSource</entry>
<entry key="SQLServerName">server01</entry>
<entry key="SQLPortNumber">12345</entry>
<entry key="SQLDatabaseName">db01</entry>
<entry key="SQLUser">user01</entry>
<entry key="SQLPassword">changeme</entry>
<entry key="SQLTableOwner">dbo</entry>

<comment>---TEST settings---</comment>
<entry key="TEST">TEST</entry>

</properties>


Solution: I changed the comment elements into XML comments, and it worked.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>

<!--SQL settings-->
<entry key="SQLJNDIName">SQLDataSource</entry>
<entry key="SQLServerName">server01</entry>
<entry key="SQLPortNumber">12345</entry>
<entry key="SQLDatabaseName">db01</entry>
<entry key="SQLUser">user01</entry>
<entry key="SQLPassword">changeme</entry>
<entry key="SQLTableOwner">dbo</entry>

<!--TEST settings-->
<entry key="TEST">TEST</entry>

</properties>

37 comments:

  1. Cool stuff you have and you keep overhaul every one of us
    You have done a amazing job with you website
    real estate in Stone Oak

    ReplyDelete
  2. The content writing training institute online in India provides the interested candidates with alluring course module, everything you would like to jump for.
    spin rewriter

    ReplyDelete
  3. Super site! I am Loving it!! Will return once more, Im taking your food likewise, Thanks. psd to responsive html

    ReplyDelete
  4. For several years now, people have been trying to call me to ask if it is still a good idea to invest in property in the United States? I have been buying properties in the United States for more than 20 years already.
    Read More Here

    ReplyDelete
  5. Superb examining .Thanks for sharing. It's late finding this show up. Juniper Hill Allgreen

    ReplyDelete
  6. They are less likely to lend you money to grow your business and they definitely will not lend you money to buy stocks and shares. They understand that property is still a safe secure asset despite what the media says.deyaar projects

    ReplyDelete
  7. You would want search engines to reward you and expect the traffic to pour in. If you know about SEO, you would also eagerly wait for the monthly website traffic to cross seven figures fast. website content writer

    ReplyDelete
  8. With the ever evolving technology space,freelance content writer the need for the website content writing has become essential for all the businesses and individuals alike.

    ReplyDelete
  9. I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading. I had to go show it to my friend and he ejoyed it as well! Content creation

    ReplyDelete
  10. I am all that much satisfied with the substance you have specified. I needed to thank you for this extraordinary article.home buyers

    ReplyDelete
  11. Wow cool who does not know this site safeonline casino ratings that half of life does not know on this site you can really earn money without blessing.human rights assignments

    ReplyDelete
  12. This is really wonderful and I think that I can get several ideas in remodeling my house. I have been reading about different designs but these is the first time I have heard about the link you have given. Thank you for sharing.Phoenix AZ Real Estate

    ReplyDelete
  13. An interesting dialogue is price comment. I feel that it is best to write more on this matter, it may not be a taboo topic however usually individuals are not enough to talk on such topics. To the next.Glendale

    ReplyDelete
  14. Thanks! The site has been on hold as I have indeed been working on Volume 2, still several months away from completion but shaping up very well.las vegas nv apartments

    ReplyDelete
  15. You would want search engines to reward you and expect the traffic to pour in. If you know about SEO, you would also eagerly wait for the monthly website traffic to cross seven figures fast.brian

    ReplyDelete
  16. Thank you so much for writing this article. I saw this programme in 1987 when I was about 9 or 10 years old on British Forces TV in Germany. I couldn't remember the name of the programme or series and only discovered it last week by change on the internet. The ending, as you describe, was absolutely chilling. If memory serves me right, she swings the scythe and it finishes with a chopping sound. Urggh!!Kampong Java Road Tender

    ReplyDelete
  17. Interesting and interesting information can be found on this topic here profile worth to see it.HVAC Repair Fayetteville NC

    ReplyDelete
  18. Hi There! Homeia is a website that organizes and publishes real estate content thoughtfully to make it much quicker for you to find the information you want, when you want it. Besides, Homeia also specializes in digital marketing for real estate businesses, including home builders, realtors, and property managers.raeford nc home inspection

    ReplyDelete

  19. I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading. I had to go show it to my friend and he ejoyed it as well.commercial locksmith jacksonville

    ReplyDelete
  20. It is so sad that a foreign company owned some property in the us. There has no declaration about this land and if the land registry records was not there, people may not have know about this fact.professional carpet cleaning fayetteville nc

    ReplyDelete
  21. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free.Agen Domino Kiu

    ReplyDelete
  22. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free.Basketball

    ReplyDelete
  23. Hello, Focusing on the database has become such a necessity today especially in today’s data-driven technology and internet with millions and billions data storage capacity into various storage points. It’s good to see this article start with a data set point.capri leggings

    ReplyDelete
  24. Hello, Focusing on the database has become such a necessity today especially in today’s data-driven technology and internet with millions and billions data storage capacity into various storage points. It’s good to see this article start with a data set point.swim with dolphins Kona

    ReplyDelete
  25. The ability to read is not only important for being successful in today’s society; it also makes life more enjoyable. Let’s all make time to read daily.Gutters Raleigh NC

    ReplyDelete
  26. I got an interesting blog on your website while searching for a similar matter, I have read your whole blog there is lots of knowledge available, it looks good. I have bookmarked you blog it in my system.raleigh roofing

    ReplyDelete
  27. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful.
    fashion

    ReplyDelete
  28. This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free.Social Media Management

    ReplyDelete
  29. Hiya, I am really glad I have found this info. Nowadays bloggers publish only about gossips and internet and this is really annoying. A good site with interesting content, that is what I need. Thank you for keeping this web-site, I will be visiting it. 2019 Black Friday Sale Affordable

    ReplyDelete
  30. The article you have shared is interesting and informative article. i just love your way of presentation. Keep sharing more.résidence personne agée laval

    ReplyDelete
  31. I visit this website and i am impress by your way of discussion but very less information you share in this so kindly share some more information so the reader can easily understand which you share. Keep it up and keep sharing.Fayetteville NC

    ReplyDelete
  32. I have as of late begun a web journal, the data you give on this website has helped me incredibly. A debt of gratitude is in order for the greater part of your time and work.

    ReplyDelete
  33. Thank you so much for writing this article. I saw this programme in 1987 when I was about 9 or 10 years old on British Forces TV in Germany. I couldn't remember the name of the programme or series and only discovered it last week by change on the internet. The ending, as you describe, was absolutely chilling. If memory serves me right, she swings the scythe and it finishes with a chopping sound. Urggh!!

    ReplyDelete

  34. Thank you so much for writing this article. I saw this programme in 1987 when I was about 9 or 10 years old on British Forces TV in Germany. I couldn't remember the name of the programme or series and only discovered it last week by change on the internet. The ending, as you describe, was absolutely chilling. If memory serves me right, she swings the scythe and it finishes with a chopping sound. Urggh!!
    Is there any chance you could send this to me somehow? Best wishes.sell my house fast maryland

    ReplyDelete
  35. Intriguing post. I Have Been pondering about this issue, so much obliged for posting. Really cool post.It "s truly extremely pleasant and Useful post.Thanks OKP Holdings

    ReplyDelete
  36. You guardians do an astounding web diary, and have some unfathomable substance. Continue doing extraordinary. OKP Holdings Phoenix Heights

    ReplyDelete