ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikael Andersson" <mail.mi...@gmail.com>
Subject Re: Usage of namespace and select ids
Date Wed, 21 Mar 2007 18:38:03 GMT
Sorry for that question, quick search through the PDF manual revealed that
statement namespaces needs to be enabled.


On 21/03/07, Mikael Andersson <mail.micke@gmail.com> wrote:
>
> Hi,
> I have yet another beginner question.
>
> Can I have the same select id in multiple sqlMap XML files?
>
> Currently I have two sqlMap XML files, which are specifying namespace
> (generated by Abator, with custom stuff added to them), with the same select
> id in both files.
> When invoking a query in the DAO I use the NAMESPACE.ID notation.
>
> I get this error: There is already a statement named selectAll in this
> SqlMap
>
> org.springframework.beans.factory.BeanCreationException : Error creating
> bean with name 'sqlMapClient' defined in class path resource [
> spring-referencedata-test.xml]: Initialization of bean failed; nested
> exception is java.lang.RuntimeException: Error occurred.  Cause:
> com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
> java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
> Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
> java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'.  Cause:
> com.ibatis.sqlmap.client.SqlMapException: There is already a statement
> named selectAll in this SqlMap.
> java.lang.RuntimeException: Error occurred.  Cause:
> com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
> java.lang.RuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap'.
> Cause: com.ibatis.common.xml.NodeletException: Error parsing XML.  Cause:
> java.lang.RuntimeException: Error parsing XPath '/sqlMap/select'.  Cause:
> com.ibatis.sqlmap.client.SqlMapException: There is already a statement
> named selectAll in this SqlMap.
>     at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse (
> SqlMapConfigParser.java:89)
>     at com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(
> SqlMapClientBuilder.java:63)
>     at
> org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(
> SqlMapClientFactoryBean.java :258)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods
> (AbstractAutowireCapableBeanFactory.java:1091)
>     at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(
> AbstractAutowireCapableBeanFactory.java:396)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(
> AbstractBeanFactory.java:233)
>     at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean (
> AbstractBeanFactory.java:145)
>     at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons
> (DefaultListableBeanFactory.java:277)
>     at
> org.springframework.context.support.AbstractApplicationContext.refresh (
> AbstractApplicationContext.java:313)
>     at org.springframework.context.support.ClassPathXmlApplicationContext
> .<init>(ClassPathXmlApplicationContext.java:87)
>     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(
> ClassPathXmlApplicationContext.java:72)
>
> Cheers,
>  Mike
>

Mime
View raw message