Concordion 클래스를 호출 할 수 없습니다 테스트-config.xml에Concordion 클래스는 서비스 콩 NullPointerExeption 서비스 콩 NullPointerExeption 호출 할 수 없습니다
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="IgnoreUnresolvablePlaceholders" value="True"></property>
<property name="locations">
<list>
<!-- <value>classpath:test.properties</value> -->
<!-- List other property files here -->
<!-- value>mail.properties</value -->
</list>
</property>
</bean>
<bean class="fr.teamnet.spec.UserController"></bean>
<bean class="fr.teamnet.service.UserServiceImpl"></bean>
</beans>
및 UserController.java is :
@ContextConfiguration(locations = "/test-config.xml")
public class UserController {
@Autowired
UserService userservice;
public String getPrenom(){
return userservice.findByUserName();
}
}
문제는 : Concordion 클래스가 SplittingNamesFixtureTest 클래스 라인의 항상 서비스 빈 NullPointerExeption을 호출 할 수 없습니다. String pren = service.getPrenom(); return NullPointerExeption plzz help
은 일입니다. findByUserName(); } userservice 빈은 null입니다 – HMI
나는 어디에서 문제가 있는지 모르겠다. 어느 생각이있어? – HMI
test-config.xml에 seviceBean을 선언하여이 문제를 해결했습니다. – HMI