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 theres a bug in IBATIS but I really dont 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 cant 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/*.x ml 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 wasnt being filled correctly and I changed the jpetstore/WEB-INF/classes/com/ibatis/jpetstore/persistence/sqlmapdao/sql/Cat egory.xml file. In this file Ive 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 doesnt 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 Ive 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 Ive 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
