Can not write DOCTYPE declaration (DTD) when not in prolog any more

843 views
Skip to first unread message

ilke.mu...@googlemail.com

unread,
Mar 28, 2011, 12:45:33 PM3/28/11
to vogella
Hi using the

http://www.vogella.de/articles/RSSFeed/article.html

tutorial I succesfuly created a RSS documented...

But at the seam project when I run the very same code ı get this
error:


javax.xml.stream.XMLStreamException: Can not write DOCTYPE declaration
(DTD) when not in prolog any more (state 2; start element(s) written)
at
com.ctc.wstx.sw.BaseStreamWriter.verifyWriteDTD(BaseStreamWriter.java:
1410)
at com.ctc.wstx.sw.BaseStreamWriter.writeDTD(BaseStreamWriter.java:
561)
at com.ctc.wstx.evt.WstxEventWriter.add(WstxEventWriter.java:182)
at de.vogella.rss.write.RSSFeedWriter.write(RSSFeedWriter.java:54)
at tr.gov.epdk.dbs.surecler.evrak.web.RSSBean.main(RSSBean.java:60)

It is at line:


eventWriter.add(eventFactory.createAttribute("version",
"2.0"));
54: eventWriter.add(end);

eventWriter.add(eventFactory.createStartElement("", "", "channel"));
eventWriter.add(end);

This line creates the exception typed above.

Any idea ? the error seems to happen do to using an other xml api then
javax.xml.. at the run time ?

com.ctc.wstx.evt.WstxEventWriter.add(WstxEventWriter.java:182) this
class is not imported at the class file, but problably just exists. It
looks to be a jar hell problem ? but I dont know how to obstacle the
call to this classes. This is with high probability a jar hell
problem. But sealing the RSS-vogel.jar event doesnt help...

Regards.

ilke



vogella

unread,
Mar 28, 2011, 2:04:13 PM3/28/11
to vogella
Hi,

sorry, I cannot help with project specific issues. Please see
http://www.vogella.de/faq.html

Best regards, Lars

On Mar 28, 6:45 pm, "ilke.muhtaro...@googlemail.com"
Reply all
Reply to author
Forward
0 new messages