Ben Northrop

10101110? -
Blog   |   Articles and Essays   |   PMDReports   |   Misc   |    

Error parsing XPath '/sqlMap/insert'. Cause: java.util.NoSuchElementException

  May 17th, 2008

This error was worth 2 hours of my life. I got the following cryptic error on startup of my web app (which uses Spring MVC 2.5 and Ibatis). What threw me off was that, at the top of the error stack, Spring was telling me that it was having problems loading the first bean in my config file, even though the error was really stemming from a mistake I made with unbalanced '#' characters in a completely different Ibatis config file. Seems like they're working on it.

Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.
Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/insert'.
Cause: java.util.NoSuchElementException
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:55)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser$11.process(SqlMapConfigParser.java:394)
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)
... 71 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/sqlMap/insert'.
Cause: java.util.NoSuchElementException
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:123)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:102)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)
... 74 more
Caused by: java.util.NoSuchElementException
at java.util.StringTokenizer.nextToken(Unknown Source)
at com.ibatis.sqlmap.engine.mapping.parameter.InlineParameterMapParser.
parseInlineParameterMap(InlineParameterMapParser.java:55)
at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.
parseDynamicTags(SqlStatementParser.java:240)
at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.
processSqlStatement(SqlStatementParser.java:204)
at com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.
parseGeneralStatement(SqlStatementParser.java:120)
at com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$19.process(SqlMapParser.java:563)
at com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:121)



Post a Comment

Name:
Website:
Comment:
Are you human:

View Comments (2)



Cyril Gambis May 27, 2008
Thanks for posting!

We had the same problem, and you saved us... 2 hours of our lives :)

Cyril

SWitte June 11, 2008
Same here.... only we already spend more then 2 hours.....
Thanks for the post.