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: Resource not found exception
Date Thu, 02 Mar 2006 15:59:14 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">Radha,<br>
<br>
Resource doesn't work well inside jar or war file. Please see previous
post on this issue for fix.<br>
<br>
Tony<br>
<br>
<span type="cite">radha rukmani wrote on 3/2/2006, 10:53 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><font face="Arial,sans-serif" size="2">Hi,</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">&nbsp;</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">I have an application
developed in eclipse using ibatis which runs correctly. When i tried to
jar this application(using the eclipse jar utility)&nbsp;and run it from a
batch file, it throws me an exception saying that my resource is not
found.&nbsp; This is the error message</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">&nbsp;</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">2006-03-02 10:46:37,237
DEBUG [main] dao.ConfigData&nbsp;&nbsp;&nbsp; (ConfigData.java:243)<br>
&nbsp;- Found config/GeCABatchProcess.ini - loading configuration<br>
java.io.IOException: Could not find resource
com\comp\drimm\FERTPlateTransfer\<br>
xml\sqlMapConfig.xml<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j<br>
ava:101)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.common.resources.Resources.getResourceAsStream(Resources.j<br>
ava:86)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.ibatis.common.resources.Resources.getResourceAsReader(Resources.j<br>
ava:150)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at
com.comp.drimm.FERTPlateTransfer.AppSqlConfig.&lt;clinit&gt;(AppSqlConfig<br>
.java:18)</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">&nbsp;</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">This is how i am calling
the resource in the AppSqlConfig.java</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">&nbsp;&nbsp;&nbsp;String
resource="com\\comp\\drimm\\FERTPlateTransfer\\xml\\sqlMapConfig.xml";<br>
&nbsp;&nbsp;&nbsp;Reader reader=Resources.getResourceAsReader(resource);</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">&nbsp;</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">This works fine when i
run in eclipse, could any one please let me know why it is not working
when i call it from the batch file.</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">&nbsp;</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">This is my .bat file</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">set rootpath=.\SignedJars</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">set
Classpath=%Classpath%;%rootpath%\FERTPlateTransfer.jar<br>
echo %Classpath%<br>
pause</font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">"C:\Program
Files\Java\j2re1.4.2_01\bin\java"
com.comp.drimm.FERTPlateTransfer.GeCABatchProcessMain </font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">pause<br>
  </font></div>
  <font face="Arial,sans-serif" size="2"> </font>
  <div><font face="Arial,sans-serif" size="2">Thanks.</font></div>
  <p><font face="Arial,sans-serif" size="2"> </font></p>
  <hr size="1"><font face="Arial,sans-serif" size="2">Brings words and
photos together (easily) with<br>
  <a  href="http://us.rd.yahoo.com/mail_us/taglines/PMall/*http://photomail.mail.yahoo.com">PhotoMail
  </a> - it's free and works with Yahoo! Mail.
  </font></blockquote>
</body>
</html>


Mime
View raw message