You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Stanley, Eric" <Er...@qwest.com> on 2009/01/24 00:40:13 UTC

SqlMapConfig.xml and subsequent sqlMap entries

All,
    New to iBATIS, just trying to get the thing to load properly. I am
using eclipse 3.4.1, Tomcat 6, iBATIS 2.3.4 and JDK 1.5. It seems to be
loading the SqlMapConfig.xml fine, but when it tries to parse the sqlMap
entries, it dies hard:
 
java.lang.RuntimeException: Error initializing MyAppSqlConfig class.
Cause: java.lang.RuntimeException: Error occurred. Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML. Cause:
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
Cause: java.io.IOException: Could not find resource
com/qwest/pt/domain/sql/Hla.xml 

This looks to me like a simple classpath issue, and maybe it is. I tried
putting the sqlMap files in the WEB-INF/classes folder and updating the
SqlMapConfig.xml to no avail. Ive tried just about every combination I
can think of, and it still cant find these sqlMap files. I really
appreciate any help on this, and would be happy to provide more info if
needed. Here is my setup:

 

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

Hla.xml located in: com.qwest.pt.domain.sql

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

<pre>

<code>

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

<!DOCTYPE sqlMap

PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"

"http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="Hla">

<select id="getHlaById" parameterClass="java.lang.Integer"
resultClass="com.qwest.pt.domain.Hla">

select * from hla where id = #value#</select>

</sqlMap>

</code>

</pre>

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

SqlMapConfig.xml

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

<pre>

<code>

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

<!DOCTYPE sqlMapConfig

PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"

"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

<transactionManager type="JDBC">

<dataSource type="JNDI">

<property name="DataSource" value="java:comp/env/jdbc/pptracker"/>

</dataSource>

</transactionManager>

<sqlMap resource="com/qwest/pt/domain/sql/Hla.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Loe.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Priority.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Status.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/User.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Action.xml "/>

</sqlMapConfig>

</code>

</pre>

 

 


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.

RE: SqlMapConfig.xml and subsequent sqlMap entries

Posted by "Stanley, Eric" <Er...@qwest.com>.
Rick,
	Thanks for the reply. The sqlMap files are in
com.qwest.pt.domain.sql, and this is one of the sqlMap entries in the
sqlMapConfig:

<sqlMap resource="com/qwest/pt/domain/sql/Hla.xml "/>

It seems to me that this should work :) I have used Hibernate before
while keeping this same package/directory structure and Ive never had an
issue with the classpath. It just finds my maps on the classpath, no
questions asked. Makes me wonder if iBATIS is looking for a specific
directory or package structure. I *did* try just putting all my sqlMaps
in WEB-INF/classes and changing my sqlMapConfig to this:

<sqlMap resource="Hla.xml "/> 

But that didn't work either. So, let me know what you guys think. I
realy don't want to use hibernate for this.

-Ryan

-----Original Message-----
From: Rick [mailto:rickcr@gmail.com] 
Sent: Saturday, January 24, 2009 11:53 AM
To: user-java@ibatis.apache.org
Subject: Re: SqlMapConfig.xml and subsequent sqlMap entries

Are you sure the file is found in
classes/com/qwest/pt/domain/sql/Hla.xml ?
(You mentioned having the file placed directly under classes, which
wouldn't work if the path above is what ibatis is looking for)

On Fri, Jan 23, 2009 at 6:40 PM, Stanley, Eric
<Er...@qwest.com> wrote:
> All,
>     New to iBATIS, just trying to get the thing to load properly. I am

> using eclipse 3.4.1, Tomcat 6, iBATIS 2.3.4 and JDK 1.5. It seems to 
> be loading the SqlMapConfig.xml fine, but when it tries to parse the 
> sqlMap entries, it dies hard:
>
>
> java.lang.RuntimeException
>
> : Error initializing MyAppSqlConfig class. Cause:
> java.lang.RuntimeException: Error occurred. Cause:
> com.ibatis.common.xml.NodeletException: Error parsing XML. Cause:
> java.lang.RuntimeException: Error parsing XPath
'/sqlMapConfig/sqlMap'.
> Cause: java.io.IOException: Could not find resource 
> com/qwest/pt/domain/sql/Hla.xml
>
> This looks to me like a simple classpath issue, and maybe it is. I 
> tried putting the sqlMap files in the WEB-INF/classes folder and 
> updating the SqlMapConfig.xml to no avail. Ive tried just about every 
> combination I can think of, and it still cant find these sqlMap files.

> I really appreciate any help on this, and would be happy to provide 
> more info if needed. Here is my
> setup:
>
>
>
> ----------------------------------------------------------------------
> -----------
>
> Hla.xml located in: com.qwest.pt.domain.sql
>
> ----------------------------------------------------------------------
> -----------
>
> <pre>
>
> <code>
>
> <?
>
> xml version="1.0" encoding="UTF-8" ?>
>
> <!
>
> DOCTYPE sqlMap
>
> PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
>
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
>
> <sqlMap
>
> namespace="Hla">
>
> <select id="getHlaById" parameterClass="java.lang.Integer"
> resultClass="com.qwest.pt.domain.Hla">
>
> select * from hla where id = #value#
>
> </select>
>
> </sqlMap>
>
> </code>
>
> </pre>
>
> ----------------------------------------------------------------------
> -----------
>
> SqlMapConfig.xml
>
> ----------------------------------------------------------------------
> -----------
>
> <pre>
>
> <code>
>
> <?
>
> xml version="1.0" encoding="UTF-8" ?>
>
> <!
>
> DOCTYPE sqlMapConfig
>
> PUBLIC
>
> "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
>
> "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"
>
>>
>
> <sqlMapConfig>
>
> <transactionManager type="JDBC">
>
> <dataSource type="JNDI">
>
> <property name="DataSource" value="java:comp/env/jdbc/pptracker"/>
>
> </dataSource>
>
> </transactionManager>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Hla.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Loe.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Priority.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Status.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/User.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Action.xml "/>
>
> </sqlMapConfig>
>
> </code>
>
> </pre>
>
>
>
>
>
> This communication is the property of Qwest and may contain 
> confidential or privileged information. Unauthorized use of this 
> communication is strictly prohibited and may be unlawful. If you have 
> received this communication in error, please immediately notify the 
> sender by reply e-mail and destroy all copies of the communication and
any attachments.



--
Rick

Re: SqlMapConfig.xml and subsequent sqlMap entries

Posted by Rick <ri...@gmail.com>.
Are you sure the file is found in classes/com/qwest/pt/domain/sql/Hla.xml ?
(You mentioned having the file placed directly under classes, which
wouldn't work if the path above is what ibatis is looking for)

On Fri, Jan 23, 2009 at 6:40 PM, Stanley, Eric <Er...@qwest.com> wrote:
> All,
>     New to iBATIS, just trying to get the thing to load properly. I am using
> eclipse 3.4.1, Tomcat 6, iBATIS 2.3.4 and JDK 1.5. It seems to be loading
> the SqlMapConfig.xml fine, but when it tries to parse the sqlMap entries, it
> dies hard:
>
>
> java.lang.RuntimeException
>
> : Error initializing MyAppSqlConfig class. Cause:
> java.lang.RuntimeException: Error occurred. Cause:
> com.ibatis.common.xml.NodeletException: Error parsing XML. Cause:
> java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
> Cause: java.io.IOException: Could not find resource
> com/qwest/pt/domain/sql/Hla.xml
>
> This looks to me like a simple classpath issue, and maybe it is. I tried
> putting the sqlMap files in the WEB-INF/classes folder and updating the
> SqlMapConfig.xml to no avail. Ive tried just about every combination I can
> think of, and it still cant find these sqlMap files. I really appreciate any
> help on this, and would be happy to provide more info if needed. Here is my
> setup:
>
>
>
> ---------------------------------------------------------------------------------
>
> Hla.xml located in: com.qwest.pt.domain.sql
>
> ---------------------------------------------------------------------------------
>
> <pre>
>
> <code>
>
> <?
>
> xml version="1.0" encoding="UTF-8" ?>
>
> <!
>
> DOCTYPE sqlMap
>
> PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
>
> "http://www.ibatis.com/dtd/sql-map-2.dtd">
>
> <sqlMap
>
> namespace="Hla">
>
> <select id="getHlaById" parameterClass="java.lang.Integer"
> resultClass="com.qwest.pt.domain.Hla">
>
> select * from hla where id = #value#
>
> </select>
>
> </sqlMap>
>
> </code>
>
> </pre>
>
> ---------------------------------------------------------------------------------
>
> SqlMapConfig.xml
>
> ---------------------------------------------------------------------------------
>
> <pre>
>
> <code>
>
> <?
>
> xml version="1.0" encoding="UTF-8" ?>
>
> <!
>
> DOCTYPE sqlMapConfig
>
> PUBLIC
>
> "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
>
> "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"
>
>>
>
> <sqlMapConfig>
>
> <transactionManager type="JDBC">
>
> <dataSource type="JNDI">
>
> <property name="DataSource" value="java:comp/env/jdbc/pptracker"/>
>
> </dataSource>
>
> </transactionManager>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Hla.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Loe.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Priority.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Status.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/User.xml "/>
>
> <sqlMap resource="com/qwest/pt/domain/sql/Action.xml "/>
>
> </sqlMapConfig>
>
> </code>
>
> </pre>
>
>
>
>
>
> This communication is the property of Qwest and may contain confidential or
> privileged information. Unauthorized use of this communication is strictly
> prohibited and may be unlawful. If you have received this communication in
> error, please immediately notify the sender by reply e-mail and destroy all
> copies of the communication and any attachments.



-- 
Rick

RE: SqlMapConfig.xml and subsequent sqlMap entries

Posted by "Stanley, Eric" <Er...@qwest.com>.
No. Its just the way the xml pasted into outlook.
 
-Ryan

________________________________

From: Jonathan Moores [mailto:jonathan.moores@gmail.com] 
Sent: Friday, January 23, 2009 5:18 PM
To: user-java@ibatis.apache.org
Subject: RE: SqlMapConfig.xml and subsequent sqlMap entries



Not sure but is there any reason that there are spaces after .xml?

 

From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com] 
Sent: zaterdag 24 januari 2009 0:40
To: user-java@ibatis.apache.org
Subject: SqlMapConfig.xml and subsequent sqlMap entries

 

All,

    New to iBATIS, just trying to get the thing to load properly. I am
using eclipse 3.4.1, Tomcat 6, iBATIS 2.3.4 and JDK 1.5. It seems to be
loading the SqlMapConfig.xml fine, but when it tries to parse the sqlMap
entries, it dies hard:

 

java.lang.RuntimeException: Error initializing MyAppSqlConfig class.
Cause: java.lang.RuntimeException: Error occurred. Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML. Cause:
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
Cause: java.io.IOException: Could not find resource
com/qwest/pt/domain/sql/Hla.xml 

This looks to me like a simple classpath issue, and maybe it is. I tried
putting the sqlMap files in the WEB-INF/classes folder and updating the
SqlMapConfig.xml to no avail. Ive tried just about every combination I
can think of, and it still cant find these sqlMap files. I really
appreciate any help on this, and would be happy to provide more info if
needed. Here is my setup:

 

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

Hla.xml located in: com.qwest.pt.domain.sql

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

<pre>

<code>

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

<!DOCTYPE sqlMap

PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"

"http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="Hla">

<select id="getHlaById" parameterClass="java.lang.Integer"
resultClass="com.qwest.pt.domain.Hla">

select * from hla where id = #value#</select>

</sqlMap>

</code>

</pre>

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

SqlMapConfig.xml

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

<pre>

<code>

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

<!DOCTYPE sqlMapConfig

PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"

"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

<transactionManager type="JDBC">

<dataSource type="JNDI">

<property name="DataSource" value="java:comp/env/jdbc/pptracker"/>

</dataSource>

</transactionManager>

<sqlMap resource="com/qwest/pt/domain/sql/Hla.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Loe.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Priority.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Status.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/User.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Action.xml "/>

</sqlMapConfig>

</code>

</pre>

 

 



This communication is the property of Qwest and may contain confidential
or privileged information. Unauthorized use of this communication is
strictly prohibited and may be unlawful. If you have received this
communication in error, please immediately notify the sender by reply
e-mail and destroy all copies of the communication and any attachments.


RE: SqlMapConfig.xml and subsequent sqlMap entries

Posted by "Stanley, Eric" <Er...@qwest.com>.
Jonathon,
    I should have read a little closer. You were right. I apologize for
wasting time on a typo.
 
-Ryan

________________________________

From: Jonathan Moores [mailto:jonathan.moores@gmail.com] 
Sent: Friday, January 23, 2009 5:18 PM
To: user-java@ibatis.apache.org
Subject: RE: SqlMapConfig.xml and subsequent sqlMap entries



Not sure but is there any reason that there are spaces after .xml?

 

From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com] 
Sent: zaterdag 24 januari 2009 0:40
To: user-java@ibatis.apache.org
Subject: SqlMapConfig.xml and subsequent sqlMap entries

 

All,

    New to iBATIS, just trying to get the thing to load properly. I am
using eclipse 3.4.1, Tomcat 6, iBATIS 2.3.4 and JDK 1.5. It seems to be
loading the SqlMapConfig.xml fine, but when it tries to parse the sqlMap
entries, it dies hard:

 

java.lang.RuntimeException: Error initializing MyAppSqlConfig class.
Cause: java.lang.RuntimeException: Error occurred. Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML. Cause:
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
Cause: java.io.IOException: Could not find resource
com/qwest/pt/domain/sql/Hla.xml 

This looks to me like a simple classpath issue, and maybe it is. I tried
putting the sqlMap files in the WEB-INF/classes folder and updating the
SqlMapConfig.xml to no avail. Ive tried just about every combination I
can think of, and it still cant find these sqlMap files. I really
appreciate any help on this, and would be happy to provide more info if
needed. Here is my setup:

 

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

Hla.xml located in: com.qwest.pt.domain.sql

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

<pre>

<code>

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

<!DOCTYPE sqlMap

PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"

"http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="Hla">

<select id="getHlaById" parameterClass="java.lang.Integer"
resultClass="com.qwest.pt.domain.Hla">

select * from hla where id = #value#</select>

</sqlMap>

</code>

</pre>

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

SqlMapConfig.xml

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

<pre>

<code>

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

<!DOCTYPE sqlMapConfig

PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"

"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

<transactionManager type="JDBC">

<dataSource type="JNDI">

<property name="DataSource" value="java:comp/env/jdbc/pptracker"/>

</dataSource>

</transactionManager>

<sqlMap resource="com/qwest/pt/domain/sql/Hla.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Loe.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Priority.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Status.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/User.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Action.xml "/>

</sqlMapConfig>

</code>

</pre>

 

 



This communication is the property of Qwest and may contain confidential
or privileged information. Unauthorized use of this communication is
strictly prohibited and may be unlawful. If you have received this
communication in error, please immediately notify the sender by reply
e-mail and destroy all copies of the communication and any attachments.


RE: SqlMapConfig.xml and subsequent sqlMap entries

Posted by Jonathan Moores <jo...@gmail.com>.
Not sure but is there any reason that there are spaces after .xml?

 

From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com] 
Sent: zaterdag 24 januari 2009 0:40
To: user-java@ibatis.apache.org
Subject: SqlMapConfig.xml and subsequent sqlMap entries

 

All,

    New to iBATIS, just trying to get the thing to load properly. I am using
eclipse 3.4.1, Tomcat 6, iBATIS 2.3.4 and JDK 1.5. It seems to be loading
the SqlMapConfig.xml fine, but when it tries to parse the sqlMap entries, it
dies hard:

 

java.lang.RuntimeException: Error initializing MyAppSqlConfig class. Cause:
java.lang.RuntimeException: Error occurred. Cause:
com.ibatis.common.xml.NodeletException: Error parsing XML. Cause:
java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
Cause: java.io.IOException: Could not find resource
com/qwest/pt/domain/sql/Hla.xml 

This looks to me like a simple classpath issue, and maybe it is. I tried
putting the sqlMap files in the WEB-INF/classes folder and updating the
SqlMapConfig.xml to no avail. Ive tried just about every combination I can
think of, and it still cant find these sqlMap files. I really appreciate any
help on this, and would be happy to provide more info if needed. Here is my
setup:

 

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

Hla.xml located in: com.qwest.pt.domain.sql

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

<pre>

<code>

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

<!DOCTYPE sqlMap

PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"

"http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="Hla">

<select id="getHlaById" parameterClass="java.lang.Integer"
resultClass="com.qwest.pt.domain.Hla">

select * from hla where id = #value#</select>

</sqlMap>

</code>

</pre>

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

SqlMapConfig.xml

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

<pre>

<code>

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

<!DOCTYPE sqlMapConfig

PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"

"http://ibatis.apache.org/dtd/sql-map-config-2.dtd">

<sqlMapConfig>

<transactionManager type="JDBC">

<dataSource type="JNDI">

<property name="DataSource" value="java:comp/env/jdbc/pptracker"/>

</dataSource>

</transactionManager>

<sqlMap resource="com/qwest/pt/domain/sql/Hla.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Loe.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Priority.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Status.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/User.xml "/>

<sqlMap resource="com/qwest/pt/domain/sql/Action.xml "/>

</sqlMapConfig>

</code>

</pre>

 

 



This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful. If you have received this communication in
error, please immediately notify the sender by reply e-mail and destroy all
copies of the communication and any attachments.