ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Problem during configuration of JNDI + Ibatis + Struts + Tomcat 5.5
Date Thu, 28 Jun 2007 12:15:54 GMT
The problem is in dao.xml.  Try this:

<daoConfig>
  <context>
    <transactionManager type="*SQLMAP*">
      <property name="SqlMapConfigResource"
                     value="com/examples/ibatis/dao/sqlMapConfig.xml" />
    </transactionManager>
    <dao interface="com.examples.ibatis.dao.UserDao"
          implementation="com.examples.ibatis.dao.UserDaoImpl" />
  </context>
</daoConfig>

Jeff Butler

On 6/28/07, ashok <ashok@sraindia.com> wrote:
>
> Hi
>
> I am facing the following problem while configuration of JNDI +Struts
> +Ibatis +Tomcat +MySql.
> I am using mysql-connector-java-3.0.17.jar .
>
> In dao.xml file :
> <daoConfig>
> <transactionManager type="JDBC">
>           <property name="SqlMapConfigResource"
>               value="com/examples/ibatis/dao/sqlMapConfig.xml" />
>       </transactionManager>
>   <context>
>      <dao interface="com.examples.ibatis.dao.UserDao"
>           implementation="com.examples.ibatis.dao.UserDaoImpl" />
>   </context>
> </daoConfig>
>
> In sqlMapConfig.xml file :
> <sqlMapConfig>
>   <settings cacheModelsEnabled="true" enhancementEnabled="true"
>       lazyLoadingEnabled="true" errorTracingEnabled="false"
> maxRequests="32"
>       maxSessions="10" maxTransactions="5"
> useStatementNamespaces="false" />
>
>       <transactionManager type="JDBC">
>           <property name="DataSource" value="JNDI" />
>           <property name="DBJndiContext"
>               value="java:comp/env/jdbc/exampleDB" />
>       </transactionManager>
>   <sqlMap resource="com/examples/ibatis/dao/UserTable.xml" />
> </sqlMapConfig>
>
> In server.xml
>
> <Context path="/example" reloadable="true"
> docBase="C:\example\WebContent" workDir="C:\example\Aci_New\work" >
> <Resource name = "jdbc/exampleDB"
>         type="javax.sql.DataSource"
>         auth="Container"
>         description="Example DB"
>         maxActive="100"
>         maxIdle="30"
>         maxWait="10000"
>         username="root"
>         password="root"
>         driverClassName="com.mysql.jdbc.Driver"
>         url="jdbc:mysql://localhost:3306/example />
> </Context>
>
> In web.xml
>   <resource-ref>
>       <description>Exampole DB Connection</description>
>       <res-ref-name>jdbc/exampleDB</res-ref-name>
>       <res-type>javax.sql.DataSource</res-type>
>       <res-auth>Container</res-auth>
>   </resource-ref>
>
> During the creation of daoManager.
> The following exception is obtained :
> com.ibatis.dao.client.DaoException: Error while configuring DaoManager.
> Cause: com.ibatis.dao.client.DaoException: DAO Transaction Manager
> properties must include a value for 'DataSource' of SIMPLE, DBCP or JNDI.
> Caused by: com.ibatis.dao.client.DaoException: DAO Transaction Manager
> properties must include a value for 'DataSource' of SIMPLE, DBCP or JNDI.
>
> What are the solutions for the above problems ?
>
> Regards
> Ashok
>
>

Mime
View raw message