ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashok <as...@sraindia.com>
Subject Re: Problem during configuration of JNDI + Ibatis + Struts + Tomcat 5.5
Date Thu, 28 Jun 2007 05:39:20 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi<br>
<br>
I have tried it ,it works fine.<br>
But I need a JNDI implementation, tried Java Pet Store(Not sufficient
information for a JNDI implementation).<br>
Thanks <br>
<br>
Regards<br>
Ashok<br>
<br>
Gaurav Goel wrote:
<blockquote cite="mid000601c7b947$0f148c90$5e02000a@arrkgroup.com"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="MS Exchange Server version 6.5.7036.0">
  <title>RE: Problem during configuration of JNDI + Ibatis + Struts +
Tomcat 5.5</title>
<!-- Converted from text/rtf format -->
  <p><span lang="en-us"><font face="Arial" size="2">Hi,</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">I am using the
following transaction manager configuration. As your error says, it
needs a value for datasource. please try the following sort of thing:</font></span></p>
  <p><span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial" size="2">&lt;transactionManager
type = "JDBC"&gt;</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b> <font face="Arial"
size="2">&lt;dataSource
type = "SIMPLE"&gt;</font></b></span>
  <br>
  <span lang="en-us"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial"
 size="2">&lt;property name = "JDBC.Driver"</font></b></span>
  <br>
  <span lang="en-us"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font
 face="Arial" size="2">value = "oracle.jdbc.driver.OracleDriver" /&gt;</font></b></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial"
 size="2">&lt;property name="JDBC.ConnectionURL"</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Arial"
 size="2">value = "jdbc:oracle:thin:@//abidb02:1586/ORCL" /&gt;</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial"
 size="2">&lt;property name = "JDBC.Username" value = "abiwebtest"&nbsp;
/&gt;</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial"
 size="2">&lt;property name = "JDBC.Password" value = "web4810" /&gt;</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial"
 size="2">&lt;property name = "Pool.MaximumActiveConnections" value =
"100" /&gt;</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial"
 size="2">&lt;property name = "Pool.MaximumIdleConnections" value =
"50" /&gt;</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial"
 size="2">&lt;property name="Pool.TimeToWait" value="2000"/&gt;</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <font face="Arial"
size="2">&lt;/dataSource&gt;</font></span>
  <br>
  <span lang="en-us">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<font face="Arial" size="2">&lt;/transactionManager&gt;</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">Thanks &amp;
Regards,</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">Gaurav Goel.</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">-----Original
Message-----</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">From: ashok [</font></span><a
 href="mailto:ashok@sraindia.com"><span lang="en-us"><u><font
 color="#0000ff" face="Arial" size="2">mailto:ashok@sraindia.com</font></u></span></a><span
 lang="en-us"><font face="Arial" size="2">] </font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">Sent: Thursday, June
28, 2007 10:45 AM</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">To:
<a class="moz-txt-link-abbreviated" href="mailto:user-java@ibatis.apache.org">user-java@ibatis.apache.org</a></font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">Subject: Problem
during configuration of JNDI + Ibatis + Struts + Tomcat 5.5</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">Hi</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">I am facing the
following problem while configuration of JNDI +Struts </font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">+Ibatis +Tomcat +MySql.</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">I am using
mysql-connector-java-3.0.17.jar .</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">In dao.xml file :</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&lt;daoConfig&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&lt;transactionManager
type="JDBC"&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="SqlMapConfigResource"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
value="com/examples/ibatis/dao/sqlMapConfig.xml" /&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/transactionManager&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp; &lt;context&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;dao
interface="com.examples.ibatis.dao.UserDao"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
implementation="com.examples.ibatis.dao.UserDaoImpl" /&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp; &lt;/context&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&lt;/daoConfig&gt;</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">In sqlMapConfig.xml
file :</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&lt;sqlMapConfig&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp; &lt;settings
cacheModelsEnabled="true" enhancementEnabled="true"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lazyLoadingEnabled="true" errorTracingEnabled="false" </font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">maxRequests="32"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
maxSessions="10" maxTransactions="5" </font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">useStatementNamespaces="false"
/&gt;</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;transactionManager type="JDBC"&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="DataSource" value="JNDI" /&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="DBJndiContext"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
value=<a class="moz-txt-link-rfc2396E" href="java:comp/env/jdbc/exampleDB">"java:comp/env/jdbc/exampleDB"</a>
/&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/transactionManager&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp; &lt;sqlMap
resource="com/examples/ibatis/dao/UserTable.xml" /&gt;
&lt;/sqlMapConfig&gt;</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">In server.xml</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">&lt;Context
path="/example" reloadable="true" </font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">docBase="C:\example\WebContent"
workDir="C:\example\Aci_New\work" &gt; &lt;Resource name =
"jdbc/exampleDB"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
type="javax.sql.DataSource"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
auth="Container"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
description="Example DB"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
maxActive="100"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
maxIdle="30"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
maxWait="10000"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
username="root"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
password="root"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
driverClassName="com.mysql.jdbc.Driver"</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
url="jdbc:mysql://localhost:3306/example /&gt;&nbsp; &lt;/Context&gt;</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">In web.xml</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp; &lt;resource-ref&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;description&gt;Exampole DB Connection&lt;/description&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;res-ref-name&gt;jdbc/exampleDB&lt;/res-ref-name&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;res-auth&gt;Container&lt;/res-auth&gt;</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">&nbsp;&nbsp;
&lt;/resource-ref&gt;</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">During the creation
of daoManager.</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">The following
exception is obtained :</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">com.ibatis.dao.client.DaoException:
Error while configuring DaoManager.&nbsp; </font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">Cause:
com.ibatis.dao.client.DaoException: DAO Transaction Manager properties
must include a value for 'DataSource' of SIMPLE, DBCP or JNDI.</font></span></p>
  <p><span lang="en-us"><font face="Arial" size="2">Caused by:
com.ibatis.dao.client.DaoException: DAO Transaction Manager properties
must include a value for 'DataSource' of SIMPLE, DBCP or JNDI.</font></span></p>
  <p><span lang="en-us"><font face="Arial" size="2">What are the
solutions for the above problems ?</font></span>
  </p>
  <p><span lang="en-us"><font face="Arial" size="2">Regards</font></span>
  <br>
  <span lang="en-us"><font face="Arial" size="2">Ashok</font></span>
  </p>
</blockquote>
<br>
</body>
</html>


Mime
View raw message