MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » spring+ibatis+struts的一个小东西,出了个错,烦劳

spring+ibatis+struts的一个小东西,出了个错,烦劳大家看看(2)

www.MyException.Cn  网友分享于:2013-11-28  浏览:279次

this.questionsDao   =   questionsDao;
}

public   int   getQuestionsCount()   throws   Exception{
return   questionsDao.getQuestionsCount();
}
}


ManagerServiceFacade文件:
public   class   ManagerServiceFacade   {
private   ManagerServiceImpl   managerServiceImpl;

public   ManagerServiceImpl   getManagerServiceImpl()   {
return   managerServiceImpl;
}

public   void   setManagerServiceImpl(ManagerServiceImpl      
                                                                                managerServiceImpl)   {
this.managerServiceImpl   =   managerServiceImpl;
}
}

就这些。

找了很多文章看了也没搞定这个问题,初学,多多指教。

------解决方案--------------------
ClassNotFoundException
没有找到你的bean啊,应该是路径方面的问题,看看xml中的配置吧
------解决方案--------------------
questionsDao生成的时候不需要任何注入吗?
questionsDao应该是访问数据库吧,至少应该有dataSource,sessionFactory
<bean id= "dataSource "
class= "org.springframework.jdbc.datasource.DriverManagerDataSource "
abstract= "false " singleton= "true " lazy-init= "default "
autowire= "default " dependency-check= "default ">
<property name= "driverClassName "
value= "com.microsoft.jdbc.sqlserver.SQLServerDriver ">
</property>
<property name= "url "
value= "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=gwdhs ">
</property>
<property name= "username " value= "sa "> </property>
<property name= "password " value= " "> </property>
</bean>
<bean
class= "org.springframework.orm.hibernate3.LocalSessionFactoryBean "
id= "sessionFactory " singleton= "true " abstract= "false "
autowire= "default " dependency-check= "default " lazy-init= "default ">
<property name= "dataSource ">
<ref bean= "dataSource " />
</property>

<property name= "hibernateProperties ">
<props>
<prop key= "hibernate.dialect ">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name= "mappingResources ">
<list>
<value> hibernate/po/GwdUser.hbm.xml </value>
</list>
</property>
</bean>
<bean id= "gwdCjDao " class= "hibernate.dao.GwdCjDaoImp ">
<property name= "sessionFactory ">
<ref bean= "sessionFactory "/>
</property>
</bean>
连sqlserver的,借鉴一下
------解决方案--------------------
你的ibatis文件 好像也有错
------解决方案--------------------
可以把typeAlias去掉试一下,呵呵
------解决方案--------------------
ibatis配置文件中的resultMap配置有错~~

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有