Mantis - Resin
Viewing Issue Advanced Details
1070 minor always 04-21-06 13:34 05-09-06 18:55
ferg  
ferg  
normal  
closed  
fixed  
none    
none 3.0.19  
0001070: XML parsing issue
(rep by Christian Amott)

in testing the latest snapshot, i am getting the following exception with all of my xml config files - the attribute after the DOCTYPE is not parsing ... be it 'web-app' or 'struts-config' or whatever ....

eg.

<?xml version="1.0" encoding="UTF-8"?>

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

<web-app xmlns="http://caucho.com/ns/resin" [^]
         xmlns:resin="http://caucho.com/ns/resin/core"> [^]

...........


produces:

- Parse Fatal Error at line 6 column 0: expected `>' in <!DOCTYPE at `e'
org.xml.sax.SAXParseException: expected `>' in <!DOCTYPE at `e'
    at com.caucho.xml.XmlParser.error(XmlParser.java:2935)
    at com.caucho.xml.XmlParser.parseDoctype(XmlParser.java:525)
    at com.caucho.xml.XmlParser.parseNode(XmlParser.java:387)
    at com.caucho.xml.XmlParser.parseInt(XmlParser.java:241)
    at com.caucho.xml.AbstractParser.parse(AbstractParser.java:633)
    at org.apache.commons.digester.Digester.parse(Digester.java:1567)
    at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1112)
    at org.apache.struts.action.ActionServlet.init(ActionServlet.java:324)

Notes
(0001097)
mate   
04-28-06 00:06   
Without having looked into it any futher, I get this too with the April 26th snapshop.

Stacktrace:
org.dom4j.DocumentException: stream:4: expected `>' in <!DOCTYPE at `i'
Nested exception: stream:4: expected `>' in <!DOCTYPE at `i'
    at org.dom4j.io.SAXReader.read(SAXReader.java:484)
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:421)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:654)


Start of XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> [^]

<hibernate-mapping>
(0001100)
mate   
05-02-06 11:06   
Scott, just try the following line of code with dom4j 1.6.1 (latest) and an XML file like below.
  new org.dom4j.io.SAXReader().read( new InputSource( new FileInputStream(filename) ) );

This works in 3.0.18 but fails in the latest snapshot (and makes it impossible to launch our app using Spring and Hibernate)


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

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> [^]

<foo />
(0001101)
ferg   
05-02-06 11:47   
There will be a new snapshot tonight with a fix. I'm not closing the bug report, though, since there are still some regressions failing after the change.

(This problem was introduced as a consequence of a bug fix for i18n issues with included DTD.)