You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Gainty <mg...@hotmail.com> on 2006/10/28 22:09:48 UTC

spring jpetstore demo error (possibly O/T)

Has anyone encountered this error with the spring jpetstore sample and know the solution?org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in org/springframework/samples/jpetstore/dao/ibatis/maps/Category.xml.  
--- The error occurred while executing query.  
--- Check the      select catid,name,descn from category where catid = 'dog'    .  
--- Check the SQL Statement (preparation failed).  
Many Thanks,Martin --This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
contents

Re: spring jpetstore demo error (possibly O/T)

Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Larry-

the stack gets as far as
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:171)

/************here is the SqlMapClientTenplate.java**********************/
 public Object execute(SqlMapClientCallback action) throws DataAccessException {
  Assert.notNull(this.sqlMapClient, "No SqlMapClient specified");
  // We always needs to use a SqlMapSession, as we need to pass a Spring-managed
  // Connection (potentially transactional) in. This shouldn't be necessary if
  // we run against a TransactionAwareDataSourceProxy underneath, but unfortunately
  // we still need it to make iBATIS batch execution work properly: If iBATIS
  // doesn't recognize an existing transaction, it automatically executes the
  // batch for every single statement...

  SqlMapSession session = this.sqlMapClient.openSession(); //ok!
  try {
   Connection con = DataSourceUtils.getConnection(getDataSource()); //ok!
   try {
    session.setUserConnection(con); //OK!
    return action.doInSqlMapClient(session); //woops!
   }
   catch (SQLException ex) {
    throw getExceptionTranslator().translate("SqlMapClient operation", null, ex);
   }

/****meanwhile in SqlMapClientCallback.java there is the declaration for method doInSqlMapClient within SqlMapClientCallback.java***/
Object doInSqlMapClient(com.ibatis.sqlmap.client.SqlMapExecutor executor) throws SQLException;

/******* not much can go wrong here except of course if the SqlMapExecutor object is not properly constructed **********/
/******I'll try to ping the ibatis folks as there is an error with the construction of the SqlMapExecutor and look at that constructor***/

Ideas?
M-

This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
contents
----- Original Message ----- 
From: "Larry Meadors" <lm...@apache.org>
To: "Struts Users Mailing List" <us...@struts.apache.org>; "Martin Gainty" <mg...@hotmail.com>
Sent: Saturday, October 28, 2006 10:46 PM
Subject: Re: spring jpetstore demo error (possibly O/T)


> Not sure if there is a typo in your email or if your copy of the
> Category.xml file somehow got buggered up, but there is a trailing "."
> on the select statement there. That would make it puke, but like I
> said, I am not positive that that is the real problem, or just a weird
> typo. Can you check it and let use know?
> 
> Larry
> 
> 
> On 10/28/06, Martin Gainty <mg...@hotmail.com> wrote:
>> Has anyone encountered this error with the spring jpetstore sample and know the solution?org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
>> --- The error occurred in org/springframework/samples/jpetstore/dao/ibatis/maps/Category.xml.
>> --- The error occurred while executing query.
>> --- Check the      select catid,name,descn from category where catid = 'dog'    .
>> --- Check the SQL Statement (preparation failed).
>> Many Thanks,Martin --This e-mail communication and any attachments may contain confidential and privileged information for the use of the
>> designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
>> this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its
>> contents
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

Re: spring jpetstore demo error (possibly O/T)

Posted by Martin Gainty <mg...@hotmail.com>.
Information in this message, including attachments, is intended only for the confidential use of the recipient(s) named 
above. This message may be an Attorney-Client communication and as such is privileged and confidential. 
If you are not an intended recipient of this message, or an agent responsible for delivering it to an intended recipient
, you are hereby notified that you have received this message in error, that any review, dissemination, distribution, 
or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender
immediately, delete the message, and return any hard copy print-outs.
This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
conte
----- Original Message ----- 
From: "Larry Meadors" <lm...@apache.org>
To: "Struts Users Mailing List" <us...@struts.apache.org>; "Martin Gainty" <mg...@hotmail.com>
Sent: Saturday, October 28, 2006 10:46 PM
Subject: Re: spring jpetstore demo error (possibly O/T)


> Not sure if there is a typo in your email or if your copy of the
> Category.xml file somehow got buggered up, but there is a trailing "."
> on the select statement there. That would make it puke, but like I
> said, I am not positive that that is the real problem, or just a weird
> typo. Can you check it and let use know?
> 
> Larry
> 
> 
> On 10/28/06, Martin Gainty <mg...@hotmail.com> wrote:
>> Has anyone encountered this error with the spring jpetstore sample and know the solution?org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
>> --- The error occurred in org/springframework/samples/jpetstore/dao/ibatis/maps/Category.xml.
>> --- The error occurred while executing query.
>> --- Check the      select catid,name,descn from category where catid = 'dog'    .
>> --- Check the SQL Statement (preparation failed).
>> Many Thanks,Martin --This e-mail communication and any attachments may contain confidential and privileged information for the use of the
>> designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
>> this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its
>> contents
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

Re: spring jpetstore demo error (possibly O/T)

Posted by Larry Meadors <lm...@apache.org>.
Not sure if there is a typo in your email or if your copy of the
Category.xml file somehow got buggered up, but there is a trailing "."
on the select statement there. That would make it puke, but like I
said, I am not positive that that is the real problem, or just a weird
typo. Can you check it and let use know?

Larry


On 10/28/06, Martin Gainty <mg...@hotmail.com> wrote:
> Has anyone encountered this error with the spring jpetstore sample and know the solution?org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; bad SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in org/springframework/samples/jpetstore/dao/ibatis/maps/Category.xml.
> --- The error occurred while executing query.
> --- Check the      select catid,name,descn from category where catid = 'dog'    .
> --- Check the SQL Statement (preparation failed).
> Many Thanks,Martin --This e-mail communication and any attachments may contain confidential and privileged information for the use of the
> designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
> this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its
> contents
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org