emacarron / mybatis

Automatically exported from code.google.com/p/mybatis
0 stars 0 forks source link

Insufficient error diagnostics parsing XML configuration #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
MyBatis 3.0.2 emits parse exception after encountering syntax or validation 
error while parsing config files, but it is hard to guess where the error is 
because filename and line number are not reported.

Original issue reported on code.google.com by arkadi.s...@gmail.com on 19 Sep 2010 at 12:41

GoogleCodeExporter commented 9 years ago
can you give an example of a bad config file and what you would expect from the 
error message

Original comment by nathan.m...@gmail.com on 12 Sep 2011 at 3:11

GoogleCodeExporter commented 9 years ago
Any incorrect file would do the job, for example

qwerty

I would expect a standard Xerces error message (cvc-something-N-M:line:column), 
together file name, because files can be nested.
Not sure about current state of error reporting, because the bugreport is one 
year old.

Original comment by arkadi.s...@gmail.com on 12 Sep 2011 at 4:27

GoogleCodeExporter commented 9 years ago
I can see both the file name and the line number. 

org.apache.ibatis.exceptions.PersistenceException: 
### Error building SqlSession.
### The error may exist in org/apache/ibatis/submitted/missingcolumn/Map.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper 
Configuration. Cause: org.apache.ibatis.builder.BuilderException: Error 
creating document instance.  Cause: org.xml.sax.SAXParseException; lineNumber: 
45; columnNumber: 10; The content of element type "mapper" must match 
"(cache-ref|cache|resultMap*|parameterMap*|sql*|insert*|update*|delete*|select*)
+".

Original comment by eduardo.macarron on 16 Jan 2012 at 5:08