Using iBATIS, generated DAOs, beans, and _SqlMap.xml files.

My abatorConfig.xml includes:

<javaModelGenerator targetPackage="com.base.domain.model"
targetProject="JPS"/>
<sqlMapGenerator targetPackage="com.base.dao.ibatis" targetProject="JPS"/>
<daoGenerator type="SPRING" targetPackage="com.base.dao"
targetProject="JPS"/>

I also have a persistance.ibatis.xml where my sqlmap and DAOs are
configured:

<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClient
FactoryBean">
<property name="configLocation" value="classpath:sqlMapConfig.xml"/>
<property name="dataSource" ref="dataSource"/>
</bean>

<bean id="lookupTableDAO" class="com.base.dao.LookupTableDAO">
        <property name="sqlMapClient" ref="sqlMapClient"/>              
</bean>


but it seems the WebApp can't find this file or is not using it.

I also have a sqlMapConfig.xml file that lists the sqlmap files:

<sqlMap resource="com/base/dao/ibatis/OBJECTIDS_SqlMap.xml"/>

I don't have a dao.xml like an iBATIS document suggests. 

I've declared the DAO in a SpringWebApplication like so:

        @SpringBean private LookupTableDAO ltDAO;

But I get the following error on deploying the WebApp:

17:58:31,025 ERROR [[/LBS]] StandardWrapper.Throwable
java.lang.IllegalStateException: bean of type [com.base.dao.LookupTableDAO]
not found
        at
org.apache.wicket.spring.SpringBeanLocator.getBeanNameOfClass(SpringBeanLocator.java:107)
        at
org.apache.wicket.spring.SpringBeanLocator.getBeanName(SpringBeanLocator.java:192)
        at
org.apache.wicket.spring.SpringBeanLocator.isSingletonBean(SpringBeanLocator.java:133)
        at
org.apache.wicket.spring.injection.annot.AnnotProxyFieldValueFactory.getFieldValue(AnnotProxyFieldValueFactory.java:91)
        at org.apache.wicket.injection.Injector.inject(Injector.java:108)
        at
org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39)
        at
com.ppaworld.lbs.base.web.localization.DatabaseResourceLoader.<init>(DatabaseResourceLoader.java:16)
        at com.ppaworld.lbs.base.LBSApplication.init(LBSApplication.java:102)
        at 
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:514)
        at
org.apache.wicket.protocol.http.WicketServlet.init(WicketServlet.java:148)
        at javax.servlet.GenericServlet.init(GenericServlet.java:215)
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1053)
        at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:955)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4051)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4354)
        at
org.apache.geronimo.tomcat.GeronimoStandardContext.access$201(GeronimoStandardContext.java:63)
        at
org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:398)
        at
org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
        at
org.apache.geronimo.tomcat.GeronimoStandardContext.start(GeronimoStandardContext.java:251)
        at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at
org.apache.geronimo.tomcat.TomcatContainer.addContext(TomcatContainer.java:364)
        at
org.apache.geronimo.tomcat.TomcatWebAppContext.doStart(TomcatWebAppContext.java:512)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.createInstance(GBeanInstance.java:998)
        at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:268)
        at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.start(GBeanInstance.java:541)
        at
org.apache.geronimo.gbean.runtime.GBeanDependency.attemptFullStart(GBeanDependency.java:111)
        at
org.apache.geronimo.gbean.runtime.GBeanDependency.addTarget(GBeanDependency.java:146)
        at
org.apache.geronimo.gbean.runtime.GBeanDependency$1.running(GBeanDependency.java:120)
        at
org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.fireRunningEvent(BasicLifecycleMonitor.java:176)
        at
org.apache.geronimo.kernel.basic.BasicLifecycleMonitor.access$300(BasicLifecycleMonitor.java:44)
        at
org.apache.geronimo.kernel.basic.BasicLifecycleMonitor$RawLifecycleBroadcaster.fireRunningEvent(BasicLifecycleMonitor.java:254)
        at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.attemptFullStart(GBeanInstanceState.java:294)
        at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.start(GBeanInstanceState.java:102)
        at
org.apache.geronimo.gbean.runtime.GBeanInstanceState.startRecursive(GBeanInstanceState.java:124)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.startRecursive(GBeanInstance.java:555)
        at
org.apache.geronimo.kernel.basic.BasicKernel.startRecursiveGBean(BasicKernel.java:379)
        at
org.apache.geronimo.kernel.config.ConfigurationUtil.startConfigurationGBeans(ConfigurationUtil.java:456)
        at
org.apache.geronimo.kernel.config.KernelConfigurationManager.start(KernelConfigurationManager.java:188)
        at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:562)
        at
org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConfiguration(SimpleConfigurationManager.java:543)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at
org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
        at
org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at
org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832)
        at 
org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
        at
org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
        at
org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
        at
org.apache.geronimo.gbean.GBeanLifecycle$$EnhancerByCGLIB$$3fdff422.startConfiguration(<generated>)
        at
org.apache.geronimo.deployment.plugin.local.StartCommand.run(StartCommand.java:67)
        at java.lang.Thread.run(Unknown Source)


How does my web application know where to find the DAOs??

-- 
View this message in context: 
http://www.nabble.com/How-does-a-web-application-using-iBATIS-find-the-DAOs---...pls-help...its-urgent-tp21856541p21856541.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

Reply via email to