Ben Northrop

  Thinking out loud about programming, decisions, philosophy...
...code ownership
Blog   |   Misc   |   CV   |   RSS    

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)



I am currently living in Pittsburgh, PA, working as a Senior Technical Consultant for Summa, and studying as a part-time graduate student in Philosophy at Carnegie Mellon University. My thoughts here are mostly on software development, but trying to take a few insights from philosophy, psychology, economics, and decision sciences to help us understand better why we do what we do...and how to do it better. I maintain two pet projects: codersCV and PMDReports. Check 'em out!




Got a Comment?

Name:
Website:
Are you human:
Comment:

Comments (12)



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.

Some Programmer October 28, 2008
Thanks for the post!

I had already wasted several hours of my life, but I'm sure you saved me several more!

Youen March 25, 2009
Thanks to your article, I only lost half an hour !

Bamyes April 30, 2009
Thank s for your post my friend.

MaMa July 28, 2009
Thanks you very much, directly found your post and therefore lost no time!

Best regards

Maarten September 07, 2009
Saved me about two hours as well, thanks! iBatis version 2.3.4.

Barath September 29, 2009
This was really helpful. Thanks a ton!

NaiveGeek December 11, 2009
Hi Ben,
Your posting really helped, I think it me 2 hours of my life :)

NaiveGeek

sunny May 05, 2010
Thnx a lot. was stuck on this for such a long time. :)

Melanie August 31, 2010
only 15 minutes wasted thanks to this post! :-)

Js September 08, 2010
Thanks for that Ben. I had missed out a # sign. Saved few hrs of my life too.