org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'login' defined in file [E:\Java\tomcat\tomcat6\webapps\copycode\WEB-INF\classes\applicationContext.xml]: Cannot resolve reference to bean 'LoginService' while setting bean property 'LoginService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'LoginService' defined in file [E:\Java\tomcat\tomcat6\webapps\copycode\WEB-INF\classes\applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.copycode.service.LoginService]: Specified class is an interface
[applicationContext.XML]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<!-- action -->
<bean id="login" class="com.copycode.action.LoginAction">
<property name="LoginService" ref="LoginService"></property>
</bean>
<!-- service -->
<bean id="LoginService" class="com.copycode.service.LoginService">
<property name="LoginDao" ref="LoginDao"></property>
</bean>
<!-- dao -->
<bean id="LoginDao" class="com.copycode.dao.LoginDao">
</bean>
</beans>
不知道怎么搞的
[applicationContext.XML]
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> <bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<!-- action -->
<bean id="login" class="com.copycode.action.LoginAction">
<property name="LoginService" ref="LoginService"></property>
</bean>
<!-- service -->
<bean id="LoginService" class="com.copycode.service.LoginService">
<property name="LoginDao" ref="LoginDao"></property>
</bean>
<!-- dao -->
<bean id="LoginDao" class="com.copycode.dao.LoginDao">
</bean>
</beans>
不知道怎么搞的
解决方案 »
- spring事务管理不会回滚
- AJAX怎么捕获到异常
- 急急急!!!javax.naming.NameNotFoundException: ... not bound
- 请教一个问题
- strtus問題
- No ResultSet set was produced.
- [100分]在CMP中如何,在一个find中如何得到表数据记录中主键(整形)为最大值那条记录对应ejb对象,EJB QL该如何写?????
- 请教struts中参数传递的问题
- 请问bmp和gif格式有什么区别?
- 散分先!大家进来讨论一下!
- 什么是僵尸线程??
- 为什么JSTL里的<c:import>标签引入同服务器下不同站台下的页面时总是会有这样的错误?
com.copycode.service.LoginService这里需要使用实体类。
<bean id="login" class="com.copycode.action.LoginAction">
<property name="LoginService" ref="LoginService"></property>
</bean>
改Id为name
LoginAction这个是接口吧
class要指定到LoginAction这个接口的实现类