ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LA ROSA, Giuseppe, VF-IT" <Giuseppe.LAR...@vodafone.com>
Subject iBatis , JSP & classes
Date Fri, 13 Mar 2009 10:52:22 GMT
Hi,

I have a strange problem with Eclipse when I use iBatis .
I use the follow xml files (iBatis) :

Ibatis-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config
2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
    <settings
            cacheModelsEnabled="true"
            maxRequests="32"
            maxSessions="100"
            maxTransactions="100"/>

   <transactionManager type="JDBC">
   ...
   </transactionManager>

<sqlMap resource="select.xml"/>
</sqlMapConfig>


Select.xml

<?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-config-2.dtd"> <sqlMap
namespace="ITILDB">

<select id="selUsers" resultClass="hpgrit.Users"> SELECT id, username
FROM Users </select>
<select id="selServers" resultClass="hpgrit.Servers"> SELECT id, host
FROM Servers </select>
</sqlMap> 

The follow code :

List<Users> users =(List<Users>) sqlMap.queryForList("selUsers") ; 

works fine inside java classes, but return the follow error when I run
it inside a JSP page :
com.ibatis.sqlmap.client.SqlMapException: There is no statement named
SelUsers in this SqlMap 

Why JSP is able to use SelServers statement but no SelUsers ? 
Can be a Eclipse or Tomcat's problem ?

Best
Giuseppe


Mime
View raw message