Can you double check the filenames of the mysql tables against the
names of the tables in your mapped statements.

Since it works in Windows and not in Linux, my bet is that it's a
MySQL issue - i.e., case sensitivity on Linux but not on Windows.

Larry


On 4/24/07, Nuno Rodrigues <[EMAIL PROTECTED]> wrote:




Sorry … When I said jpetstore.PRODUCTS it was jpetstore.ITEM and
jpetstore.CATEGORY.



Nuno



 ________________________________


From: Nuno Rodrigues [mailto:[EMAIL PROTECTED]
 Sent: terça-feira, 24 de Abril de 2007 13:17
 To: [email protected]
 Subject: IBATIS strange problem




Hello all,



I guess that there's a bug in IBATIS but I really don't know where… errr.



These were the steps where I caught the problem:



Configure JPetstore 5 to work in linux + apache tomcat 5.5.20 + MySQL. ( I
have configured it in Windows ant it worked nice )



Open the jpetstore main webpage and click on a category to open the
viewCategory page.



An error will be shown because it can't find the table names. In my case it
was jpetstore.PRODUCTS… This happened because of the Linux case sensitive
issue.



Change the
jpetstore/WEB-INF/classes/com/ibatis/jpetstore/persistence/sqlmapdao/sql/*.xml
files and UPPER CASE the table names.



Restart tomcat, Re-deploy Jpetstore and Go to the viewCategory page again.

  From here I started getting the error:
"org.apache.jasper.JasperException: Define tag cannot set a
null value"



I thought that probably the #categoryid# variable wasn't being filled
correctly and I changed the
jpetstore/WEB-INF/classes/com/ibatis/jpetstore/persistence/sqlmapdao/sql/Category.xml
file.

In this file I've changed





  <select id="getCategory" resultClass="category" parameterClass="string"
cache$

    SELECT

      CATID AS categoryId,

      NAME,

      DESCN AS description

    FROM category

    WHERE CATID = #categoryid#

  </select>



By





  <select id="getCategory" resultClass="category" parameterClass="string"
cache$

    SELECT

      CATID AS categoryId,

      NAME,

      DESCN AS description

    FROM category

    WHERE CATID = 'FISH'

  </select>



Notice that I changed #categoryid# by 'FISH'



At this time the page opens but it doesn't show any products.



Ok, if the problem was in the  #categoryid# parameter I thought that I
should trace the value of this variable. In the JPetstore source code I've
included a System.out.println(""+categoryId) in the getCategory(String
categoryId) method in the
com/ibatis/jpetstore/persistence/sqlmapdao/CategorySqlMapDao.java
file.



I have run the application again and I've seen that the variable categoryId
was correct when the CategorySqlMapDao is executed.



This makes me think that the problem only could be in the Ibatis Framework
since that in the application the variable categoryId is shown correctly but
when it is used in the SQL query defined in the XML file it is a null
variable.



Hope to hear some answer from you.



Cheers,

Nuno








Reply via email to