Boa tarde, pessoal É o seguinte, tenho um projeto maven (war) que a princípio deveria utuilizar jars externos. Estou com problemas ao injetar a classe TesteCliente.java(que é um projeto jar externo) na classe LoginController(do projeto war ) , ocorre o seguinte erro conforme abaixo:
GRAVE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: cliente.TesteCliente br.com.j4business.sgpn.web.controller.LoginController.teste; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [cliente.TesteCliente] 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)}
====================================================== Abaixo segue o arquivo de configuração (spring-web-context.xml) este arquivo está configurado no projeto war
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
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.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="br.com.j4business" />
<context:component-scan base-package="br.com.j4business.cliente.cliente" />
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/views/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean class="cliente.TesteCliente">
</bean>
<mvc:resources mapping="/resources/**" location="/resources/" />
<mvc:annotation-driven />
</beans>