mybatis with spring

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

mybatis with spring

Bhushan Bhangale
I am using spring-ibatis 2.0.8 (this is the latest available) and this
depends on ibatis 2.3.0. All this works fine. I want to use latest
Mybatis but spring does not support at the moment. Is there anyway I
can use along with spring?

Also I see the lates ibatis is 2.3.4.726 but its gives this error -

Caused by: 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: org.xml.sax.SAXParseException: Document root element
"sqlMap", must match DOCTYPE root "sqlMapConfig".
        at
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:
65)
        at
com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClientBuilder.java:
90)
        at
org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(SqlMapClientFactoryBean.java:
326)
        at
org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(SqlMapClientFactoryBean.java:
280)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
1469)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:
1409)
        ... 82 more
Caused by: 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: org.xml.sax.SAXParseException: Document root element
"sqlMap", must match DOCTYPE root "sqlMapConfig".
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
        at
com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigParser.java:
62)
        ... 87 more
Caused by: java.lang.RuntimeException: Error parsing XPath '/
sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException:
Error parsing XML.  Cause: org.xml.sax.SAXParseException: Document
root element "sqlMap", must match DOCTYPE root "sqlMapConfig".
        at
com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:
123)
        at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
        at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:
102)
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)
        ... 88 more
Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.
Cause: org.xml.sax.SAXParseException: Document root element "sqlMap",
must match DOCTYPE root "sqlMapConfig".
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
        at
com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:
44)
        at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser
$10.process(SqlMapConfigParser.java:257)
        at
com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:
121)
        ... 92 more
Caused by: org.xml.sax.SAXParseException: Document root element
"sqlMap", must match DOCTYPE root "sqlMapConfig".
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at
com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:
189)
        at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:59)
Reply | Threaded
Open this post in threaded view
|

Re: mybatis with spring

Eduardo Macarron
I would say that any of your DTD declarations is wrong. Maybe you are
declaring a sql-map-config-2.dtd istead of sql-map-2.dtd on any sqlmap
xml file?

BTW you can download and build MyBatis 3 Spring integration from svn.
http://code.google.com/p/mybatis/source/browse/#svn/sub-projects/mybatis-spring/trunk/

cheers!

On 8 sep, 06:14, Bhushan <[hidden email]> wrote:

> I am using spring-ibatis 2.0.8 (this is the latest available) and this
> depends on ibatis 2.3.0. All this works fine. I want to use latest
> Mybatis but spring does not support at the moment. Is there anyway I
> can use along with spring?
>
> Also I see the lates ibatis is 2.3.4.726 but its gives this error -
>
> Caused by: 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: org.xml.sax.SAXParseException: Document root element
> "sqlMap", must match DOCTYPE root "sqlMapConfig".
>         at
> com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigP arser.java:
> 65)
>         at
> com.ibatis.sqlmap.client.SqlMapClientBuilder.buildSqlMapClient(SqlMapClient Builder.java:
> 90)
>         at
> org.springframework.orm.ibatis.SqlMapClientFactoryBean.buildSqlMapClient(Sq lMapClientFactoryBean.java:
> 326)
>         at
> org.springframework.orm.ibatis.SqlMapClientFactoryBean.afterPropertiesSet(S qlMapClientFactoryBean.java:
> 280)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor y.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:
> 1469)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor y.initializeBean(AbstractAutowireCapableBeanFactory.java:
> 1409)
>         ... 82 more
> Caused by: 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: org.xml.sax.SAXParseException: Document root element
> "sqlMap", must match DOCTYPE root "sqlMapConfig".
>         at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
>         at
> com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.parse(SqlMapConfigP arser.java:
> 62)
>         ... 87 more
> Caused by: java.lang.RuntimeException: Error parsing XPath '/
> sqlMapConfig/sqlMap'.  Cause: com.ibatis.common.xml.NodeletException:
> Error parsing XML.  Cause: org.xml.sax.SAXParseException: Document
> root element "sqlMap", must match DOCTYPE root "sqlMapConfig".
>         at
> com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:
> 123)
>         at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:84)
>         at com.ibatis.common.xml.NodeletParser.process(NodeletParser.java:
> 102)
>         at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:72)
>         at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:60)
>         ... 88 more
> Caused by: com.ibatis.common.xml.NodeletException: Error parsing XML.
> Cause: org.xml.sax.SAXParseException: Document root element "sqlMap",
> must match DOCTYPE root "sqlMapConfig".
>         at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:62)
>         at
> com.ibatis.sqlmap.engine.builder.xml.SqlMapParser.parse(SqlMapParser.java:
> 44)
>         at com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser
> $10.process(SqlMapConfigParser.java:257)
>         at
> com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:
> 121)
>         ... 92 more
> Caused by: org.xml.sax.SAXParseException: Document root element
> "sqlMap", must match DOCTYPE root "sqlMapConfig".
>         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
>         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
>         at
> com.ibatis.common.xml.NodeletParser.createDocument(NodeletParser.java:
> 189)
>         at com.ibatis.common.xml.NodeletParser.parse(NodeletParser.java:59)