Org.springframework.beans.factory.UnsatisfiedDependencyException[RESOLVIDO]

Pessoal estou com o seguinte problema e não estou sabendo resolver, já pesquisei e não encontrei uma possível solução. Se alguem puder ajudar, agradeço.

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'situacaoMoradiaController' defined in file [E:\Workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\BIS.Web\WEB-INF\classes\controller\SituacaoMoradiaController.class]: Unsatisfied dependency expressed through constructor argument with index 5 of type [applicationInterfaces.ISituacaoMoradiaApplication]: : No matching bean of type [applicationInterfaces.ISituacaoMoradiaApplication] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [applicationInterfaces.ISituacaoMoradiaApplication] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
	org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:698)
	org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
	org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)
	org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
	org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
	br.com.caelum.vraptor.ioc.spring.VRaptorApplicationContext.getBean(VRaptorApplicationContext.java:259)
	br.com.caelum.vraptor.ioc.spring.SpringBasedContainer.instanceFor(SpringBasedContainer.java:59)
	br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:41)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.util.hibernate.HibernateTransactionInterceptor.intercept(HibernateTransactionInterceptor.java:45)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:44)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:81)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70)
	br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92)
	br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56)
	br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89)

root cause

org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [applicationInterfaces.ISituacaoMoradiaApplication] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
	org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:896)
	org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:765)
	org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:680)
	org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:771)
	org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:691)
	org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:192)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)
	org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
	org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)
	org.springframework.web.context.request.AbstractRequestAttributesScope.get(AbstractRequestAttributesScope.java:43)
	org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
	org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
	org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1004)
	br.com.caelum.vraptor.ioc.spring.VRaptorApplicationContext.getBean(VRaptorApplicationContext.java:259)
	br.com.caelum.vraptor.ioc.spring.SpringBasedContainer.instanceFor(SpringBasedContainer.java:59)
	br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:41)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.util.hibernate.HibernateTransactionInterceptor.intercept(HibernateTransactionInterceptor.java:45)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:44)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:81)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:67)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:54)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:56)
	br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:53)
	br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:70)
	br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:92)
	br.com.caelum.vraptor.ioc.spring.SpringProvider.provideForRequest(SpringProvider.java:56)
	br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:89)

O erro informa que ele não consegue criar o bean: SituacaoMoradiaController. Pelo que entendi é porque você está tentando injetar esse outro bean: ISituacaoMoradiaApplication, mas o Spring não está encontrando ele.
Posta as classes envolvidas no erro para a gente ver.

package applicationInterfaces;

import java.util.*;
import org.hibernate.criterion.DetachedCriteria;
import messageBase.RequestAction;
import businessObjects.SituacaoMoradia;

public interface ISituacaoMoradiaApplication{

	Set<String> salvarSituacaoMoradia(SituacaoMoradia situacaomoradia, RequestAction requestAction);

	String excluirSituacaoMoradia(Object id);

	String excluirSituacaoMoradia(SituacaoMoradia situacaomoradia);

	SituacaoMoradia obterSituacaoMoradia(DetachedCriteria criteria);

	SituacaoMoradia obterSituacaoMoradia(Object id);

	Set<SituacaoMoradia> listarSituacaoMoradia(DetachedCriteria criteria);

	Set<SituacaoMoradia> todosSituacaoMoradia();
}
package applicationImplementations;

import java.util.*;
import org.hibernate.criterion.*;
import org.hibernate.exception.*;
import repositoryInterfaces.ISituacaoMoradiaRepository;
import messageBase.RequestAction;
import applicationInterfaces.ISituacaoMoradiaApplication;
import businessObjects.SituacaoMoradia;


public class SituacaoMoradiaApplication implements ISituacaoMoradiaApplication {

	private final ISituacaoMoradiaRepository SituacaoMoradiaRepository;

	public SituacaoMoradiaApplication(ISituacaoMoradiaRepository SituacaoMoradiaRepository){
		this.SituacaoMoradiaRepository = SituacaoMoradiaRepository;
	}

	public Set<String> salvarSituacaoMoradia(SituacaoMoradia situacaomoradia, RequestAction requestAction){
		Set<String> erros = SituacaoMoradiaRepository.validate(situacaomoradia);
		try{
			if(requestAction == RequestAction.create){
				SituacaoMoradiaRepository.save(situacaomoradia);
			}else if(requestAction == RequestAction.update){
				SituacaoMoradiaRepository.update(situacaomoradia);
			}
		}
		catch (javax.validation.ConstraintViolationException e) {
			for (javax.validation.ConstraintViolation<?> violation : e.getConstraintViolations()) {
				erros.add(violation.getMessage());
			}
		}
		catch(Exception ex){
				erros.add(ex.getMessage());
				ex.printStackTrace();
		}
		return erros;
	}


	public String excluirSituacaoMoradia(Object id){
		String erro = null;
		try{
			SituacaoMoradia situacaomoradia = SituacaoMoradiaRepository.single(id);
			SituacaoMoradiaRepository.delete(situacaomoradia);
		}
		catch(ConstraintViolationException ex){
			erro  ="Este registro não pode ser excluído. Ele faz referência em outro registro.";
			ex.printStackTrace();
		}
		catch(Exception ex){
			erro = ex.getMessage();
			ex.printStackTrace();
		}
		return erro;
	}


	public String excluirSituacaoMoradia(SituacaoMoradia situacaomoradia){
		String erro = null;
		try{
			SituacaoMoradiaRepository.delete(situacaomoradia);
		}
		catch(ConstraintViolationException ex){
			erro  ="Este registro não pode ser excluído. Ele faz referência em outro registro.";
			ex.printStackTrace();
		}
		catch(Exception ex){
			erro = ex.getMessage();
			ex.printStackTrace();
		}
		return erro;
	}


	public SituacaoMoradia obterSituacaoMoradia(DetachedCriteria criteria){
		return SituacaoMoradiaRepository.single(criteria);
	}


	public SituacaoMoradia obterSituacaoMoradia(Object id){
		return SituacaoMoradiaRepository.single(id);
	}


	public Set<SituacaoMoradia> listarSituacaoMoradia(DetachedCriteria criteria){
		return SituacaoMoradiaRepository.find(criteria);
	}


	public Set<SituacaoMoradia> todosSituacaoMoradia(){
		DetachedCriteria criteria = DetachedCriteria.forClass(SituacaoMoradia.class);
		return SituacaoMoradiaRepository.find(criteria);
	}
}
package controller;

import helper.MessageJson;

import java.util.Set;

import messageBase.RequestAction;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import applicationInterfaces.IAbastecimentoAguaApplication;
import applicationInterfaces.IDestinacaoDejetosApplication;
import applicationInterfaces.IDestinoLixoApplication;
import applicationInterfaces.ISituacaoMoradiaApplication;
import applicationInterfaces.ITipoCasaApplication;
import applicationInterfaces.ITratamentoAguaApplication;
import br.com.caelum.vraptor.Get;
import br.com.caelum.vraptor.Post;
import br.com.caelum.vraptor.Resource;
import br.com.caelum.vraptor.Result;
import br.com.caelum.vraptor.Validator;
import br.com.caelum.vraptor.view.Results;
import businessObjects.SituacaoMoradia;

@Resource
public class SituacaoMoradiaController {
	
	private ISituacaoMoradiaApplication situacaoMoradiaApplication;
	private ITipoCasaApplication tipoCasaApplication;
	private IDestinoLixoApplication destinoLixoApplication;
	private ITratamentoAguaApplication tratamentoAguaApplication;
	private IDestinacaoDejetosApplication destinoDejetosApplication;
	private IAbastecimentoAguaApplication abastecimentoAguaApplication;	
	private Result result;
	private Validator validator;

	

	public SituacaoMoradiaController(
			ISituacaoMoradiaApplication situacaoMoradiaApplication,
			ITipoCasaApplication tipoCasaApplication,
			IDestinoLixoApplication destinoLixoApplication,
			ITratamentoAguaApplication tratamentoAguaApplication,
			IDestinacaoDejetosApplication destinoDejetosApplication,
			IAbastecimentoAguaApplication abastecimentoAguaApplication,
			Result result, Validator validator) {
		this.situacaoMoradiaApplication = situacaoMoradiaApplication;
		this.tipoCasaApplication = tipoCasaApplication;
		this.destinoLixoApplication = destinoLixoApplication;
		this.tratamentoAguaApplication = tratamentoAguaApplication;
		this.destinoDejetosApplication = destinoDejetosApplication;
		this.abastecimentoAguaApplication = abastecimentoAguaApplication;
		this.result = result;
		this.validator = validator;
	}

	public void index() {
		result.include("tiposCasaList",tipoCasaApplication.todosTipoCasa());
		result.include("destinoLixoList", destinoLixoApplication.todosDestinoLixo());
		result.include("tratamentoAguaList", tratamentoAguaApplication.todosTratamentoAgua());
		result.include("destinoDejetosList", destinoDejetosApplication.todosDestinacaoDejetos());
		result.include("abastecimentoAguaList", abastecimentoAguaApplication.todosAbastecimentoAgua());
	}	
	
	@Post
	public void formulario(SituacaoMoradia situacaoMoradia){
		
		validator.validate(situacaoMoradia);
		
		validator.onErrorForwardTo(TemplateController.class).erros();
		
		RequestAction requestionAction = verificaAcao(situacaoMoradia);
		
		Set<String> erro = situacaoMoradiaApplication.salvarSituacaoMoradia(situacaoMoradia, requestionAction);
				
		if(erro != null){
			 result.use(Results.json()).from(new MessageJson(erro, "error")).serialize();
		}
		else{
			result.use(Results.json()).from(new MessageJson("Situação da Moradia salva com sucesso", "success")).serialize();
			
		}
	}
	
	@Get
	public SituacaoMoradia formulario(Integer id) {
		
		DetachedCriteria criteria = DetachedCriteria.forClass(SituacaoMoradia.class);
		SituacaoMoradia situacaoMoradia = situacaoMoradiaApplication.obterSituacaoMoradia(criteria.add(Restrictions.idEq(id)));
		return situacaoMoradia;
	}
	
	public RequestAction verificaAcao(SituacaoMoradia situacaoMoradia){
		if(situacaoMoradia.getIdSituacaoMoradia() == null || situacaoMoradia.getIdSituacaoMoradia()== 0){
			return RequestAction.create;
		}else{
			return RequestAction.update;
		}
	}
}

Esse erro acontece quando inicializo o ISituacaoMoradiaApplication no contrutor porém com as outras funciona normalmente.

Tem certeza que se você tirar ela do escopo da classe SituacaoMoradiaController as outras não dão erro?

O que tá estranho é que você está tentando injetar sem anotar os atributos ou o construtor da classe SituacaoMoradiaController.

Nunca usei VRpator, talvez seja assim mesmo como você está fazendo. Se for não sei qual o problema.

Se fosse só Spring, faltaria as anotações para a injeção de dependencia e teria que anotar também as classes que seriam injetadas.

Bom pessoal não havia problema algum com minhas classes, apenas concluindo o meu tópico, o erro que estava ocorrendo era apenas porque no meu CustomProvider a SituacaoMoradiaApplication e SituacaoMoradiaRepository não estavam registradas.

O VRaptor possui alguns componentes opcionais, que estão no pacote br.com.caelum.vraptor.util, que nos permitem registrar um componente, esse pacote pode ser adicionado via web.xml, depois de adicionar o pacote no web.xml podemos criar a classe filha do Provider, essa classe também deve ser registrada no web.xml como provider. Depois disso é só sobrescrever o método registerCustomComponents e adicionar os componentes.

Exemplo:

public class CustomProvider extends SpringProvider{

	@Override
	protected void registerCustomComponents(ComponentRegistry registry) {
		
		registry.deepRegister(SituacaoMoradiaApplication.class);
		registry.deepRegister(SituacaoMoradiaRepository.class);
	}
}