ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Qian" <daqiqi...@aol.com>
Subject Re: iBatis and Tomcat
Date Mon, 30 Jan 2006 18:06:59 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
<font face="Arial,sans-serif"><font size="2">Rashmi,<br>
<br>
The bet you used Resources to read the configuration files. To avoid
the problem, put the configuration files to the root of the java
package. It can be easily done in your ant build file.&nbsp; something like:<br>
<br>
&lt;copy todir="${build.dir}" flatten="true"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;fileset dir="${src.dir}" includes="**/*.xml"/&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/copy&gt;<br>
<br>
tony<br>
<br>
<br>
<span type="cite">Rashmi Dave wrote on 1/30/2006, 11:44 AM:</span>
</font></font>
<p><font face="Arial,sans-serif" size="2"></font></p>
<blockquote type="cite"   style="border-left: thin solid blue; padding-left: 10px; margin-left:
0pt;"><font   face="Arial,sans-serif" size="2"></font>
  <div class="Section1"><font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">Hi
All,<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">My
question might not relate completely
with an iBATIS problem, however, I am a little desperate and would
really
appreciate some help.<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">I
have an application which I am deploying
as a WAR onto a tomcat 5.5 server. The application contains a daoConfig
and an
SQLMapConfig. The WAR file looks like<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">App.war
= <o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><!--[if
!supportLists]--><font   size="2" color="navy" face="Arial"><font face="Arial"><font
size="2"><font   color="navy"><font color="navy"><span style="">-<font
size="1"   face="Times New Roman"><span   style="font-family: &quot;Times New Roman&quot;;
font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height:
normal; font-stretch: normal; font-size-adjust: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font></span></font></font></font></font></font><!--[endif]--><font
  size="2" color="navy" face="Arial"><font face="Arial"><font size="2"><font
  color="navy"><font color="navy">config
(dataaccess.config and other config files)<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><!--[if
!supportLists]--><font   size="2" color="navy" face="Arial"><font face="Arial"><font
size="2"><font   color="navy"><font color="navy"><span style="">-<font
size="1"   face="Times New Roman"><span   style="font-family: &quot;Times New Roman&quot;;
font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height:
normal; font-stretch: normal; font-size-adjust: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font></span></font></font></font></font></font><!--[endif]--><font
  size="2" color="navy" face="Arial"><font face="Arial"><font size="2"><font
  color="navy"><font color="navy">screens
(containing jsp pages)<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal" style="margin-left: 0.5in; text-indent: -0.25in;"><!--[if
!supportLists]--><font   size="2" color="navy" face="Arial"><font face="Arial"><font
size="2"><font   color="navy"><font color="navy"><span style="">-<font
size="1"   face="Times New Roman"><span   style="font-family: &quot;Times New Roman&quot;;
font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height:
normal; font-stretch: normal; font-size-adjust: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font></span></font></font></font></font></font><!--[endif]--><font
  size="2" color="navy" face="Arial"><font face="Arial"><font size="2"><font
  color="navy"><font color="navy">WEB-INF
(contains struts-config, web.xml)<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"><!--[if !supportLists]--><font
  size="2" color="navy" face="Courier New"><font face="Courier New"><font   size="2"><font
color="navy"><font color="navy"><span style="">o<font   size="1" face="Times
New Roman"><span   style="font-family: &quot;Times New Roman&quot;; font-style:
normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-stretch:
normal; font-size-adjust: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font></span></font></font></font></font></font><!--[endif]--><font
  size="2" color="navy" face="Arial"><font face="Arial"><font size="2"><font
  color="navy"><font color="navy">Lib (related
lib files)<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal" style="margin-left: 1in; text-indent: -0.25in;"><!--[if !supportLists]--><font
  size="2" color="navy" face="Courier New"><font face="Courier New"><font   size="2"><font
color="navy"><font color="navy"><span style="">o<font   size="1" face="Times
New Roman"><span   style="font-family: &quot;Times New Roman&quot;; font-style:
normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-stretch:
normal; font-size-adjust: none;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font></span></font></font></font></font></font><!--[endif]--><font
  size="2" color="navy" face="Arial"><font face="Arial"><font size="2"><font
  color="navy"><font color="navy">Classes <o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">When
I deploy the app on the tomcat
server, daoConfig is initialized in the ActionServlet class. For
initializing
this config, I have had to supply the exact path name to the config
file rather
than a relative one. This is because I find that File f = new
File(“.”);
sysout f.</font></font></font></font></font><font   face="Arial,sans-serif"
size="2"> </font><font size="2" color="navy"   face="Arial"><font face="Arial"><font
size="2"><font color="navy"><font   color="navy">getCanonicalPath() prints
the TOMCAT_HOME and not the App directory in TOMCAT_HOME as I would
have
expected.<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">I
also find that supplying a relative path
in daoConfig.xml for SQLMapConfig isn’t working. I tried giving the
actual path (instead of the package hierarchy) however even that’s not
working. I get the following exception<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">Caused
by:
com.ibatis.dao.client.DaoException: Error configuring SQL Map.&nbsp; Cause<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">:
java.io.IOException: Could not find
resource E:\ source\Ap<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">p\WEB-INF\src\com\eobone\uam\dblayer\impl\sqlmap\config\SQLMapConfig.xml<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManage<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">r(XmlDaoManagerBuilder.java:127)<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">What
am I doing wrong? Do I need to
configure something in tomcat? Please help.<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy"><o:p>&nbsp;</o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">Thanks!!!<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font>
  <p class="MsoNormal"><font size="2" color="navy" face="Arial"><font   face="Arial"><font
size="2"><font color="navy"><font color="navy">Rashmi<o:p></o:p></font></font></font></font></font></p>
  <font face="Arial,sans-serif" size="2"></font></div>
  <font face="Arial,sans-serif" size="2"></font></blockquote>
</body>
</html>

Mime
View raw message