Pessoal estou com o seguinte erro.
quando subo o servidor o spring fala que nao consegue instanciar os beans.
08:33:25,330 GRAVE [org.springframework.web.context.ContextLoader] (MSC service thread 1-3) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CargoService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private br.org.tcc.dao.Dao br.org.tcc.service.impl.CargoServiceImpl.daoCargo; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [br.org.tcc.dao.Dao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private br.org.tcc.dao.Dao br.org.tcc.service.impl.CargoServiceImpl.daoCargo; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [br.org.tcc.dao.Dao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
application.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd"
default-autowire="byName">
<context:component-scan base-package="br.org.tcc" />
<import resource="spring-context.xml" />
</beans>
context.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"
default-autowire="byName">
<jee:jndi-lookup id="entityManagerFactory" jndi-name="sgp-PU" />
<bean name="txManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
</bean>
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="*" propagation="SUPPORTS" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="defaultServiceOperation"
expression="execution(* br.org.tcc.service.*Service.*(..))" />
<aop:advisor pointcut-ref="defaultServiceOperation"
advice-ref="txAdvice" />
</aop:config>
<bean name="databaseRole" class="java.lang.String">
<constructor-arg>
<value>${database.role}</value>
</constructor-arg>
</bean>
<bean name="databaseRoleEnabled" class="java.lang.Boolean">
<constructor-arg>
<value>${database.role.enabled}</value>
</constructor-arg>
</bean>
</beans>
JPADAO.java
@Repository("dao")
public class JpaDao<T> {
@SuppressWarnings("unused")
private static final long serialVersionUID = 6907111403428623938L;
private Class<T> persistentClass;
@PersistenceContext
private EntityManager entityManager;
@Autowired
private String databaseRole;
@Autowired
private Boolean databaseRoleEnabled;