vscarpenter
Sep 24th, 2004, 04:56 PM
Hi everyone. I am wondering if anyone is having any success using the Spring DAO framework with the latest release of iBATIS 2.0.6? I am starting out small with a pretty vanilla example. Here are the appropriate snippets from the descriptors.
applicationContext.xml
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jdbc/myDS</value>
</property>
</bean>
<bean id="sqlMap" class="org.springframework.orm.ibatis.SqlMapFactoryBean">
<property name="configLocation"><value>WEB-INF/SqlMapConfig.xml</value></property>
</bean>
SqlMapConfig.xml
<sqlMapConfig>
<sqlMap resource="com/j2eegeek/ibatis/dao/maps/User.xml"/>
</sqlMapConfig>
On deploy, I get the following error and stacktrace
ERROR [ExecuteThread: '1' for queue: 'weblogic.kernel.System'] - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sqlMap' defined in resource [/WEB-INF/applic
ationContext.xml] of ServletContext: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/ibatis/d
b/sqlmap/XmlSqlMapBuilder
java.lang.NoClassDefFoundError: com/ibatis/db/sqlmap/XmlSqlMapBuilder
at org.springframework.orm.ibatis.SqlMapFactoryBean.a fterPropertiesSet(SqlMapFactoryBean.java:75)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBea
nFactory.java:991)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactor
y.java:288)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactor
y.java:208)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:204)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:136)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.
java:224)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:284)
Now I am not even using the XML output feature of iBATIS but I am still getting a NoClassDefFoundError on XmlSqlMapBuilder. Any ideas before I download the source and start digging? Thanks
--Vinny
http://www.j2eegeek.com/blog/
applicationContext.xml
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jdbc/myDS</value>
</property>
</bean>
<bean id="sqlMap" class="org.springframework.orm.ibatis.SqlMapFactoryBean">
<property name="configLocation"><value>WEB-INF/SqlMapConfig.xml</value></property>
</bean>
SqlMapConfig.xml
<sqlMapConfig>
<sqlMap resource="com/j2eegeek/ibatis/dao/maps/User.xml"/>
</sqlMapConfig>
On deploy, I get the following error and stacktrace
ERROR [ExecuteThread: '1' for queue: 'weblogic.kernel.System'] - Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'sqlMap' defined in resource [/WEB-INF/applic
ationContext.xml] of ServletContext: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: com/ibatis/d
b/sqlmap/XmlSqlMapBuilder
java.lang.NoClassDefFoundError: com/ibatis/db/sqlmap/XmlSqlMapBuilder
at org.springframework.orm.ibatis.SqlMapFactoryBean.a fterPropertiesSet(SqlMapFactoryBean.java:75)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBea
nFactory.java:991)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactor
y.java:288)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactor
y.java:208)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:204)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:136)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.
java:224)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:284)
Now I am not even using the XML output feature of iBATIS but I am still getting a NoClassDefFoundError on XmlSqlMapBuilder. Any ideas before I download the source and start digging? Thanks
--Vinny
http://www.j2eegeek.com/blog/