Я добавил весь базовый пакет в мой applicationContext.xml, но все равно я показываю noBeanDefinitionException
.
applicationContext.xml
<!-- Autowiring -->
<context:component-scan base-package="com.paymentech.developercenter.services"/>
<import resource="classpath:spring/applicationContext-fragment-mybatisMOCK.xml" />
DispathcherServlet-servlet.xml
<import resource="classpath:spring/applicationContext.xml" />
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.FixedLocaleResolver">
<property name="defaultLocale" value="en_US" />
</bean>
<bean class="org.springframework.web.servlet.DispatcherServlet"/>
FaqControllerTest.java
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:spring/DispatcherServlet-servlet.xml" })
@WebAppConfiguration("WEB-INF/web.xml")
public class FaqControllerTest {
@Autowired
private WebApplicationContext context;
@Autowired
private DispatcherServlet dispatcherServlet;
@Before
public void init() throws ServletException, IOException {
SpringTestConfiguration.init(context, dispatcherServlet);
}
Ошибка: -
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'integratorSolutionController': Unsatisfied dependency expressed through field 'solutionService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'integratorSolutionService': Unsatisfied dependency expressed through field 'solutionStatusService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'solutionStatusService': Unsatisfied dependency expressed through field 'solutionStatusMapper'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.paymentech.developercenter.persistence.isg.mappers.SolutionStatusMapper' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}