Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. with IBATIS
08-24-2008, 03:01 PM
Post: #1
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. with IBATIS
I am getting a runtime error message with my IBATIS code.

java.lang.RuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'. Cause: com.ibatis.sqlmap.client.SqlMapException: Error. Could not set result class. Cause: java.lang.ClassNotFoundException: TestResult
at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser​.java:89)
at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuild​er.java:63)
at org.apache.jsp.test_jsp._jspService(test_jsp.java from :79)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)


How do I fix this issue?
Find all posts by this user
Quote this message in a reply
08-24-2008, 03:10 PM
Post: #2
RE: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. with IBATIS
Check your mapping file. Can you post your mapping file here?
Visit this user's website Find all posts by this user
Quote this message in a reply
08-24-2008, 03:13 PM
Post: #3
RE: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. with IBATIS
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="Test">
<typeAlias alias="Test" type="com.test.Test" />
<resultMap id="TestResult" class="Test">
<result property="testId" column="TEST_ID" />
<result property="description" column="DESCRIPTION" />
</resultMap>

<select id="getAllTests" resultClass="TestResult">
SELECT * FROM TEST</select>

<select id="getTestById" parameterClass="Long"
resultClass="Test">
select TEST_ID as testId, DESCRIPTION AS
description from TEST
where TEST_ID = #testId#</select>

</sqlMap>
Find all posts by this user
Quote this message in a reply
08-24-2008, 03:48 PM
Post: #4
RE: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. with IBA
[xml]
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">
<sqlMap namespace="Test">
<typeAlias alias="Test" type="com.test.Test" />
<resultMap id="TestResult" class="Test">
<result property="testId" column="TEST_ID" />
<result property="description" column="DESCRIPTION" />
</resultMap>

<select id="getAllTests" resultMap="TestResult">
SELECT * FROM TEST</select>

<select id="getTestById" parameterClass="Long"
resultClass="Test">
select TEST_ID as testId, DESCRIPTION AS
description from TEST
where TEST_ID = #testId#</select>

</sqlMap>
[/xml]

You are pointing to a resultMap and name it as resultClass
Visit this user's website Find all posts by this user
Quote this message in a reply
02-16-2009, 11:52 PM
Post: #5
RE: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. with IBATIS
Hi Everyone,

Good information!!!
Visit this user's website Find all posts by this user
Quote this message in a reply
10-08-2009, 02:40 PM (This post was last modified: 10-08-2009 02:46 PM by albinjoseph.)
Post: #6
RE: java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'. with IBATIS
All programming language have their different errors in running a program. I just want to say thank you for sharing with us that useful post you have shared with us.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)